aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/src
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:25:42 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:36:00 +0200
commit2debfa05f43a6fe71e7bc141f4f78c66f85c95b0 (patch)
tree0b536ac7ef2a5222c7382bc3d03f7023fb5c295d /bcel-builder/src
parentd66bec041a857bc3076a20dfeb1aa6037b020db1 (diff)
downloadaspectj-2debfa05f43a6fe71e7bc141f4f78c66f85c95b0.tar.gz
aspectj-2debfa05f43a6fe71e7bc141f4f78c66f85c95b0.zip
Single Map method can be used
Reports common usage patterns of java.util.Map that could be replaced with Java 8 methods: getOrDefault(), computeIfAbsent(), putIfAbsent(), merge(), or replaceAll(). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'bcel-builder/src')
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java
index a7689b108..f07b8f22e 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/NonCachingClassLoaderRepository.java
@@ -211,11 +211,7 @@ public class NonCachingClassLoaderRepository implements Repository {
*/
public JavaClass findClass(String className) {
synchronized (loadedClasses) {
- if (loadedClasses.containsKey(className)) {
- return loadedClasses.get(className);
- } else {
- return null;
- }
+ return loadedClasses.getOrDefault(className, null);
}
}