aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-15 17:01:46 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-15 17:01:46 +0200
commit639f5030e0391e831138f9786cf831c3374449e7 (patch)
treefc4e616cb6df8e73722a6d0cf83a55efd6d87387 /asm
parent2409bcbc7c9606b055e23f52d688eecda84351d6 (diff)
downloadaspectj-639f5030e0391e831138f9786cf831c3374449e7.tar.gz
aspectj-639f5030e0391e831138f9786cf831c3374449e7.zip
Weaken Collection declarations
Reports on declarations of Collection variables made by using the collection class as the type, rather than an appropriate interface. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'asm')
-rw-r--r--asm/src/main/java/org/aspectj/asm/AsmManager.java2
-rw-r--r--asm/src/main/java/org/aspectj/asm/IHierarchy.java6
-rw-r--r--asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java2
3 files changed, 7 insertions, 3 deletions
diff --git a/asm/src/main/java/org/aspectj/asm/AsmManager.java b/asm/src/main/java/org/aspectj/asm/AsmManager.java
index dc766eb7f..5fcaf3cf6 100644
--- a/asm/src/main/java/org/aspectj/asm/AsmManager.java
+++ b/asm/src/main/java/org/aspectj/asm/AsmManager.java
@@ -155,7 +155,7 @@ public class AsmManager implements IStructureModel {
return null;
} else {
IProgramElement fileNode = node;
- ArrayList<IProgramElement> peNodes = new ArrayList<>();
+ List<IProgramElement> peNodes = new ArrayList<>();
getAllStructureChildren(fileNode, peNodes, showSubMember, showMemberAndType);
for (IProgramElement peNode : peNodes) {
List<IProgramElement> entries = new ArrayList<>();
diff --git a/asm/src/main/java/org/aspectj/asm/IHierarchy.java b/asm/src/main/java/org/aspectj/asm/IHierarchy.java
index 6674cdaea..80ed2b551 100644
--- a/asm/src/main/java/org/aspectj/asm/IHierarchy.java
+++ b/asm/src/main/java/org/aspectj/asm/IHierarchy.java
@@ -39,7 +39,11 @@ public interface IHierarchy extends Serializable {
public boolean removeFromFileMap(String canonicalFilePath);
- public void setFileMap(HashMap<String, IProgramElement> fileMap);
+ public void setFileMap(Map<String, IProgramElement> fileMap);
+
+ public default void setFileMap(HashMap<String, IProgramElement> fileMap) {
+ setFileMap((Map<String, IProgramElement>) fileMap);
+ }
public Object findInFileMap(Object key);
diff --git a/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java
index 869affd91..c524c554a 100644
--- a/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java
+++ b/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java
@@ -96,7 +96,7 @@ public class AspectJElementHierarchy implements IHierarchy {
return fileMap.remove(canonicalFilePath) != null;
}
- public void setFileMap(HashMap<String, IProgramElement> fileMap) {
+ public void setFileMap(Map<String, IProgramElement> fileMap) {
this.fileMap = fileMap;
}