Skip to content

Commit ccef34d

Browse files
authored
Merge pull request #194 from jpush/feature/20211231_TS-7021
jdk支持版本修改为1.6以上
2 parents 6143432 + 099f7fe commit ccef34d

17 files changed

+36
-37
lines changed

pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>cn.jpush.api</groupId>
55
<artifactId>jpush-client</artifactId>
6-
<version>3.5.5</version>
6+
<version>3.6.0</version>
77
<packaging>jar</packaging>
88
<url>https://github.com/jpush/jpush-api-java-client</url>
99
<name>JPush API Java Client</name>
@@ -20,8 +20,8 @@
2020
<properties>
2121
<github.global.server>github</github.global.server>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23-
<jdkVersion>1.7</jdkVersion>
24-
<jdkVersion.test>1.7</jdkVersion.test>
23+
<jdkVersion>1.6</jdkVersion>
24+
<jdkVersion.test>1.6</jdkVersion.test>
2525
<!--<additionalparam>-Xdoclint:none</additionalparam>-->
2626
</properties>
2727

@@ -51,7 +51,7 @@
5151
<dependency>
5252
<groupId>cn.jpush.api</groupId>
5353
<artifactId>jiguang-common</artifactId>
54-
<version>1.1.12</version>
54+
<version>1.2.0</version>
5555
</dependency>
5656
<dependency>
5757
<groupId>org.apache.httpcomponents</groupId>

