diff options
author | aclement <aclement> | 2008-09-04 21:06:16 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-09-04 21:06:16 +0000 |
commit | 988458bbc0c8f2b06bd18c56075f153b24d93f9b (patch) | |
tree | 244c6f673536850bf47dc4f420139cd91d6e0da7 | |
parent | 48af77e2d1506a92f5a5af25fdb6289e9800cb4f (diff) | |
download | aspectj-988458bbc0c8f2b06bd18c56075f153b24d93f9b.tar.gz aspectj-988458bbc0c8f2b06bd18c56075f153b24d93f9b.zip |
246281: test and fix
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java index f2c639bf8..a5ad9ed6d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -41,6 +41,7 @@ import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation; import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult; import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; +import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation; import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryField; import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryMethod; import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType; @@ -1341,6 +1342,27 @@ public class AjState implements CompilerConfigurationChangeFlags { return true; } + // have annotations changed on the type? + IBinaryAnnotation[] newAnnos = reader.getAnnotations(); + if (newAnnos == null || newAnnos.length == 0) { + if (existingType.annotations != null && existingType.annotations.length != 0) { + return true; + } + } else { + IBinaryAnnotation[] existingAnnos = existingType.annotations; + if (existingAnnos == null || existingAnnos.length != newAnnos.length) { + return true; + } + // Does not allow for an order switch + // Does not cope with a change in values set on the annotation (hard to create a testcase where this is a problem tho) + for (int i = 0; i < newAnnos.length; i++) { + if (!CharOperation.equals(newAnnos[i].getTypeName(), existingAnnos[i].getTypeName())) { + return true; + } + } + + } + // interfaces char[][] existingIfs = existingType.interfaces; char[][] newIfsAsChars = reader.getInterfaceNames(); |