Messaging: Replace explicit types

Change-Id: I2165b3dec73973a2a82d8b3c7c364b5f011e597d
This commit is contained in:
Michael W
2024-12-26 15:54:37 +01:00
parent 9538179c75
commit 0069df879a
124 changed files with 278 additions and 277 deletions
@@ -114,8 +114,7 @@ class DownloadRequest extends MmsRequest {
return false;
}
public static final Parcelable.Creator<DownloadRequest> CREATOR
= new Parcelable.Creator<DownloadRequest>() {
public static final Parcelable.Creator<DownloadRequest> CREATOR = new Parcelable.Creator<>() {
public DownloadRequest createFromParcel(Parcel in) {
return new DownloadRequest(in);
}
+1 -2
View File
@@ -145,8 +145,7 @@ class SendRequest extends MmsRequest {
return null;
}
public static final Parcelable.Creator<SendRequest> CREATOR
= new Parcelable.Creator<SendRequest>() {
public static final Parcelable.Creator<SendRequest> CREATOR = new Parcelable.Creator<>() {
public SendRequest createFromParcel(Parcel in) {
return new SendRequest(in);
}
@@ -122,8 +122,8 @@ public class CharacterSets {
static {
// Create the HashMaps.
MIBENUM_TO_NAME_MAP = new HashMap<Integer, String>();
NAME_TO_MIBENUM_MAP = new HashMap<String, Integer>();
MIBENUM_TO_NAME_MAP = new HashMap<>();
NAME_TO_MIBENUM_MAP = new HashMap<>();
assert(MIBENUM_NUMBERS.length == MIME_NAMES.length);
int count = MIBENUM_NUMBERS.length - 1;
for(int i = 0; i <= count; i++) {
@@ -78,10 +78,10 @@ public class ContentType {
public static final String APP_DRM_CONTENT = "application/vnd.oma.drm.content";
public static final String APP_DRM_MESSAGE = "application/vnd.oma.drm.message";
private static final ArrayList<String> sSupportedContentTypes = new ArrayList<String>();
private static final ArrayList<String> sSupportedImageTypes = new ArrayList<String>();
private static final ArrayList<String> sSupportedAudioTypes = new ArrayList<String>();
private static final ArrayList<String> sSupportedVideoTypes = new ArrayList<String>();
private static final ArrayList<String> sSupportedContentTypes = new ArrayList<>();
private static final ArrayList<String> sSupportedImageTypes = new ArrayList<>();
private static final ArrayList<String> sSupportedAudioTypes = new ArrayList<>();
private static final ArrayList<String> sSupportedVideoTypes = new ArrayList<>();
static {
sSupportedContentTypes.add(TEXT_PLAIN);
@@ -230,7 +230,7 @@ public class EncodedStringValue implements Cloneable {
public static EncodedStringValue[] extract(String src) {
String[] values = src.split(";");
ArrayList<EncodedStringValue> list = new ArrayList<EncodedStringValue>();
ArrayList<EncodedStringValue> list = new ArrayList<>();
for (int i = 0; i < values.length; i++) {
if (values[i].length() > 0) {
list.add(new EncodedStringValue(values[i]));
+5 -5
View File
@@ -34,12 +34,12 @@ public class PduBody {
* Constructor.
*/
public PduBody() {
mParts = new Vector<PduPart>();
mParts = new Vector<>();
mPartMapByContentId = new HashMap<String, PduPart>();
mPartMapByContentLocation = new HashMap<String, PduPart>();
mPartMapByName = new HashMap<String, PduPart>();
mPartMapByFileName = new HashMap<String, PduPart>();
mPartMapByContentId = new HashMap<>();
mPartMapByContentLocation = new HashMap<>();
mPartMapByName = new HashMap<>();
mPartMapByFileName = new HashMap<>();
}
private void putPartToMaps(PduPart part) {
@@ -327,7 +327,7 @@ public class PduHeaders {
* Constructor of PduHeaders.
*/
public PduHeaders() {
mHeaderMap = new HashMap<Integer, Object>();
mHeaderMap = new HashMap<>();
}
/**
@@ -633,7 +633,7 @@ public class PduHeaders {
throw new RuntimeException("Invalid header field!");
}
ArrayList<EncodedStringValue> list = new ArrayList<EncodedStringValue>();
ArrayList<EncodedStringValue> list = new ArrayList<>();
for (int i = 0; i < value.length; i++) {
list.add(value[i]);
}
@@ -665,7 +665,7 @@ public class PduHeaders {
ArrayList<EncodedStringValue> list =
(ArrayList<EncodedStringValue>) mHeaderMap.get(field);
if (null == list) {
list = new ArrayList<EncodedStringValue>();
list = new ArrayList<>();
}
list.add(value);
mHeaderMap.put(field, list);
@@ -779,8 +779,7 @@ public class PduParser {
}
case PduHeaders.CONTENT_TYPE: {
HashMap<Integer, Object> map =
new HashMap<Integer, Object>();
HashMap<Integer, Object> map = new HashMap<>();
byte[] contentType =
parseContentType(pduDataStream, map);
@@ -849,7 +848,7 @@ public class PduParser {
}
/* parse part's content-type */
HashMap<Integer, Object> map = new HashMap<Integer, Object>();
HashMap<Integer, Object> map = new HashMap<>();
byte[] contentType = parseContentType(pduDataStream, map);
if (null != contentType) {
part.setContentType(contentType);
+1 -1
View File
@@ -126,7 +126,7 @@ public class PduPart {
* Empty Constructor.
*/
public PduPart() {
mPartHeader = new HashMap<Integer, Object>();
mPartHeader = new HashMap<>();
}
/**