diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-21 17:34:09 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-21 17:34:09 +0700 |
commit | ecb5320c7b61d72edbf4a440e4996171a9c8f7dd (patch) | |
tree | 2b5496ad42ca47d0f3c7e636f2130dbb4d8b6e2c /asm | |
parent | e4a2a5a5d274bc16bae3d1178789752dba043730 (diff) | |
download | aspectj-ecb5320c7b61d72edbf4a440e4996171a9c8f7dd.tar.gz aspectj-ecb5320c7b61d72edbf4a440e4996171a9c8f7dd.zip |
Fix some deprecated Java and JUnit warnings by using newer API calls
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'asm')
-rw-r--r-- | asm/src/main/java/org/aspectj/asm/AsmManager.java | 4 | ||||
-rw-r--r-- | asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/asm/src/main/java/org/aspectj/asm/AsmManager.java b/asm/src/main/java/org/aspectj/asm/AsmManager.java index eaf728296..cbebe2842 100644 --- a/asm/src/main/java/org/aspectj/asm/AsmManager.java +++ b/asm/src/main/java/org/aspectj/asm/AsmManager.java @@ -1173,8 +1173,8 @@ public class AsmManager implements IStructureModel { private ModelInfo(IHierarchy hierarchy, IRelationshipMap relationshipMap) { IProgramElement ipe = hierarchy.getRoot(); walkModel(ipe); - recordStat("FileMapSize", new Integer(hierarchy.getFileMapEntrySet().size()).toString()); - recordStat("RelationshipMapSize", new Integer(relationshipMap.getEntries().size()).toString()); + recordStat("FileMapSize", Integer.toString(hierarchy.getFileMapEntrySet().size())); + recordStat("RelationshipMapSize", Integer.toString(relationshipMap.getEntries().size())); } private void walkModel(IProgramElement ipe) { diff --git a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java index 60a823e20..0ae669502 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java +++ b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java @@ -171,7 +171,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; + count = Integer.parseInt(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -181,13 +181,13 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { } } if (count > 1) { - return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); + return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); } } else if (ipe.getKind().isDeclare()) { // // look at peer declares int count = computeCountBasedOnPeers(ipe); if (count > 1) { - return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); + return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); } } else if (ipe.getKind().equals(IProgramElement.Kind.ADVICE)) { // Look at any peer advice @@ -227,7 +227,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; + count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -238,7 +238,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { } } if (count > 1) { - return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); + return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); } } else if (ipe.getKind().equals(IProgramElement.Kind.INITIALIZER)) { // return String.valueOf(++initializerCounter).toCharArray(); @@ -279,7 +279,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; + count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -290,7 +290,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { } } // if (count > 1) { - return new Integer(count).toString().toCharArray(); + return Integer.toString(count).toCharArray(); // return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); // } } else if (ipe.getKind().equals(IProgramElement.Kind.CODE)) { @@ -314,7 +314,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { int suffixPosition = existingHandle.lastIndexOf('!'); int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 - count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; + count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -334,7 +334,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { int suffixPosition = existingHandle.lastIndexOf('!'); int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 - count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; + count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -345,7 +345,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { } } if (count > 1) { - return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray()); + return CharOperation.concat(countDelim, Integer.toString(count).toCharArray()); } } return empty; @@ -383,7 +383,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; + count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; |