src/main/java/cn/jpush/api/admin/AdminClient.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ public void uploadCertificate(String appKey, String devCertificateFile, String d
115115
NativeHttpClient client = (NativeHttpClient) mHttpClient;
116116
String url = mBasePath + mV1AppPath + "/" + appKey + "/certificate";
117117

118-
Map<String, String> fileMap = new HashMap<>();
119-
Map<String, String> textMap = new HashMap<>();
118+
Map<String, String> fileMap = new HashMap<String, String>();
119+
Map<String, String> textMap = new HashMap<String, String>();
120120

121121
if(devCertificateFile != null) {
122122
textMap.put("devCertificatePassword", devCertificatePassword);

src/main/java/cn/jpush/api/file/FileClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public FileUploadResult uploadFile(FileType type, String filename)
5353
NativeHttpClient client = (NativeHttpClient) _httpClient;
5454
String typeStr = type.value();
5555
String url = _baseUrl + _filesPath + "/" + typeStr;
56-
Map<String, String> fileMap = new HashMap<>();
56+
Map<String, String> fileMap = new HashMap<String,String>();
5757
fileMap.put("filename", filename);
5858
String response = client.formUploadByPost(url, null, fileMap, null);
5959
LOG.info("uploadFile:{}", response);

src/main/java/cn/jpush/api/image/ImageClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public ImageUploadResult uploadImage(ImageFilePayload imageFilePayload) {
8686
NativeHttpClient client = (NativeHttpClient) _httpClient;
8787
String url = _baseUrl + _imagesPath + "/" + ImageSource.FILE.value();
8888

89-
Map<String, String> textMap = new HashMap<>();
89+
Map<String, String> textMap = new HashMap<String, String>();
9090
textMap.put("image_type", String.valueOf(imageFilePayload.getImageType().value()));
9191

9292
Map<String, String> fileMap = imageFilePayload.toFileMap();

src/main/java/cn/jpush/api/image/model/ImageFilePayload.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class ImageFilePayload {
2222
private String jiguangFileName;
2323

2424
public Map<String, String> toFileMap() {
25-
HashMap<String, String> fileMap = new HashMap<>();
25+
HashMap<String, String> fileMap = new HashMap<String, String>();
2626
if (null != oppoFileName) {
2727
fileMap.put(OPPO_IMAGE_FILE, oppoFileName);
2828
}

src/main/java/cn/jpush/api/push/model/Message.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public Builder addExtra(String key, JsonObject value) {
188188

189189
public Builder addCustom(Map<String, String> extras) {
190190
if (customData == null) {
191-
customData = new LinkedHashMap<>();
191+
customData = new LinkedHashMap<String, JsonPrimitive>();
192192
}
193193
for (Map.Entry<String, String> entry : extras.entrySet()) {
194194
customData.put(entry.getKey(), new JsonPrimitive(entry.getValue()));
@@ -199,7 +199,7 @@ public Builder addCustom(Map<String, String> extras) {
199199
public Builder addCustom(String key, Number value) {
200200
Preconditions.checkArgument(!(null == key), "Key should not be null.");
201201
if (customData == null) {
202-
customData = new LinkedHashMap<>();
202+
customData = new LinkedHashMap<String, JsonPrimitive>();
203203
}
204204
customData.put(key, new JsonPrimitive(value));
205205
return this;
@@ -208,7 +208,7 @@ public Builder addCustom(String key, Number value) {
208208
public Builder addCustom(String key, String value) {
209209
Preconditions.checkArgument(!(null == key), "Key should not be null.");
210210
if (customData == null) {
211-
customData = new LinkedHashMap<>();
211+
customData = new LinkedHashMap<String, JsonPrimitive>();
212212
}
213213
customData.put(key, new JsonPrimitive(value));
214214
return this;
@@ -217,7 +217,7 @@ public Builder addCustom(String key, String value) {
217217
public Builder addCustom(String key, Boolean value) {
218218
Preconditions.checkArgument(!(null == key), "Key should not be null.");
219219
if (customData == null) {
220-
customData = new LinkedHashMap<>();
220+
customData = new LinkedHashMap<String, JsonPrimitive>();
221221
}
222222
customData.put(key, new JsonPrimitive(value));
223223
return this;

src/main/java/cn/jpush/api/push/model/Options.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ public Builder setBigPushDuration(int bigPushDuration) {
194194
@Deprecated
195195
public Map<String, Map<String, String>> getThirdPartyChannel() {
196196
if (null != thirdPartyChannel) {
197-
Map<String, Map<String, String>> thirdPartyChannelRsp = new HashMap<>();
197+
Map<String, Map<String, String>> thirdPartyChannelRsp = new HashMap<String, Map<String, String>>();
198198
Set<Map.Entry<String, JsonObject>> entrySet = thirdPartyChannel.entrySet();
199199
for (Map.Entry<String, JsonObject> entry : entrySet) {
200200
JsonObject entryValue = entry.getValue();
201201
Set<Map.Entry<String, JsonElement>> valueEntrySet = entryValue.entrySet();
202-
Map<String, String> valueMap = new HashMap<>();
202+
Map<String, String> valueMap = new HashMap<String, String>();
203203
for (Map.Entry<String, JsonElement> valueEntry : valueEntrySet) {
204204
valueMap.put(valueEntry.getKey(), null == valueEntry.getValue() ? null : valueEntry.getValue().getAsString());
205205
}
@@ -212,7 +212,7 @@ public Map<String, Map<String, String>> getThirdPartyChannel() {
212212

213213
@Deprecated
214214
public Builder setThirdPartyChannel(Map<String, Map<String, String>> thirdPartyChannel) {
215-
this.thirdPartyChannel = new HashMap<>();
215+
this.thirdPartyChannel = new HashMap<String, JsonObject>();
216216
if (null != thirdPartyChannel) {
217217
Set<Map.Entry<String, Map<String, String>>> entrySet = thirdPartyChannel.entrySet();
218218
for (Map.Entry<String, Map<String, String>> entry : entrySet) {
@@ -239,7 +239,7 @@ public Builder setThirdPartyChannelV2(Map<String, JsonObject> thirdPartyChannel)
239239

240240
public Builder addCustom(Map<String, String> extras) {
241241
if (customData == null) {
242-
customData = new LinkedHashMap<>();
242+
customData = new LinkedHashMap<String, JsonPrimitive>();
243243
}
244244
for (Map.Entry<String, String> entry : extras.entrySet()) {
245245
customData.put(entry.getKey(), new JsonPrimitive(entry.getValue()));
@@ -250,7 +250,7 @@ public Builder addCustom(Map<String, String> extras) {
250250
public Builder addCustom(String key, Number value) {
251251
Preconditions.checkArgument(! (null == key), "Key should not be null.");
252252
if (customData == null) {
253-
customData = new LinkedHashMap<>();
253+
customData = new LinkedHashMap<String, JsonPrimitive>();
254254
}
255255
customData.put(key, new JsonPrimitive(value));
256256
return this;
@@ -259,7 +259,7 @@ public Builder addCustom(String key, Number value) {
259259
public Builder addCustom(String key, String value) {
260260
Preconditions.checkArgument(! (null == key), "Key should not be null.");
261261
if (customData == null) {
262-
customData = new LinkedHashMap<>();
262+
customData = new LinkedHashMap<String, JsonPrimitive>();
263263
}
264264
customData.put(key, new JsonPrimitive(value));
265265
return this;
@@ -268,7 +268,7 @@ public Builder addCustom(String key, String value) {
268268
public Builder addCustom(String key, Boolean value) {
269269
Preconditions.checkArgument(! (null == key), "Key should not be null.");
270270
if (customData == null) {
271-
customData = new LinkedHashMap<>();
271+
customData = new LinkedHashMap<String, JsonPrimitive>();
272272
}
273273
customData.put(key, new JsonPrimitive(value));
274274
return this;

src/main/java/cn/jpush/api/push/model/PushPayload.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public static class Builder {
284284
private Map<String, JsonObject> custom;
285285

286286
public Builder() {
287-
this.custom = new LinkedHashMap<>();
287+
this.custom = new LinkedHashMap<String, JsonObject>();
288288
}
289289

290290
public Builder setTarget(String target) {

src/main/java/cn/jpush/api/push/model/audience/Audience.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public static Audience fromJsonElement(JsonElement jsonElement) {
145145
}
146146
boolean file = false;
147147
JsonObject jsonObject = jsonElement.getAsJsonObject();
148-
Set<AudienceTarget> audienceTargetSet = new HashSet<>();
148+
Set<AudienceTarget> audienceTargetSet = new HashSet<AudienceTarget>();
149149
for (AudienceType type : AudienceType.values()) {
150150
JsonArray jsonArray = jsonObject.getAsJsonArray(type.value());
151151
if (jsonArray == null) {

src/main/java/cn/jpush/api/push/model/audience/AudienceTarget.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public JsonElement toFileJSON() {
114114
}
115115

116116
public static AudienceTarget fromJsonElement(JsonArray jsonArray, AudienceType type) {
117-
Set<String> stringSet = new HashSet<>();
117+
Set<String> stringSet = new HashSet<String>();
118118
if (jsonArray != null) {
119119
for (int i=0; i<jsonArray.size(); i++) {
120120
stringSet.add(jsonArray.get(i).getAsString());

src/main/java/cn/jpush/api/push/model/notification/PlatformNotification.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public PlatformNotification(Object alert, Map<String, String> extras,
3636
this.numberExtras = numberExtras;
3737
this.booleanExtras = booleanExtras;
3838
this.jsonExtras = jsonExtras;
39-
customData = new LinkedHashMap<>();
39+
customData = new LinkedHashMap<String, JsonPrimitive>();
4040
}
4141

4242
public PlatformNotification(Object alert, Map<String, String> extras,
@@ -142,7 +142,7 @@ protected abstract static class Builder<T extends PlatformNotification, B extend
142142
protected Map<String, JsonPrimitive> customData;
143143

144144
public Builder () {
145-
customData = new LinkedHashMap<>();
145+
customData = new LinkedHashMap<String, JsonPrimitive>();
146146
theBuilder = getThis();
147147
}
148148

src/main/java/cn/jpush/api/report/GroupMessageDetailResult.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class GroupMessageDetailResult extends BaseResult {
1919
private static final Type RECEIVED_TYPE = new TypeToken<List<Received>>() {}.getType();
2020

2121
@Expose
22-
public List<Received> received_list = new ArrayList<>();
22+
public List<Received> received_list = new ArrayList<Received>();
2323

2424
public static class Received {
2525
@Expose

src/test/java/cn/jpush/api/BaseTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
public abstract class BaseTest {
66

7-
protected static final String APP_KEY = "d4ee2375846bc30fa51334f5";
8-
protected static final String MASTER_SECRET = "3f045fd404d09a8a1f38d791";
7+
protected static final String APP_KEY = "eb67142502ec9f5556875b9a";
8+
protected static final String MASTER_SECRET = "186aa57bc697c94f8698bbbf";
99
protected static final String GROUP_MASTER_SECRET = "b11314807507e2bcfdeebe2e";
1010
protected static final String GROUP_PUSH_KEY = "2c88a01e073a0fe4fc7b167c";
1111

src/test/java/cn/jpush/api/device/DeviceNormalRemoteTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void testBindMobile_empty() throws APIConnectionException, APIRequestExce
200200
@Test
201201
@TestOrder(order = 330)
202202
public void testRemoveDevicesFromAlias() throws APIConnectionException, APIRequestException {
203-
Set<String> toRemoveDevice = new HashSet<>();
203+
Set<String> toRemoveDevice = new HashSet<String>();
204204
toRemoveDevice.add(REGISTRATION_ID1);
205205
DefaultResult result = jpushClient.removeDevicesFromAlias("alias1", toRemoveDevice);
206206
assertTrue(result.isResultOK());

src/test/java/cn/jpush/api/image/ImageClientTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public void testUploadImageByFile() throws NoSuchFieldException {
7373
.setXiaomiFileName("dir/xiaomiXX.jpg")
7474
.build();
7575
ImageUploadResult imageUploadResult = spyClient.uploadImage(payload);
76-
HashMap<String, String> textMap = new HashMap<>();
76+
HashMap<String, String> textMap = new HashMap<String, String>();
7777
textMap.put("image_type", "2");
78-
HashMap<String, String> fileMap = new HashMap<>();
78+
HashMap<String, String> fileMap = new HashMap<String, String>();
7979
fileMap.put("oppo_file", "oppoXX.jpg");
8080
fileMap.put("xiaomi_file", "dir/xiaomiXX.jpg");
8181
verify(mockIHttpClient).formUploadByPost("https://api.jpush.cn/v3/images/byfiles", textMap, fileMap, null);
@@ -136,7 +136,7 @@ public void testModifyImageByFile() throws NoSuchFieldException {
136136
.setXiaomiFileName("dir/xiaomiXX.jpg")
137137
.build();
138138
ImageUploadResult imageUploadResult = spyClient.modifyImage(mediaId, payload);
139-
HashMap<String, String> fileMap = new HashMap<>();
139+
HashMap<String, String> fileMap = new HashMap<String, String>();
140140
fileMap.put("oppo_file", "oppoXX.jpg");
141141
fileMap.put("xiaomi_file", "dir/xiaomiXX.jpg");
142142
verify(mockIHttpClient).formUploadByPut("https://api.jpush.cn/v3/images/byfiles/" + mediaId, null, fileMap, null);

src/test/java/cn/jpush/api/push/model/OptionsTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ public void testBigPushDuration() {
136136
public void testThirdPartyChannel() {
137137
int sendno = ServiceHelper.generateSendno();
138138

139-
Map<String, Map<String, String>> thirdMap = new HashMap<>();
140-
Map<String, String> huaweiMap = new HashMap<>();
139+
Map<String, Map<String, String>> thirdMap = new HashMap<String, Map<String, String>>();
140+
Map<String, String> huaweiMap = new HashMap<String, String>();
141141
huaweiMap.put("distribution", "jpush");
142142
thirdMap.put("huawei", huaweiMap);
143143

@@ -163,7 +163,7 @@ public void testThirdPartyChannel() {
163163
public void testThirdPartyChannelV2() {
164164
int sendno = ServiceHelper.generateSendno();
165165

166-
Map<String, JsonObject> thirdMap = new HashMap<>();
166+
Map<String, JsonObject> thirdMap = new HashMap<String, JsonObject>();
167167
JsonObject vivoJsonObj = new JsonObject();
168168
vivoJsonObj.addProperty("distribution", "ospush");
169169
vivoJsonObj.addProperty("classification", 1);

src/test/java/cn/jpush/api/push/model/notification/AndroidNotificationTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import java.util.HashMap;
1313
import java.util.Map;
14-
import java.util.Objects;
1514

1615
@Category(FastTests.class)
1716
public class AndroidNotificationTest {
@@ -68,7 +67,7 @@ public void testExtra_nullvalue() {
6867
@Test
6968
public void testCustomParam() {
7069

71-
Map<String, String> customParams = new HashMap<>();
70+
Map<String, String> customParams = new HashMap<String, String>();
7271
customParams.put("custom_field1", "field1");
7372
customParams.put("custom_field2", "field2");
7473
customParams.put("custom_field3", "field3");

0 commit comments

Comments
 (0)