]> source.dussan.org Git - aspectj.git/commitdiff
Simplify if-else in WildTypePattern.matchesExactlyByName
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Mon, 9 Jan 2023 16:59:20 +0000 (17:59 +0100)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Sun, 15 Jan 2023 13:41:51 +0000 (14:41 +0100)
A simple boolean condition is enough.

Loosely relates to https://github.com/eclipse/org.aspectj/issues/24, but
actually it is just drive-by cosmetics.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java

index 9c6a62a5f05912c9b5743ba36c671ae6fd21fd7c..37653a9cc83c3202e63b6bf81c38673de161ff22 100644 (file)
@@ -326,11 +326,7 @@ public class WildTypePattern extends TypePattern {
                                        numDimensionsInTargetType++;
                                        targetTypeName = targetTypeName.substring(index + 1);
                                }
-                               if (numDimensionsInTargetType == dim) {
-                                       return true;
-                               } else {
-                                       return false;
-                               }
+        return numDimensionsInTargetType == dim;
                        }
                }