diff options
author | mkersten <mkersten> | 2003-08-08 13:14:39 +0000 |
---|---|---|
committer | mkersten <mkersten> | 2003-08-08 13:14:39 +0000 |
commit | 18f9c1e2dbd6533e1e939871a6129ed1a95800e8 (patch) | |
tree | 940d66aa2809f1fc8751de41a67fcb356102969a /asm/src | |
parent | 2a3bba0a02528777cdc9bc1eab6f7e3256991894 (diff) | |
download | aspectj-18f9c1e2dbd6533e1e939871a6129ed1a95800e8.tar.gz aspectj-18f9c1e2dbd6533e1e939871a6129ed1a95800e8.zip |
Fixed ProgramElement modifiers bug.
Diffstat (limited to 'asm/src')
-rw-r--r-- | asm/src/org/aspectj/asm/IProgramElement.java | 1 | ||||
-rw-r--r-- | asm/src/org/aspectj/asm/internal/ProgramElement.java | 18 |
2 files changed, 13 insertions, 6 deletions
diff --git a/asm/src/org/aspectj/asm/IProgramElement.java b/asm/src/org/aspectj/asm/IProgramElement.java index 24132f55d..17f16aa87 100644 --- a/asm/src/org/aspectj/asm/IProgramElement.java +++ b/asm/src/org/aspectj/asm/IProgramElement.java @@ -61,6 +61,7 @@ public interface IProgramElement extends Serializable { public IProgramElement walk(HierarchyWalker walker); public void setName(String name); public void setChildren(List children); + public void setModifiers(int i); /** * Uses "typesafe enum" pattern. diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java index 5fd769e02..eec6389e2 100644 --- a/asm/src/org/aspectj/asm/internal/ProgramElement.java +++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java @@ -87,7 +87,7 @@ public class ProgramElement implements IProgramElement { public ProgramElement( String name, Kind kind, - List modifiers, + int modifiers, Accessibility accessibility, String declaringType, String packageName, @@ -100,7 +100,7 @@ public class ProgramElement implements IProgramElement { this(name, kind, children); this.sourceLocation = sourceLocation; this.kind = kind; - this.modifiers = modifiers; + this.modifiers = genModifiers(modifiers); this.accessibility = accessibility; this.declaringType = declaringType; this.packageName = packageName; @@ -210,7 +210,7 @@ public class ProgramElement implements IProgramElement { return getName(); } - public static List genModifiers(int modifiers) { + private static List genModifiers(int modifiers) { List modifiersList = new ArrayList(); if ((modifiers & AccStatic) != 0) modifiersList.add(IProgramElement.Modifiers.STATIC); if ((modifiers & AccFinal) != 0) modifiersList.add(IProgramElement.Modifiers.STATIC); @@ -219,7 +219,7 @@ public class ProgramElement implements IProgramElement { if ((modifiers & AccTransient) != 0) modifiersList.add(IProgramElement.Modifiers.STATIC); if ((modifiers & AccNative) != 0) modifiersList.add(IProgramElement.Modifiers.STATIC); if ((modifiers & AccAbstract) != 0) modifiersList.add(IProgramElement.Modifiers.STATIC); - return modifiersList; + return modifiersList; } public static IProgramElement.Accessibility genAccessibility(int modifiers) { @@ -229,8 +229,6 @@ public class ProgramElement implements IProgramElement { if ((modifiers & AccPrivileged) != 0) return IProgramElement.Accessibility.PRIVILEGED; else return IProgramElement.Accessibility.PACKAGE; } - - // XXX these names and values are from org.eclipse.jdt.internal.compiler.env.IConstants private static int AccPublic = 0x0001; @@ -360,5 +358,13 @@ public class ProgramElement implements IProgramElement { walker.process(this); return buffer.toString(); } + /** + * + */ + + public void setModifiers(int i) { + this.modifiers = genModifiers(i); + } + } |