diff options
author | aclement <aclement> | 2010-08-26 15:20:03 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-08-26 15:20:03 +0000 |
commit | e0e1330c6e01a878d365bff112f1c6505c7e6ebd (patch) | |
tree | 92097a68b53de5401697ca03fa2f667f27c961cd /org.aspectj.matcher | |
parent | ce16a06749d562fd123e4ecb984ec3a5a8cf5a94 (diff) | |
download | aspectj-e0e1330c6e01a878d365bff112f1c6505c7e6ebd.tar.gz aspectj-e0e1330c6e01a878d365bff112f1c6505c7e6ebd.zip |
320468
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/patterns/ModifiersPattern.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/ModifiersPattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/ModifiersPattern.java index a8d2680e3..d63fc8ecf 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/ModifiersPattern.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/ModifiersPattern.java @@ -26,6 +26,18 @@ public class ModifiersPattern extends PatternNode { public static final ModifiersPattern ANY = new ModifiersPattern(0, 0); + private static Map<String, Integer> modifierFlags = null; + + static { + modifierFlags = new HashMap<String, Integer>(); + int flag = 1; + while (flag <= Modifier.STRICT) { + String flagName = Modifier.toString(flag); + modifierFlags.put(flagName, new Integer(flag)); + flag = flag << 1; + } + } + public ModifiersPattern(int requiredModifiers, int forbiddenModifiers) { this.requiredModifiers = requiredModifiers; this.forbiddenModifiers = forbiddenModifiers; @@ -78,19 +90,8 @@ public class ModifiersPattern extends PatternNode { s.writeShort(forbiddenModifiers); } - private static Map modifierFlags = null; - public static int getModifierFlag(String name) { - if (modifierFlags == null) { - modifierFlags = new HashMap(); - int flag = 1; - while (flag <= Modifier.STRICT) { - String flagName = Modifier.toString(flag); - modifierFlags.put(flagName, new Integer(flag)); - flag = flag << 1; - } - } - Integer flag = (Integer) modifierFlags.get(name); + Integer flag = modifierFlags.get(name); if (flag == null) { return -1; } |