updated to AspectJ 1.8.7 snapshot that includes mars JDT
diff --git a/org.aspectj.ajde/META-INF/MANIFEST.MF b/org.aspectj.ajde/META-INF/MANIFEST.MF
index 9631b87..91766c6 100644
--- a/org.aspectj.ajde/META-INF/MANIFEST.MF
+++ b/org.aspectj.ajde/META-INF/MANIFEST.MF
@@ -57,8 +57,6 @@
org.aspectj.org.eclipse.jdt.internal.core.util,
org.aspectj.org.eclipse.jdt.internal.eval,
org.aspectj.org.eclipse.jdt.internal.formatter,
- org.aspectj.org.eclipse.jdt.internal.formatter.align,
- org.aspectj.org.eclipse.jdt.internal.formatter.comment,
org.aspectj.org.eclipse.jdt.internal.formatter.old,
org.aspectj.tools.ajc,
org.aspectj.tools.ajdoc,
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/ajc/BuildArgParser.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/ajc/BuildArgParser.class
index 9bed94e..fd31d64 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/ajc/BuildArgParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/ajc/BuildArgParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter$CompilerAdapter$1.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter$CompilerAdapter$1.class
index 7479f32..373a609 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter$CompilerAdapter$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter$CompilerAdapter$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter.class
index d8f7117..b5be52b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/CompilerAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/DefaultCompilerAdapter.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/DefaultCompilerAdapter.class
index d79f68f..5ad1d03 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/DefaultCompilerAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/DefaultCompilerAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapter.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapter.class
index 6dfd288..abae8fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapterFactory.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapterFactory.class
index 1e5e5ed..538ac24 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapterFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ICompilerAdapterFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.class
index f13388b..f8baa8d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassCreationListener.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassCreationListener.class
index 90212e9..ab52c56 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassCreationListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassCreationListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassPublisher.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassPublisher.class
index 01b4ad2..1ad15e2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassPublisher.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/AnonymousClassPublisher.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForFieldBindings.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForFieldBindings.class
index e582252..b261743 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForFieldBindings.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForFieldBindings.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForMethodBindings.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForMethodBindings.class
index 10f0cd8..20ba705 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForMethodBindings.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/OwningClassSupportForMethodBindings.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/WarnOnSwallowedException.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/WarnOnSwallowedException.class
index 209c6e7..f940370 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/WarnOnSwallowedException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/lookup/WarnOnSwallowedException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/parser/AllowAssertAndEnumAsIdentifierTokensInPointcutExpressions.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/parser/AllowAssertAndEnumAsIdentifierTokensInPointcutExpressions.class
index 54b44eb..d14b5f5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/parser/AllowAssertAndEnumAsIdentifierTokensInPointcutExpressions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/compiler/parser/AllowAssertAndEnumAsIdentifierTokensInPointcutExpressions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjBuildManager.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjBuildManager.class
index 43f15a4..d987d6b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjBuildManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjBuildManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.class
index f757dae..32b3e4e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.class b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.class
index c6264a6..c7062cf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BindingKey.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BindingKey.class
index 13792df..a307aef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BindingKey.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BindingKey.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BufferChangedEvent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BufferChangedEvent.class
index 4003b48..30a83ab 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BufferChangedEvent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/BufferChangedEvent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer$1.class
index a1437a0..5da4ac4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer.class
index 59c65d8..d095d4d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathContainerInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathVariableInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathVariableInitializer.class
index f4776f8..c286fbf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathVariableInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ClasspathVariableInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionContext.class
index ef04b39..32c48bc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionFlags.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionFlags.class
index ccbd81c..c7d44c6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionFlags.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionFlags.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionProposal.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionProposal.class
index ef2b914..5032d7d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionProposal.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionProposal.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestor.class
index e1b2a99..e5249cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestorAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestorAdapter.class
index a03ee78..d566ae4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestorAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CompletionRequestorAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine$1.class
index cc3f9f1..ecdee91 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine.class
index cfeb475..0de0c5e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/CorrectionEngine.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ElementChangedEvent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ElementChangedEvent.class
index 1715c8d..c08cd04 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ElementChangedEvent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ElementChangedEvent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Flags.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Flags.class
index 53aba15..5d6676b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Flags.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Flags.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAccessRule.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAccessRule.class
index 852c01b..14df00a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAccessRule.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAccessRule.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotatable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotatable.class
index 01f3b56..888beca 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotatable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotatable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotation.class
index 10bf4b5..5470d82 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer$ITextEditCapability.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer$ITextEditCapability.class
index bf25c46..bd8fc72 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer$ITextEditCapability.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer$ITextEditCapability.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer.class
index d23a705..5890243 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBuffer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferChangedListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferChangedListener.class
index dfd7ebb..7c33b10 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferChangedListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferChangedListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferFactory.class
index f536b43..cce966a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IBufferFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClassFile.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClassFile.class
index fa55497..5b451bf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClassFile.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClassFile.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.class
index 487fd3c..2695485 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathContainer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathContainer.class
index 36ec52a..bc04aec 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathContainer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathContainer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathEntry.class
index 88491fc..9b9fa74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IClasspathEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeAssist.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeAssist.class
index a9a7d2c..355088e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeAssist.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeAssist.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeCompletionRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeCompletionRequestor.class
index 40ece78..9b22896 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeCompletionRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeCompletionRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeFormatter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeFormatter.class
index 8cc64f6..2c3a837 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeFormatter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICodeFormatter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.class
index 7e3e0ed..40caf86 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompletionRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompletionRequestor.class
index f35e792..7a57813 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompletionRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICompletionRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICorrectionRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICorrectionRequestor.class
index 8e3e69d..d96ceb7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICorrectionRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ICorrectionRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IElementChangedListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IElementChangedListener.class
index 2a25880..24cde58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IElementChangedListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IElementChangedListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IField.class
index 310fbe1..ee889fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportContainer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportContainer.class
index 55de73e..4ff3628 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportContainer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportContainer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportDeclaration.class
index 5904a16..41a1a6e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IImportDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IInitializer.class
index 89f28d5..0d85587 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJarEntryResource.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJarEntryResource.class
index 616cab6..4d0a97a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJarEntryResource.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJarEntryResource.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElement.class
index 8311fdb..809aa4e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElementDelta.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElementDelta.class
index a3fa451..1aff6f3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElementDelta.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaElementDelta.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModel.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModel.class
index b2aa830..84c25a7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModel.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModel.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelMarker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelMarker.class
index 3bc4b58..cc2e6bd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelMarker.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelMarker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatus.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatus.class
index c62ce59..9beae31 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatus.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatus.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatusConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatusConstants.class
index 9b9a1de..cf830ae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatusConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaModelStatusConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaProject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaProject.class
index 3f71aef..4c24599 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaProject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IJavaProject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ILocalVariable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ILocalVariable.class
index f3c848d..882172d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ILocalVariable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ILocalVariable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMember.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMember.class
index 754fe21..c7cb707 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMember.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMember.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMemberValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMemberValuePair.class
index ec3624d..ba870a8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMemberValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMemberValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMethod.class
index 42da605..93327e9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IOpenable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IOpenable.class
index b03b3b3..6699efd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IOpenable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IOpenable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageDeclaration.class
index 1855f38..97a4a2d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragment.class
index 33205f2..c48900e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragmentRoot.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragmentRoot.class
index c316b80..3977472 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragmentRoot.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IPackageFragmentRoot.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IParent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IParent.class
index 20bbaac..7a32145 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IParent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IParent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IProblemRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IProblemRequestor.class
index 546a881..1db5abb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IProblemRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IProblemRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IRegion.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IRegion.class
index 9b9f63a..aac2a51 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IRegion.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IRegion.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceManipulation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceManipulation.class
index 12d12ec..c6a1463 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceManipulation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceManipulation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceRange.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceRange.class
index 2af4a00..7f90cd5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceRange.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceRange.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceReference.class
index 96d7118..9c485b5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ISourceReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IType.class
index 11ddffc..5e42d08 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchy.class
index cac654f..e2bff89 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchy.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchyChangedListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchyChangedListener.class
index 63b56df..7640c71 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchyChangedListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeHierarchyChangedListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeParameter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeParameter.class
index 05ee37a..3b854a4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeParameter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeParameter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeRoot.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeRoot.class
index 807dce1..b7bf2dc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeRoot.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ITypeRoot.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IWorkingCopy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IWorkingCopy.class
index a7e156e..b2e65b6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IWorkingCopy.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/IWorkingCopy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaConventions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaConventions.class
index d53eb1a..4e11c14 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaConventions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaConventions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$1.class
index 757d97b..e937bff 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$2.class
index cbeab42..250dcc5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore.class
index 5d45ed7..5779f4d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaCore.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaModelException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaModelException.class
index 71ad91e..27fbd44 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaModelException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/JavaModelException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions$NamingRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions$NamingRequestor.class
index 0dbf0b4..4e12783 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions$NamingRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions$NamingRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions.class
index 0138b47..0eb4030 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/NamingConventions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Signature.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Signature.class
index 165c899..6f751b2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Signature.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/Signature.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/SourceRange.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/SourceRange.class
index d4f7967..9fd791e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/SourceRange.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/SourceRange.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory$1DeprecatedDisassembler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory$1DeprecatedDisassembler.class
index 31e3c02..fb5ea1b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory$1DeprecatedDisassembler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory$1DeprecatedDisassembler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory.class
index 1e89063..b7b21e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/ToolFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/WorkingCopyOwner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/WorkingCopyOwner.class
index 8b51c5a..7e4f3a7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/WorkingCopyOwner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/WorkingCopyOwner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/BuildContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/BuildContext.class
index f11e587..06ebc12 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/BuildContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/BuildContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CategorizedProblem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CategorizedProblem.class
index 3f608e9..b01b709 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CategorizedProblem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CategorizedProblem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.class
index b497305..5f0d080 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationParticipant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationParticipant.class
index bfe064d..87cc705 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationParticipant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationParticipant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationProgress.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationProgress.class
index 51306ef..9d9cf12 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationProgress.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/CompilationProgress.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.class
index 4a99095..82bf741 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IScanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IScanner.class
index 67a67b5..90a1ee1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IScanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/IScanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ITerminalSymbols.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ITerminalSymbols.class
index 910c15b..c16e1d5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ITerminalSymbols.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ITerminalSymbols.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/InvalidInputException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/InvalidInputException.class
index 64bb017..d803a72 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/InvalidInputException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/InvalidInputException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ReconcileContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ReconcileContext.class
index 30632df..a6315a6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ReconcileContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/ReconcileContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/batch/BatchCompiler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/batch/BatchCompiler.class
index a9fd76e..721a912 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/batch/BatchCompiler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/compiler/batch/BatchCompiler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AST.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AST.class
index ae1b502..08f92c4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AST.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AST.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter$IASTConverterFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter$IASTConverterFactory.class
index ae49a38..ed21b84 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter$IASTConverterFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter$IASTConverterFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.class
index 40514cc..9113abb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTMatcher.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTMatcher.class
index f092346..f95fcb2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTMatcher.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTMatcher.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList$Cursor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList$Cursor.class
index 327c32e..8531aa8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList$Cursor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList$Cursor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList.class
index c3735dd..e91764b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode$NodeList.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode.class
index 9fe0b66..d724dd1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTNode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser$IASTFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser$IASTFactory.class
index a004523..2238319 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser$IASTFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser$IASTFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.class
index 752b384..83d57df 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.class
index f983529..eb89a0b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRequestor.class
index baa0e7d..7322c74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.class
index 1320ad7..d3463d0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTVisitor.class
index fa40dd9..8c925cb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ASTVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.class
index f8c2221..e897ea9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotatableType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotatableType.class
index ae547de..0d27d37 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotatableType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotatableType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Annotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Annotation.class
index 4f7668e..dd25cff 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Annotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Annotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationBinding.class
index 2c6fcaa..8f11e9d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.class
index 59b87a9..6fe99f8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.class
index 73ce49e..b63bf58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.class
index 9eeebcc..c52dda6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayAccess.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayAccess.class
index 478e49b..d228d5e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayAccess.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayAccess.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayCreation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayCreation.class
index b430ff6..ef800fd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayCreation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayCreation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayInitializer.class
index d859257..13e12b6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayType.class
index e35e47f..f7df976 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ArrayType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AssertStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AssertStatement.class
index c4324fe..81d1b4d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AssertStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/AssertStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment$Operator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment$Operator.class
index 473fc71..b1d762f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment$Operator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment$Operator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment.class
index 2ffd542..e25e43e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Assignment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.class
index 3f62f2d..e1e859b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingResolver.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingResolver.class
index f5e0b59..fffdbb4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingResolver.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BindingResolver.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Block.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Block.class
index 7601eea..44cf507 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Block.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Block.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BlockComment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BlockComment.class
index 9cbe277..8710da6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BlockComment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BlockComment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BodyDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BodyDeclaration.class
index b768615..ab951f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BodyDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BodyDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BooleanLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BooleanLiteral.class
index cf774d5..53755f8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BooleanLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BooleanLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BreakStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BreakStatement.class
index 8fc71c7..834b608 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BreakStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/BreakStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CastExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CastExpression.class
index 28c578a..d7eb06b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CastExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CastExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CatchClause.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CatchClause.class
index e9bb8f5..5b42734 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CatchClause.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CatchClause.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.class
index 3e3178f..e79efdd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.class
index 7222454..7e700d3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.class
index 22b9d99..5004966 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ClassInstanceCreation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ClassInstanceCreation.class
index 1d3b036..8d55904 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ClassInstanceCreation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ClassInstanceCreation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Comment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Comment.class
index 0d60710..1608444 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Comment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Comment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnit.class
index c27286b..5b326b9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1.class
index 13466cd..1580702 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1Requestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1Requestor.class
index 6e6b678..1e0e141 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1Requestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$1Requestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$2.class
index 8595b61..8f3915c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$IntArrayList.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$IntArrayList.class
index 2af8ee4..9a01c32 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$IntArrayList.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver$IntArrayList.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.class
index d830e15..17d8cbd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConditionalExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConditionalExpression.class
index 29ec273..617db8c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConditionalExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConditionalExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConstructorInvocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConstructorInvocation.class
index b9f345a..575eefa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConstructorInvocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ConstructorInvocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ContinueStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ContinueStatement.class
index 0362390..b4ceaca 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ContinueStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ContinueStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CreationReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CreationReference.class
index 8057e28..3b2aac6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CreationReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/CreationReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultASTVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultASTVisitor.class
index 6a7e6ff..604d6f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultASTVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultASTVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$1.class
index f116df6..4f7290e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$AnnotationIdentityBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$AnnotationIdentityBinding.class
new file mode 100644
index 0000000..596fe72
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$AnnotationIdentityBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$BindingTables.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$BindingTables.class
index f02d9af..cf2573d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$BindingTables.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver$BindingTables.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.class
index 8b3ab4a..bc29591 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper$CommentMapperVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper$CommentMapperVisitor.class
index f6c7a66..ea5fa34 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper$CommentMapperVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper$CommentMapperVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper.class
index 8c1cbf4..f3db7f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultCommentMapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultValuePairBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultValuePairBinding.class
index 52a1e76..880001a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultValuePairBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DefaultValuePairBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Dimension.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Dimension.class
index 5c573c9..8c58fc1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Dimension.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Dimension.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DoStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DoStatement.class
index ac54299..017bece 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DoStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DoStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DocCommentParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DocCommentParser.class
index 147a445..c6651c4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DocCommentParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/DocCommentParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EmptyStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EmptyStatement.class
index c6c3ad5..7c04826 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EmptyStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EmptyStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnhancedForStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnhancedForStatement.class
index 6f76d9e..dff3642 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnhancedForStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnhancedForStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumConstantDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumConstantDeclaration.class
index 47dc961..f7245c5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumConstantDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumConstantDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumDeclaration.class
index fdba930..37fb7c4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/EnumDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Expression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Expression.class
index 11d8640..c89b509 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Expression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Expression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionMethodReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionMethodReference.class
index adcdb32..cdaf6d6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionMethodReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionMethodReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionStatement.class
index a1109d9..c61d762 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ExpressionStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldAccess.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldAccess.class
index 90e6488..c295980 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldAccess.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldAccess.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldDeclaration.class
index f081c05..6904172 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FieldDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FileASTRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FileASTRequestor.class
index f23fadb..e0ba501 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FileASTRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/FileASTRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ForStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ForStatement.class
index 0178d10..5a01b58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ForStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ForStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IAnnotationBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IAnnotationBinding.class
index e017c8d..d5b6e58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IAnnotationBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IAnnotationBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IBinding.class
index 9dee364..583c258 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.class
index baea2b7..ffac91f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.class
index 401173e..be6f338 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMemberValuePairBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMemberValuePairBinding.class
index ce16927..8f31ae0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMemberValuePairBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMemberValuePairBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.class
index e434cac..929672a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IPackageBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IPackageBinding.class
index 398346d..d18483c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IPackageBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IPackageBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.class
index 94e8f18..709525c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IVariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IVariableBinding.class
index a80375a..de197fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IVariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IVariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IfStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IfStatement.class
index 75c854d..a65d722 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IfStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IfStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ImportDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ImportDeclaration.class
index 9a34c83..f2e88ed 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ImportDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ImportDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression$Operator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression$Operator.class
index 676e2f6..7e2db60 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression$Operator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression$Operator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression.class
index 7ee406c..29565e2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InfixExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Initializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Initializer.class
index c481431..85f61b8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Initializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Initializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InstanceofExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InstanceofExpression.class
index 5d799f4..0fe8b70 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InstanceofExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InstanceofExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite$1.class
index 38ce5c0..156949f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite.class
index 7d959c0..7dc8fc6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/InternalASTRewrite.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IntersectionType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IntersectionType.class
index 1439dd8..f26136d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IntersectionType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/IntersectionType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Javadoc.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Javadoc.class
index adf411a..e026ebe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Javadoc.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Javadoc.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LabeledStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LabeledStatement.class
index 8834859..e80eced 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LabeledStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LabeledStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LambdaExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LambdaExpression.class
index 4e406f9..408394e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LambdaExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LambdaExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LineComment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LineComment.class
index a20f0b5..0d33ee3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LineComment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/LineComment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MarkerAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MarkerAnnotation.class
index 8b14c52..5af366e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MarkerAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MarkerAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberRef.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberRef.class
index 5c9e6b4..647b746 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberRef.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberRef.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePair.class
index c644db2..dc60073 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePairBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePairBinding.class
index 7a264d0..30002df 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePairBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MemberValuePairBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Message.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Message.class
index 60560a0..78e931a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Message.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Message.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding$LambdaMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding$LambdaMethod.class
new file mode 100644
index 0000000..8dbb468
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding$LambdaMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.class
index 348183c..64be2fd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodDeclaration.class
index b400587..42c7ff0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodInvocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodInvocation.class
index b744159..1cd8143 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodInvocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodInvocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRef.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRef.class
index 63a7bee..0cacb04 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRef.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRef.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRefParameter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRefParameter.class
index cda21f9..bdc5ab1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRefParameter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodRefParameter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodReference.class
index 577d682..c01a805 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/MethodReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier$ModifierKeyword.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier$ModifierKeyword.class
index f97de72..271122e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier$ModifierKeyword.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier$ModifierKeyword.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier.class
index 65845c5..f7048ef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Modifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Name.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Name.class
index b0a14c7..f9afdc8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Name.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Name.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.class
index abfa117..f619b56 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameQualifiedType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameQualifiedType.class
index bf6b717..7312571 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameQualifiedType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NameQualifiedType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeEventHandler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeEventHandler.class
index 0be4e06..c880e73 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeEventHandler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeEventHandler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder$NodeFinderVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder$NodeFinderVisitor.class
index 16a9955..9d9a217 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder$NodeFinderVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder$NodeFinderVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder.class
index 8e85c34..cda53e4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeSearcher.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeSearcher.class
index e99ddc9..b670bfc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeSearcher.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NodeSearcher.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NormalAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NormalAnnotation.class
index 574844f..bba44a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NormalAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NormalAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NullLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NullLiteral.class
index a71306b..5fbd3e6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NullLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NullLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NumberLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NumberLiteral.class
index 3e2e5c6..ce52f74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NumberLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/NumberLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageBinding.class
index e4461cb..01de259 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageDeclaration.class
index 1b1cd6c..320b029 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PackageDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParameterizedType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParameterizedType.class
index 86c70d5..aedde32 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParameterizedType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParameterizedType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParenthesizedExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParenthesizedExpression.class
index a72de16..1cc1b3e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParenthesizedExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ParenthesizedExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression$Operator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression$Operator.class
index f2c5d73..6c1c604 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression$Operator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression$Operator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression.class
index 2b772ee..57c5803 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PostfixExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression$Operator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression$Operator.class
index 8536deb..5cdb7ed 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression$Operator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression$Operator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression.class
index c125dc0..fd313b8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrefixExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType$Code.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType$Code.class
index 43b1ff5..feb2a02 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType$Code.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType$Code.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType.class
index 3edd71d..555bb8f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/PrimitiveType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedName.class
index a8a954c..002144f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedType.class
index 36a945e..332804f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/QualifiedType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.class
index 67e5728..4691a5e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredVariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredVariableBinding.class
index c48d0a7..bc10e6b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredVariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/RecoveredVariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ReturnStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ReturnStatement.class
index 41991af..a720a63 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ReturnStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ReturnStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleName.class
index 011fc03..64d66d8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.class
index 62d28e9..b6218c6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleType.class
index d563e52..9211f99 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SimpleType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleMemberAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleMemberAnnotation.class
index 5339898..97e0dcd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleMemberAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleMemberAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleVariableDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleVariableDeclaration.class
index bcbf6b4..068d462 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleVariableDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SingleVariableDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Statement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Statement.class
index 4731258..e80ccf4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Statement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Statement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.class
index be458ee..7c79a20 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.class
index 10c25c9..cc8fd6e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperConstructorInvocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperConstructorInvocation.class
index be55e7a..b7792f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperConstructorInvocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperConstructorInvocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperFieldAccess.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperFieldAccess.class
index 939421c..2c87d60 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperFieldAccess.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperFieldAccess.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodInvocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodInvocation.class
index f0a72eb..a1c1faa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodInvocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodInvocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodReference.class
index e67eaa1..bf678b5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SuperMethodReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchCase.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchCase.class
index 1818d47..a9c7a5b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchCase.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchCase.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.class
index 5e24077..52106a0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SynchronizedStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SynchronizedStatement.class
index a397dd9..61db3e7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SynchronizedStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/SynchronizedStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TagElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TagElement.class
index 44d411e..8971850 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TagElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TagElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TextElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TextElement.class
index ceaebb2..867c8e3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TextElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TextElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThisExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThisExpression.class
index 865cb96..7c2bc49 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThisExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThisExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThrowStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThrowStatement.class
index e8657b0..f6dc3e8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThrowStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/ThrowStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TryStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TryStatement.class
index a311928..7d635a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TryStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TryStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Type.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Type.class
index 4207801..e009371 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Type.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/Type.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding$LocalTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding$LocalTypeBinding.class
new file mode 100644
index 0000000..679b9c9
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding$LocalTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.class
index 2ec253d..37a0a51 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration$ITypeDeclFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration$ITypeDeclFactory.class
index 724bd54..3b98823 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration$ITypeDeclFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration$ITypeDeclFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration.class
index d0e3703..df629b9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclarationStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclarationStatement.class
index bdcded2..aea03f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclarationStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeDeclarationStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeLiteral.class
index 6eca3fc..c88e831 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeMethodReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeMethodReference.class
index 29ddd51..dfc3204 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeMethodReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeMethodReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeParameter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeParameter.class
index 712e69e..32dfa62 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeParameter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/TypeParameter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/UnionType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/UnionType.class
index 24ef98f..25a8051 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/UnionType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/UnionType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.class
index 758fa85..8015963 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclaration.class
index 49599c6..77001a8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationExpression.class
index 7f387eb..197867e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationFragment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationFragment.class
index eda829f..302bbae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationFragment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationFragment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationStatement.class
index 8cba08c..4cb3ce3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/VariableDeclarationStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WhileStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WhileStatement.class
index 5a87f0f..868b9a7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WhileStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WhileStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WildcardType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WildcardType.class
index eb5ff99..0bc6723 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WildcardType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/WildcardType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.class
index 0634c31..c42b7c7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.class
index 78d387a..ebe7c20 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$1.class
index db35ca0..06dc9ee 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$ImportRewriteContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$ImportRewriteContext.class
index dc33381..f955a16 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$ImportRewriteContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite$ImportRewriteContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.class
index 5269619..2cfa6f6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ListRewrite.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ListRewrite.class
index df8c2bc..dc7ab16 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ListRewrite.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ListRewrite.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer$SourceRange.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer$SourceRange.class
index 32c901d..92be985 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer$SourceRange.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer$SourceRange.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.class
index 852287d..762e8f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/ICodeSnippetRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/ICodeSnippetRequestor.class
index 749ad8a..bffe91c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/ICodeSnippetRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/ICodeSnippetRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IEvaluationContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IEvaluationContext.class
index 13d66d3..05ca153 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IEvaluationContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IEvaluationContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IGlobalVariable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IGlobalVariable.class
index 44e47e0..1c1660c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IGlobalVariable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/eval/IGlobalVariable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.class
index 4a31c06..3db7f22 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication$Messages.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication$Messages.class
index 3ded96e..cebde95 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication$Messages.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication$Messages.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication.class
index 25becd5..2fe580d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatterApplication.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.class
index 5219459..9a3e46a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/IndentManipulation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/IndentManipulation.class
index 0b55c36..32a201c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/IndentManipulation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/formatter/IndentManipulation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexer.class
index 9ba2f2f..7a08a8b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication$Messages.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication$Messages.class
index a2c6f8d..a791f9f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication$Messages.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication$Messages.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication.class
index 9763bed..d6fbc4c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/index/JavaIndexerApplication.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMException.class
index 1293f20..aad0d1f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMFactory.class
index 30750c0..4fb2a59 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/DOMFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.class
index ddbf357..580ac9d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMFactory.class
index 0ee18d2..f7a4c33 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMField.class
index 989c9ff..9fab3e0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMImport.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMImport.class
index 40d6112..dd99140 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMImport.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMImport.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMInitializer.class
index 65aa851..ead4a8c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMember.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMember.class
index e5c59c8..89a8e9a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMember.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMember.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMethod.class
index e744132..eb75a2c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMNode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMNode.class
index 56967a5..ec83d32 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMNode.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMNode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMPackage.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMPackage.class
index 73e1c33..a984c9c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMPackage.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMPackage.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMType.class
index b048ff0..3f2a5a3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/jdom/IDOMType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldDeclarationMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldDeclarationMatch.class
index 6e33c01..72df574 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldDeclarationMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldDeclarationMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldReferenceMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldReferenceMatch.class
index 7c2c57e..0957589 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldReferenceMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/FieldReferenceMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchConstants.class
index c1a5e77..92414e6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchResultCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchResultCollector.class
index b4a4781..5ab25c8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchResultCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchResultCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchScope.class
index 2126f63..c5fcfb4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/IJavaSearchScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ISearchPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ISearchPattern.class
index eb31dba..3c5ddf2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ISearchPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ISearchPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ITypeNameRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ITypeNameRequestor.class
index 2f56236..36769cb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ITypeNameRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ITypeNameRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.class
index e232551..91b04c4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableDeclarationMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.class
index 5132e12..5d4a059 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodDeclarationMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodDeclarationMatch.class
index 669f247..a600642 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodDeclarationMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodDeclarationMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodReferenceMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodReferenceMatch.class
index cd7e4c6..c196132 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodReferenceMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/MethodReferenceMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageDeclarationMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageDeclarationMatch.class
index c89abd7..7b3e121 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageDeclarationMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageDeclarationMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageReferenceMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageReferenceMatch.class
index d1bfb7b..e824958 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageReferenceMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/PackageReferenceMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ReferenceMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ReferenceMatch.class
index a091459..80b717e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ReferenceMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/ReferenceMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchDocument.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchDocument.class
index 542c9ed..e7cadd5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchDocument.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchDocument.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$ResultCollectorAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$ResultCollectorAdapter.class
index b5888aa..17b8434 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$ResultCollectorAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$ResultCollectorAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$SearchPatternAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$SearchPatternAdapter.class
index 5c8982e..0c0b71e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$SearchPatternAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$SearchPatternAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$TypeNameRequestorAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$TypeNameRequestorAdapter.class
index 6b4863e..27df18d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$TypeNameRequestorAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine$TypeNameRequestorAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine.class
index 73d88ac..7b83e7c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchEngine.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchMatch.class
index 80e3a9d..3ba6faa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchParticipant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchParticipant.class
index 4094256..226c6df 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchParticipant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchParticipant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchPattern.class
index 17d6b42..74ab537 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchRequestor.class
index 205ace5..ea2dc57 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/SearchRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeDeclarationMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeDeclarationMatch.class
index 3ffb3ed..7bbb56d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeDeclarationMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeDeclarationMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatch.class
index e722ac2..4d092ca 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatchRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatchRequestor.class
index a18fd89..63feb68 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatchRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameMatchRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameRequestor.class
index 78b8133..6ac5f27 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeNameRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.class
index a132d4d..b06b5e7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterDeclarationMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.class
index e6a5232..1dd0be1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeParameterReferenceMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeReferenceMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeReferenceMatch.class
index ec121df..336adf7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeReferenceMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/search/TypeReferenceMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.class
index bb0629c..774f34a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFileBytesDisassembler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFileBytesDisassembler.class
index cb802bd..533e10f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFileBytesDisassembler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFileBytesDisassembler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFormatException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFormatException.class
index 7e149d7..5291414 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFormatException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ClassFormatException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/CompilationUnitSorter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/CompilationUnitSorter.class
index 999b834..d76d866 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/CompilationUnitSorter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/CompilationUnitSorter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil$MergeStrategy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil$MergeStrategy.class
new file mode 100644
index 0000000..04c6f07
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil$MergeStrategy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil.class
new file mode 100644
index 0000000..8bd77bd
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotation.class
index 7a778fb..42feded 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponent.class
index ff625ab..14c7e25 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponentValue.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponentValue.class
index 516d8a5..4a20d44 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponentValue.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationComponentValue.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationDefaultAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationDefaultAttribute.class
index 928ada3..9d1ad8b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationDefaultAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAnnotationDefaultAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAttributeNamesConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAttributeNamesConstants.class
index a2d5d12..009ad73 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAttributeNamesConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IAttributeNamesConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsAttribute.class
index 2ee5300..6846ed8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsEntry.class
index f754c5d..467497b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBootstrapMethodsEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBytecodeVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBytecodeVisitor.class
index 20e35cc..d498340 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBytecodeVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IBytecodeVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileAttribute.class
index 930d8c2..a7354a5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileDisassembler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileDisassembler.class
index 73a3a5f..a0fe3f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileDisassembler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileDisassembler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileReader.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileReader.class
index 2b865a6..41ca127 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileReader.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IClassFileReader.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ICodeAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ICodeAttribute.class
index 74707b2..526289e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ICodeAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ICodeAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPool.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPool.class
index b5de032..37574e4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPool.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPool.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolConstant.class
index 082afc9..29003b7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry.class
index b8fb663..f2fcfbc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry2.class
index 9baa95a..e209eb9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantPoolEntry2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantValueAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantValueAttribute.class
index c6e943d..c800acd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantValueAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IConstantValueAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IEnclosingMethodAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IEnclosingMethodAttribute.class
index aeb4de3..f26f58e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IEnclosingMethodAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IEnclosingMethodAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionAttribute.class
index 4407cee..6be0518 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionTableEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionTableEntry.class
index 59bb7fa..b345caf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionTableEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExceptionTableEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotation.class
index dc98081..5defb01 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.class
index 173e700..cf206e6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IExtendedAnnotationConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IFieldInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IFieldInfo.class
index 94ec012..5d759f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IFieldInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IFieldInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttribute.class
index ab7040d..78ae035 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttributeEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttributeEntry.class
index 41b2ac4..c336950 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttributeEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IInnerClassesAttributeEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILineNumberAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILineNumberAttribute.class
index 863d50e..b3e4b19 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILineNumberAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILineNumberAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableAttribute.class
index 86d4b21..d019978 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableReferenceInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableReferenceInfo.class
index 86568cf..19ef8f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableReferenceInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableReferenceInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTableEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTableEntry.class
index ee15737..e4a5f40 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTableEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTableEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableAttribute.class
index 6b91273..cfd555e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableEntry.class
index bb649aa..744c3c0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ILocalVariableTypeTableEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodInfo.class
index 4fb666e..22ae720 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodParametersAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodParametersAttribute.class
index 6da96ed..d7b2037 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodParametersAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IMethodParametersAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IModifierConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IModifierConstants.class
index aaf3095..8b9bf5e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IModifierConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IModifierConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IOpcodeMnemonics.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IOpcodeMnemonics.class
index 229af32..15eb9aa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IOpcodeMnemonics.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IOpcodeMnemonics.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IParameterAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IParameterAnnotation.class
index 0d29e30..f36e349 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IParameterAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IParameterAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleAnnotationsAttribute.class
index 354d446..2545ab1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleParameterAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleParameterAnnotationsAttribute.class
index f5b9e9b..603da24 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleParameterAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleParameterAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleTypeAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleTypeAnnotationsAttribute.class
index 97f81ff..6262806 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleTypeAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeInvisibleTypeAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleAnnotationsAttribute.class
index 7c2c5f0..2b4893c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleParameterAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleParameterAnnotationsAttribute.class
index 0e35da1..6f3fdf9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleParameterAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleParameterAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleTypeAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleTypeAnnotationsAttribute.class
index db7fe23..d76fea6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleTypeAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IRuntimeVisibleTypeAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISignatureAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISignatureAttribute.class
index 10c5316..0c239a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISignatureAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISignatureAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISourceAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISourceAttribute.class
index 2a9813c..3f13ab7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISourceAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/ISourceAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapAttribute.class
index 6b96fe2..610fed3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapFrame.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapFrame.class
index cac303e..1e067a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapFrame.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapFrame.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapTableAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapTableAttribute.class
index 2dfef8d..1887ffe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapTableAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IStackMapTableAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IVerificationTypeInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IVerificationTypeInfo.class
index fa35e6e..4eb5baf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IVerificationTypeInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/IVerificationTypeInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/OpcodeStringValues.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/OpcodeStringValues.class
index 9857ea0..dd68f17 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/OpcodeStringValues.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/core/util/OpcodeStringValues.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.class
index 86dc2fa..ca4b143 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionElementNotifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$1.class
index c5ae761..0448a33 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$10.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$10.class
index c20925e..4b15cf8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$10.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$10.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$2.class
index a90bb03..f27e444 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$3.class
index 4f5293c..b08f0bb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$4.class
index 319657b..5f593bc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$5.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$5.class
index 1fe7d2a..e1a7498 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$5.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$5.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$6.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$6.class
index f29cbaa..de40108 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$6.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$6.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$7.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$7.class
index 6815506..775948c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$7.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$7.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$8.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$8.class
index eae3e50..f4150ec 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$8.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$8.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$9.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$9.class
index f67a06e..4718a29 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$9.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$9.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedConstructor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedConstructor.class
index 78ce18e..279c61f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedConstructor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedConstructor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedType.class
index 101b999..8ae3e92 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$AcceptedType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$CompletionProblemFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$CompletionProblemFactory.class
index 43d9d75..fbb9f20 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$CompletionProblemFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine$CompletionProblemFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.class
index ca72065..1fb8e82 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.class
index 005b1c0..49c54cf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionRequestorWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.class
index d922ab3..deb9302 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionUnitStructureRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/IExtendedCompletionRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/IExtendedCompletionRequestor.class
index 0c66a25..53ec6cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/IExtendedCompletionRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/IExtendedCompletionRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISearchRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISearchRequestor.class
index 9552fbd..1600fa1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISearchRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISearchRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISelectionRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISelectionRequestor.class
index 337ee81..16f9d69 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISelectionRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ISelectionRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.class
index 53243d2..8f87608 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.class
index 8dfcf19..e0603bd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext$1.class
index c4bc7e9..8d1b72b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.class
index e70f9df..d28f81e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$1.class
index 30eea5d..d5496d0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$GuessedTypeRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$GuessedTypeRequestor.class
index 4312a20..2543395 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$GuessedTypeRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$GuessedTypeRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$ResolutionCleaner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$ResolutionCleaner.class
index 29af0cc..6a59616 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$ResolutionCleaner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser$ResolutionCleaner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.class
index c116266..077159c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/RelevanceConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/RelevanceConstants.class
index f4fdf8d..4bc36b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/RelevanceConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/RelevanceConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1.class
index 394aaea..8e6f6f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1Visitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1Visitor.class
index ba4d754..419b17b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1Visitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$1Visitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$2.class
index c63ebb6..208a8d9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$3.class
index 46df8ee..a61366b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$4.class
index a5fe798..b837fd4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$1.class
index 9ee9ba4..305e2ea 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$2.class
index 82ace8b..9865964 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor.class
index 8194657..40422c8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$InheritDocVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper$AcceptedType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper$AcceptedType.class
index 3b95da1..60103bf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper$AcceptedType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper$AcceptedType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper.class
index 2485f43..cc96ec3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine$SelectionTypeNameMatchRequestorWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.class
index 7e7a0d09..8526660 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.class
index 28d6e32..8e01978 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/ThrownExceptionFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder$UnresolvedReferenceNameRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder$UnresolvedReferenceNameRequestor.class
index e6b1a7a..75bfce8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder$UnresolvedReferenceNameRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder$UnresolvedReferenceNameRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.class
index 480c478..ab785ee 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/UnresolvedReferenceNameFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.class
index 8b94609..76fe1f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadoc.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.class
index a26191a..4796fe7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.class
index cdd848c..f10e466 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeFound.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeFound.class
index 4554123..67c956e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeFound.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeFound.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.class
index b1a33c8..7c187a0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationMemberValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.class
index 63940a2..5444136 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnAnnotationOfType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.class
index aaa3795..b30c441 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnArgumentName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.class
index 9789190..17280ab 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnBranchStatementLabel.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.class
index 7455a54..cac3d4e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnClassLiteralAccess.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.class
index 6e849dd..b1a2785 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnExplicitConstructorCall.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.class
index da16a05..8367608 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.class
index 4f0a586..8116479 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnFieldType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.class
index 94b8fff..66a93aa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnImportReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadoc.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadoc.class
index be6aa22..a2ba2a5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadoc.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadoc.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.class
index fd2f184..e1346c3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocAllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.class
index b68185b..d7753a0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocFieldReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.class
index 6c63c6b..de6f943 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocMessageSend.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.class
index c21acd6..69b0cbd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocParamNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.class
index efc78d8..1340c2e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.class
index 40a7b50..62b9665 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocSingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.class
index 48f1fc0..9fefa05 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.class
index 93723b8..44a0742 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTypeParamReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword.class
index acefd12..f737084 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.class
index c801d2d..59b0a4a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.class
index a00d491..c5109d2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.class
index 7dcf229..81f2d58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.class
index 66a2a52..56622d1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.class
index 241dbf4..d95b42c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMarkerAnnotationName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.class
index 74300d6..2a26346 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.class
index 4f6f2d4..7a05601 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.class
index 5d52305..04b9bd5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.class
index 7ee522e..d68e3bf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSendName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.class
index 901cf99..c4c0823 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.class
index 1369784..a8fa1e4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodReturnType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.class
index 8ef728f..0d48f70 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMethodTypeParameter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.class
index fd5cff2..0036be7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnPackageReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.class
index 7a1f3b7..5b4f736 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.class
index 924ffb9..ef86a70 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.class
index d3ae30a..044f6f0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.class
index a2da6df..2cf3809 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.class
index 6409456..e8a2d5d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnReferenceExpressionName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.class
index 5042c91..408678f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.class
index d832a8c..e7010fe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.class
index 0c3056f..f0bd91f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnStringLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.class
index 56e5906..2ee5f41 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.class
index 15d1acf..8552afc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.class
index 36f1058..abe6b62 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/InvalidCursorLocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.class
index e8c5911..d3b855e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.class
index ef29c57..fccd3de 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistCompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.class
index 53de856..369bb27 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportContainer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.class
index 822d5e1..16d5464 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistImportDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.class
index 0f2ee2b..d44ab1b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistOptions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistOptions.class
index 2876ab3..84d4146 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistOptions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistOptions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.class
index 23a1b35..550ea94 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistPackageDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.class
index e034ebe..282890a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.class
index a4d5174..05a44bc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.class
index c9be03b..733f600 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.class
index 743c50a..33ce05f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.class
index ef93e5a..fdb4f40 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistTypeParameter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Engine.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Engine.class
index f9f0741..26b37c3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Engine.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Engine.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Keywords.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Keywords.class
index 0f1165d..cbe3786 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Keywords.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/Keywords.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.class
index bdcd6b8..68139bc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.class
index 49cdf2c..b3056c0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionJavadocParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class
index ede2faa..7f52cf9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionNodeFound.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.class
index 3c78248..477657e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.class
index 5bf7ad2..7e816e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnExplicitConstructorCall.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.class
index b82007d..6ea5886 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.class
index 80d098c..95e3a56 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.class
index 31ad5a8..eef9be3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.class
index fdf0c2e..18b92b8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLambdaExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.class
index 329d6eb..55ba588 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.class
index 888ef44..66f4b3e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnMessageSend.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.class
index 9c272a3..97e72fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.class
index 07764c9..e81b0ca 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.class
index f16548b..767dcf7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.class
index dfc8b43..c6c7806 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnParameterizedSingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.class
index 191174a..cecec64 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.class
index a6bf3d2..2ab947a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.class
index cc98a7c..338f90f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedSuperReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.class
index 92b7630..60f9daa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.class
index c31d606..29cab2f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.class
index 5b5b417..e3abcdc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.class
index a7dece9..7932602 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.class
index 2b5a2a5..0911180 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.class
index a1fe6c8..68c9cb0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$1.class
index 8f44898..b6bd362 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$2.class
index 998cff5..6720927 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.class
index cc14345..0f3a1f3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.class
index 6bfeaaa..8b1a313 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionScanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ASTVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ASTVisitor.class
index ed4ae5d..1060427 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ASTVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ASTVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.class
index fb855f6..f1325a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/AbstractAnnotationProcessorManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$1.class
index e6dd917..9226fa3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$2.class
index d1e1ca8..f0bc566 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$3.class
index d25f6eb..1c49a57 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.class
index 9bde70c..549960a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFilePool.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFilePool.class
index a727e8b..94728a2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFilePool.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFilePool.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$1.class
index 0976c39..9ee700e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$ProblemsForRemovalFilter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$ProblemsForRemovalFilter.class
index d84f22e..926042c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$ProblemsForRemovalFilter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult$ProblemsForRemovalFilter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.class
index 456adb0..404c8dd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler$1.class
index 7e05bc1..aa1f8a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler$APTProblem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler$APTProblem.class
new file mode 100644
index 0000000..476dba0
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler$APTProblem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.class
index ffb44c1..9ff68a3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$1.class
index 4676110..3bb8f4f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$2.class
index 3f847de..a98260f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$3.class
index 9307785..671c54a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$4.class
index 6bdd647..d5a494f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$5.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$5.class
index 78a59fb..04320de 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$5.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies$5.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies.class
index 538f2a7..00342f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DefaultErrorHandlingPolicies.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DocumentElementParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DocumentElementParser.class
index 5677e51..dcec4ee 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DocumentElementParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/DocumentElementParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ExtraFlags.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ExtraFlags.class
index a321977..3dfba86 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ExtraFlags.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ExtraFlags.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IAttribute.class
index 4fa374f..bb5fabb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ICompilerRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ICompilerRequestor.class
index 68e0b06..7a25a40 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ICompilerRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ICompilerRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDebugRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDebugRequestor.class
index 83e94e8..2f442fd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDebugRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDebugRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class
index 22a5549..f7afeac 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IDocumentElementRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IErrorHandlingPolicy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IErrorHandlingPolicy.class
index b90678a..4946305 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IErrorHandlingPolicy.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IErrorHandlingPolicy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IProblemFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IProblemFactory.class
index 2085f9a..90f5614 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IProblemFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/IProblemFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$FieldInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$FieldInfo.class
index c92ff2a..36f0920 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$FieldInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$FieldInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$MethodInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$MethodInfo.class
index d03b140..dd234ce 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$MethodInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$MethodInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$ParameterInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$ParameterInfo.class
index 90eaf50..c82088f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$ParameterInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$ParameterInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeInfo.class
index 5a0728e..1429ba9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeParameterInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeParameterInfo.class
index 97ea62b..7be801b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeParameterInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor$TypeParameterInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.class
index dc29eb1..7d43d33 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.class
index 1455fa6..f4407ba 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ReadManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ReadManager.class
index c7ba555..cec7afc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ReadManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ReadManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier$LocalDeclarationVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier$LocalDeclarationVisitor.class
index f4e3a21..cf135e6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier$LocalDeclarationVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier$LocalDeclarationVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier.class
index f255638..a8b1982 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementNotifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser$1.class
index 45f3c7e..6fe8da1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.class
index 0be5d17..7dfd3b7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.class
index 2027458..0bf2894 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceJavadocParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceJavadocParser.class
index f45fde6..e5cdf1c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceJavadocParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/SourceJavadocParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingOutputStream.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingOutputStream.class
index a239e1d..981c9af 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingOutputStream.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingOutputStream.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingWriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingWriter.class
index 8ab13b5..abe7f53 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingWriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject$ForwardingWriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject.class
index 874af0b..3dfdd68 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl$HookedFileObject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl.class
index c95ad35..5b79672 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AjBatchFilerImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.class
index 18c3076..fef82de 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.class
index e26d892..19bd578 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.class
index ae2718d..85323f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.class
index 592b794..c49776a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseProcessingEnvImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseProcessingEnvImpl.class
index 4b76b36..8d9b868 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseProcessingEnvImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseProcessingEnvImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.class
index af9e836..a5e06a3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.class
index 31082b8..30291dd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchMessagerImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchMessagerImpl.class
index 1b24e4d..ccb9b39 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchMessagerImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchMessagerImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchProcessingEnvImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchProcessingEnvImpl.class
index 194f0da..928546a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchProcessingEnvImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchProcessingEnvImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingOutputStream.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingOutputStream.class
index 2df51e3..3c40fed 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingOutputStream.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingOutputStream.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingWriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingWriter.class
index e9c58f2..11de09b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingWriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject$ForwardingWriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject.class
index de54fbc..d2c48e0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/HookedJavaFileObject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/IProcessorProvider.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/IProcessorProvider.class
index 48c0c3a..47ece52 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/IProcessorProvider.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/IProcessorProvider.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/ProcessorInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/ProcessorInfo.class
index b100895..017003a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/ProcessorInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/ProcessorInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundDispatcher.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundDispatcher.class
index b1dc649..87d4cd2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundDispatcher.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundDispatcher.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.class
index c6aec89..8c045a2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMemberValue.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMemberValue.class
index b2045f7..32d1932 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMemberValue.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMemberValue.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.class
index 7c6991b..54643ad 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.class
index 7dd81da..ea6ec89 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ArrayTypeImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ArrayTypeImpl.class
index 1b78acd..ad72d17 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ArrayTypeImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ArrayTypeImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/DeclaredTypeImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/DeclaredTypeImpl.class
index e3f9a45..f65158d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/DeclaredTypeImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/DeclaredTypeImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementImpl.class
index e820481..e78eb8a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.class
index 54f9334..aafcd14 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeElement.class
index 66f8448..b0ec6a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeImpl.class
index dfdbdcf..f24c36c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ErrorTypeImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableElementImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableElementImpl.class
index 489130d..5f387a7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableElementImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableElementImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableTypeImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableTypeImpl.class
index b2e9d49..c5fda78 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableTypeImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ExecutableTypeImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/Factory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/Factory.class
index def54f4..1c1dfd9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/Factory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/Factory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/IElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/IElementInfo.class
index d77c006..6792854 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/IElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/IElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NameImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NameImpl.class
index 375e9a2..ec979fe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NameImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NameImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.class
index 845c017..90fd7f8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PackageElementImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PackageElementImpl.class
index ad38391..adee2d1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PackageElementImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PackageElementImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PrimitiveTypeImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PrimitiveTypeImpl.class
index 67f518e..5e0aa09 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PrimitiveTypeImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/PrimitiveTypeImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl$SourceLocationComparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl$SourceLocationComparator.class
index d0d02af..5b32f2d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl$SourceLocationComparator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl$SourceLocationComparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl.class
index 3405fe3..e33d710 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeElementImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeMirrorImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeMirrorImpl.class
index 28f02e7..f52feac 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeMirrorImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeMirrorImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeParameterElementImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeParameterElementImpl.class
index 6a3fa4e..84bbd50 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeParameterElementImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeParameterElementImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeVariableImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeVariableImpl.class
index c91cca1..ec4611e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeVariableImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypeVariableImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.class
index 9d24cdf..189cea1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/VariableElementImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/VariableElementImpl.class
index bdfc7a7..73d376c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/VariableElementImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/VariableElementImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/WildcardTypeImpl.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/WildcardTypeImpl.class
index b0e5f7f..ae9763c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/WildcardTypeImpl.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/WildcardTypeImpl.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.class
index 87fb837..7fc865d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.class
index 56aad32..87fe307 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.class
index e78273b..9c929a7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileObject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileObject.class
index 7896cf5..4580e48 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileObject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileObject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ManyToMany.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ManyToMany.class
index d3dab1f..9191d25 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ManyToMany.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ManyToMany.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.class
index da1092b..4c88f19 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingError.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingError.class
index a552101..e6f6d19 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingError.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingError.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingErrorCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingErrorCollector.class
index 85a0b61..a1567e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingErrorCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util$EncodingErrorCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.class
index b7016ff..58539da 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.class
index ae6a51d..726bff8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.class
index acb9eef..598f7e9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.class
index 8029162..d7e0641 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.class
index 4d48f7f..a095514 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression$ResolutionState.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression$ResolutionState.class
deleted file mode 100644
index 150ee01..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression$ResolutionState.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.class
index 939f087..968ddb3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1LocationCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1LocationCollector.class
index 7bc7ae5..0d0a541 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1LocationCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1LocationCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1MissingTargetBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1MissingTargetBuilder.class
index 2a1bd1f..16f2bbd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1MissingTargetBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation$1MissingTargetBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.class
index ccaccf0..c683dfc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.class
index 42f6370..e562dab 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.class
index ed0e215..35707e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.class
index 9180c1b..7975b2f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.class
index d2bd920..7c71e93 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.class
index 0cf0664..a53c445 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.class
index 5fcfeb7..598b27f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.class
index 0ecdb14..cd99746 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AssertStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AssertStatement.class
index 6026523..7feea4e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AssertStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AssertStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.class
index d6db392..6e4a91a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.class
index 54218d6..3eab738 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.class
index 1a98f30..15bd19a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BranchStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BranchStatement.class
index 00a3776..a962252 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BranchStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BranchStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.class
index fa988c1..61e3407 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CaseStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CaseStatement.class
index 62b4e92..ef0cf6f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CaseStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CaseStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression$1.class
index 8679c89..9e41cf6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.class
index 99e83c7..6915962 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CharLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CharLiteral.class
index defe0e0..403e4f7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CharLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CharLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.class
index 708702e..9bdedd9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Clinit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Clinit.class
index 937baff..20c5e35 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Clinit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Clinit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.class
index 770ca63..9b47407 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration$1.class
index c75688f..e726e32 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.class
index 704d5c8..edca7e7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.class
index d3f62ce..8884e9e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.class
index 608572e..2655530 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.class
index d2ea93e..344486f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.class
index 17fa869..12e5e74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContainerAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.class
index a60d053..446a8cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.class
index 63879e7..24449e4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.class
index 67043c2..a0ac1e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.class
index a26a974..d4a7c9e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EqualExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EqualExpression.class
index 823ec98..b1fc176 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EqualExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/EqualExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.class
index d0278c4..0df4d87 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.class
index 5dfd83d..327f510 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$1.class
index b2c35ab..f082f68 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$2.class
index 00cf04c..c3aa66b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$3.class
index f055d55..4e9f649 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$4.class
index 383e7be..1f84c43 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.class
index 13297e9..a789f51 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExpressionContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.class
index fb7ffd1..694a441 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable$IteratorForReporting$Stage.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable$IteratorForReporting$Stage.class
new file mode 100644
index 0000000..93da8c4
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable$IteratorForReporting$Stage.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable$IteratorForReporting.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable$IteratorForReporting.class
new file mode 100644
index 0000000..26df44d
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable$IteratorForReporting.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.class
index 6305c2d..12fb7a0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.class
index 69ae05c..a056361 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.class
index b7db8e0..2b3a1a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.class
index 262d5e8..5472a3b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.class
index a1e4e85..d13e544 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.class
index e9a8722..81952b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.class
index 23e2ddb..cc5eb27 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$1BridgeCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$1BridgeCollector.class
index bb17a00..8469b94 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$1BridgeCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$1BridgeCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$VisibilityInspector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$VisibilityInspector.class
index 4dbdb6a..d309fd0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$VisibilityInspector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression$VisibilityInspector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.class
index eb4207b..8a05d19 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.class
new file mode 100644
index 0000000..902aa19
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.class
index a70feb9..f48cfdd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ImportReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ImportReference.class
index b7a5b05..ac018ee 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ImportReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ImportReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.class
index 66bac12..d260bbf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InnerInferenceHelper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InnerInferenceHelper.class
deleted file mode 100644
index af6f086..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InnerInferenceHelper.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.class
index eb412dd..34eef4f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteral.class
index eac0523..4ed9e93 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.class
index 2845997..0e379f3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.class
index 3397b96..e9762e2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.class
index f6c50c5..e755c3a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.class
index 1fc2d94..45fd480 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.class
index 38d94f9..f82cd31 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.class
index 07591b2..f31e070 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArrayQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArrayQualifiedTypeReference.class
index a5f2c71..460aad9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArrayQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArrayQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArraySingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArraySingleTypeReference.class
index e8de9a6..7f01597 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArraySingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocArraySingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.class
index 207c162..6035413 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.class
index c84e1ae..0978883 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.class
index d417d66..6ed30bf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.class
index ad99736..18b591e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.class
index e5ef107..cc6ae47 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.class
index 527f6c2..6a8d972 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.class
index 22032a6..e276c1c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.class
index a296d0c..07252e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1LambdaTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1LambdaTypeBinding.class
index b051760..04f199e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1LambdaTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1LambdaTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1ShapeComputer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1ShapeComputer.class
index 840be61..303a118 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1ShapeComputer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$1ShapeComputer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$CopyFailureException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$CopyFailureException.class
new file mode 100644
index 0000000..e7ff290
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression$CopyFailureException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.class
index d6a37ab..cbc56d9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Literal.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Literal.class
index 0973f0c..06c2e1b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Literal.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Literal.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.class
index 65a1722..fc6c0ac 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteral.class
index 4fcfbe8..e653728 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.class
index 10d989d..415ef74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MagicLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MagicLiteral.class
index 7d86e15..57165bb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MagicLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MagicLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.class
index 180f54f..4f8c0eb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$1.class
index 88bb988..f430c41 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$2.class
index 5deb1a6..92f0b92 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.class
index 959a056..098e3d1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.class
index 04f8724..ea55423 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.class
index 79e7a9f..306cc75 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NameReference.class
index d696d71..8125a42 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.class
index d618bb3..521b9d6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$1SearchContradictions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$1SearchContradictions.class
deleted file mode 100644
index dfcfcb3..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$1SearchContradictions.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$CheckMode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$CheckMode.class
index 068d0a6..b098db3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$CheckMode.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$CheckMode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$SearchContradictions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$SearchContradictions.class
new file mode 100644
index 0000000..4a575703
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching$SearchContradictions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.class
index c654c8a..53296ae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullLiteral.class
index b74dda9..834596f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NumberLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NumberLiteral.class
index 590e59b..55fe219 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NumberLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NumberLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.class
index c19cdf2..c3531b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OR_OR_Expression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression$1Decode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression$1Decode.class
index ad1553f..9a4b8dd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression$1Decode.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression$1Decode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.class
index 2771c86..55183fa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorIds.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorIds.class
index 1e8a6a2..37afdb1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorIds.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/OperatorIds.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.class
index fbfcedf..d52f86e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.class
index 19ebbe4..77d6fa7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.class
index 87a161f..606956e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.class
index 35e1024..a3406eb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.class
index 7f5cd91..1c91504 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.class
index cff23b8..5a9868e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.class
index 3f12463..a78b334 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.class
index cf294dc..e7a61e2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.class
index d3581be..6343c12 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Receiver.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Receiver.class
index 27e57c0..4fc31f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Receiver.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Receiver.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.class
index 0e139de..8bc4f1f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression$1.class
new file mode 100644
index 0000000..10bd78c
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression$2.class
new file mode 100644
index 0000000..4a91d3a
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.class
index 333e314..6c7bbdd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.class
index dc86778..a37907a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.class
index 484e221..f365b59 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.class
index e57b9fb..2f92fc6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.class
index db44af8..48d721b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement$1.class
new file mode 100644
index 0000000..761dcc5
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement$2.class
new file mode 100644
index 0000000..f1d8625
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.class
index 83001ad..8017553 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.class
index cf9c9e7..7077e36 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.class
index d296f64..0795189 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SubRoutineStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SubRoutineStatement.class
index 84526e0..bbbd709 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SubRoutineStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SubRoutineStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SuperReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SuperReference.class
index 4c30486..11159bd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SuperReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SuperReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement$1StringSwitchCase.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement$1StringSwitchCase.class
index 4b089ee..3a0dcd5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement$1StringSwitchCase.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement$1StringSwitchCase.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.class
index 075f002..2f33ddf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.class
index 451b63c..7f8b62a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThisReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThisReference.class
index 593568f..7e08419 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThisReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThisReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.class
index 0c6638b..ddf2b74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.class
index 69726d5..64cf03f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.class
index 295b721..0138232 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.class
index 2aa0f5b..95cd15f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeParameter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeParameter.class
index ddab4af..251ed16 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeParameter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeParameter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference$AnnotationCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference$AnnotationCollector.class
index 31f8d0a..a06a619 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference$AnnotationCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference$AnnotationCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference$AnnotationPosition.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference$AnnotationPosition.class
new file mode 100644
index 0000000..b45bef4
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference$AnnotationPosition.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.class
index f3df641..0b18609 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.class
index 463e9b3..9f14b0a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.class
index 79303b9..55795b0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.class
index cbadf39..b4207fd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.class
index 966803a..8396fdd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/BatchCompilerRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/BatchCompilerRequestor.class
new file mode 100644
index 0000000..11f2809
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/BatchCompilerRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory$1.class
index e838f44..bda007a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.class
index 8529eea..0eddd76 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.class
index 348a65c..e657716 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.class
index 59cfd38..8fc818a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.class
index b82b899..82f6737 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.class
index a599f12..3f99046 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileFinder.class
index e613bba..59cdb39 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$Classpath.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$Classpath.class
index 51d541b..d594d39 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$Classpath.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$Classpath.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathNormalizer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathNormalizer.class
index dcc36ea..a7c5e61 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathNormalizer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathNormalizer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathSectionProblemReporter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathSectionProblemReporter.class
index 020f181..bbec825 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathSectionProblemReporter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem$ClasspathSectionProblemReporter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.class
index ac89f45..67d4b23 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$1.class
index c4f790c..465f0bd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$2.class
index 9c017a7..1046ec4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$3.class
index 084307d..308d3ad 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$4.class
deleted file mode 100644
index 570a5b2..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$4.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger$1.class
index a61daab..822e514 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger.class
index 03444b5..cda3ef6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$Logger.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$ResourceBundleFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$ResourceBundleFactory.class
index 4c8ef15..b320f13 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$ResourceBundleFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main$ResourceBundleFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.class
index b4563d8..66661bc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 61a6306..1c362ea 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2013 IBM Corporation and others.
+# Copyright (c) 2000, 2015 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
# bug 365208 - [compiler][batch] command line options for annotation based null analysis
# bug 374605 - Unreasonable warning for enum-based switch statements
# bug 388281 - [compiler][null] inheritance of null annotations as an option
+# bug 440687 - [compiler][batch][null] improve command line option for external annotations
+# Bug 408815 - [batch][null] Add CLI option for COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS
# Alan Moraes <alan@kelon.org> - Contribution for bug 383644
# Jesper S Moller - Contribution for bug 407297 - [1.8][compiler] Control generation of parameter names by option
###############################################################################
@@ -24,8 +26,8 @@
#Format: compiler.name = word1 word2 word3
compiler.name = Eclipse Compiler for Java(TM)
#Format: compiler.version = (The place holders will be automatically filled. Do not remove or alter it)
-compiler.version = BETA_JAVA8_LUNA_8661797, 3.9.2
-compiler.copyright = Copyright IBM Corp 2000, 2013. All rights reserved.
+compiler.version = MARS_1007a0215, 3.10.0
+compiler.copyright = Copyright IBM Corp 2000, 2015. All rights reserved.
### progress
progress.compiling = Compiling
@@ -111,6 +113,7 @@
### null annotations
configure.invalidNullAnnot = Token {0} is not in the expected format "nullAnnot(<non null annotation name> | <nullable annotation name> | <non-null by default annotation name>)"
+configure.missingAnnotationPath = Missing argument to -annotationpath at ''{0}''
### requestor
requestor.error = {0}. ERROR in {1}
@@ -259,9 +262,15 @@
\ -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n\
\ -enableJavadoc consider references in javadoc\n\
\ -parameters generate method parameters attribute (for target >= 1.8)\n\
+\ -genericsignature generate generic signature for lambda expressions\n\
\ -Xemacs used to enable emacs-style output in the console.\n\
\ It does not affect the xml log output\n\
\ -missingNullDefault report missing default nullness annotation\n\
+\ -annotationpath <directories and ZIP archives separated by {0}>\n\
+\ specify locations where to find external annotations\n\
+\ to support annotation-based null analysis.\n\
+\ The special name CLASSPATH will cause lookup of\n\
+\ external annotations from the classpath and sourcepath.\n\
\ \n\
\ -? -help print this help message\n\
\ -v -version print compiler version\n\
@@ -376,6 +385,7 @@
\ errors and warnings\n\
\ switchDefault + switch statement lacking a default case\n\
\ syncOverride missing synchronized in synchr. method override\n\
+\ syntacticAnalysis perform syntax-based null analysis for fields\n\
\ syntheticAccess synthetic access for innerclass\n\
\ tasks(<tags separated by |>) tasks identified by tags inside comments\n\
\ typeHiding + type parameter hiding another type\n\
@@ -386,9 +396,11 @@
\ unqualifiedField unqualified reference to field\n\
\ unused macro for unusedAllocation, unusedArgument,\n\
\ unusedImport, unusedLabel, unusedLocal,\n\
-\ unusedPrivate, unusedThrown, and unusedTypeArgs\n\
+\ unusedPrivate, unusedThrown, and unusedTypeArgs,\n\
+\ unusedExceptionParam\n\
\ unusedAllocation allocating an object that is not used\n\
\ unusedArgument unread method parameter\n\
+\ unusedExceptionParam unread exception parameter\n\
\ unusedImport + unused import declaration\n\
\ unusedLabel + unused label\n\
\ unusedLocal + unread local variable\n\
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.class
index 6f53f49..a14512b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.class
index bad930f..0f22fd0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfoWithAnnotations.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfoWithAnnotations.class
index 6a3d917..af34c66 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfoWithAnnotations.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/AnnotationMethodInfoWithAnnotations.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.class
index a50c553..22a905c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader$ZipFileProducer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader$ZipFileProducer.class
new file mode 100644
index 0000000..f21a2c3
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader$ZipFileProducer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.class
index 69b3c68..db0c28f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.class
index 44e0cfa..31724c0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileStruct.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFormatException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFormatException.class
index 73f2e43..aba6f7a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFormatException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFormatException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ElementValuePairInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ElementValuePairInfo.class
index bed2766..2dde316 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ElementValuePairInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ElementValuePairInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$1.class
new file mode 100644
index 0000000..3edf5d3
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$2.class
new file mode 100644
index 0000000..0686130
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$BasicAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$BasicAnnotationWalker.class
new file mode 100644
index 0000000..b440d27
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$BasicAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$DispatchingAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$DispatchingAnnotationWalker.class
new file mode 100644
index 0000000..aa7a4e0
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$DispatchingAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$FieldAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$FieldAnnotationWalker.class
new file mode 100644
index 0000000..104ecae
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$FieldAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$IMethodAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$IMethodAnnotationWalker.class
new file mode 100644
index 0000000..8689589
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$IMethodAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$MethodAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$MethodAnnotationWalker.class
new file mode 100644
index 0000000..fa1df2e
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$MethodAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$SingleMarkerAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$SingleMarkerAnnotation.class
new file mode 100644
index 0000000..aa12684
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$SingleMarkerAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$SuperTypesAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$SuperTypesAnnotationWalker.class
new file mode 100644
index 0000000..813f0e8
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$SuperTypesAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$TypeParametersAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$TypeParametersAnnotationWalker.class
new file mode 100644
index 0000000..eeafa91
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider$TypeParametersAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.class
new file mode 100644
index 0000000..39d80e3
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.class
index be5f9c9..c1c9ab2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.class
index 72718cb..a5c4de2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.class
index 329844a..e0365ec 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.class
index 3a8d091..54797d2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/InnerClassInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.class
index b2b40d5..9ec5ced 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.class
index 29b3fa8..324a90c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithAnnotations.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithParameterAnnotations.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithParameterAnnotations.class
index ea3214a..0f92e7d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithParameterAnnotations.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithParameterAnnotations.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithTypeAnnotations.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithTypeAnnotations.class
index e67e3e8..26c78f3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithTypeAnnotations.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/MethodInfoWithTypeAnnotations.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker$1.class
index 4e92a08..1ab124b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.class
index e0a8903..65b82a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.class
index bfdd7fe..81ecfcd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker$1.class
deleted file mode 100644
index 637381a..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker$1.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.class
index 01c4796..810c599 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.class
index bca6542..76701f0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.class
index 05cdd80..6a5f69d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.class
index b2f75d6..b8050a8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.class
index c46c732..aa8faa2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CachedIndexEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CachedIndexEntry.class
index c9a9868..1350698 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CachedIndexEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CachedIndexEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CaseLabel.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CaseLabel.class
index d4c40ff..6049f7d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CaseLabel.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CaseLabel.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.class
index 47853b1..a6d83a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CharArrayCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.class
index 6f10eb4..b30dd40 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.class
index 80d5ffa..26f5e0e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.class
index c618ffc..d1fbc93 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ExceptionLabel.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ExceptionLabel.class
index facdc47..0f14e40 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ExceptionLabel.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ExceptionLabel.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/FloatCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/FloatCache.class
index 04b7662..7dd19f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/FloatCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/FloatCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.class
index aae59bc..1e86618 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/IntegerCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Label.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Label.class
index e2593f3..34faeb8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Label.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Label.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/LongCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/LongCache.class
index 7a858d6..f14abed 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/LongCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/LongCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.class
index 311e08d..d8f0d89 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/MultiCatchExceptionLabel.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.class
index 6989bf9..2b77e61 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ObjectCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Opcodes.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Opcodes.class
index 5463bc6..b62730d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Opcodes.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/Opcodes.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.class
index 823ae9c..32e113d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$ExceptionMarker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$ExceptionMarker.class
index a804cba..f5933f8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$ExceptionMarker.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$ExceptionMarker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$FramePosition.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$FramePosition.class
index 0aae962..43b5635 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$FramePosition.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$FramePosition.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackDepthMarker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackDepthMarker.class
index d898d12..ee07f02 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackDepthMarker.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackDepthMarker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackMarker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackMarker.class
index d333026..ac4b5f0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackMarker.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream$StackMarker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.class
index c9bf6c9..b80c803 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.class
index f680f86..96cbb61 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.class
index bd6a321..aa3323d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRestriction.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRestriction.class
index ed058e5..efa250e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRestriction.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRestriction.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRule.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRule.class
index 25db359..76722dc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRule.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRule.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.class
index 16348cc..962840e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/AccessRuleSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ClassSignature.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ClassSignature.class
index ebe1de8..6f231cf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ClassSignature.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ClassSignature.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/EnumConstantSignature.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/EnumConstantSignature.class
index 964a0f0..97ba9dc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/EnumConstantSignature.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/EnumConstantSignature.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.class
index f0aebc0..eadd002 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryElementValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryElementValuePair.class
index 4a15176..af5190f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryElementValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryElementValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryField.class
index 8292786..4f17d22 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryMethod.class
index 561395c..ef313d4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryNestedType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryNestedType.class
index d6d41d7..ca5d761 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryNestedType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryNestedType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.class
index 03ed05d..89fd3ba 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.class
index 6b5da70..398f654 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryTypeAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.class
index 5da40dc..513f34f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ICompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IDependent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IDependent.class
index a8f7be7..4185a7b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IDependent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IDependent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericField.class
index 347760f..94c8b5d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericMethod.class
index 88394e4..daf0ca2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericType.class
index bcc0257..3ecd5ff 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/IGenericType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/INameEnvironment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/INameEnvironment.class
index 4ae9c75..5ef5ad0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/INameEnvironment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/INameEnvironment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceField.class
index 6210854..0f9cecc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceImport.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceImport.class
index 7984eb7..e8b2912 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceImport.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceImport.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceMethod.class
index 2e522ab..24aa70f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceType.class
index ac7af58..4312450 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ISourceType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker$1.class
new file mode 100644
index 0000000..9e95fcc
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.class
new file mode 100644
index 0000000..7269c2f
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.class
index 2217d87..9c8c98c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/env/NameEnvironmentAnswer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.class
index db29bbf..fb76855 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.class
index 13e1c64..afb5846 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionInferenceFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionInferenceFlowContext.class
new file mode 100644
index 0000000..a523f3b
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionInferenceFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.class
index fb37ed0..cd2288e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.class
index 6db9301..e08edfe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.class
index 3594e9d..f0aeaa6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.class
index dee06dd..e29a852 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InsideSubRoutineFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InsideSubRoutineFlowContext.class
index 43a9269..08da158 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InsideSubRoutineFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InsideSubRoutineFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.class
index b2767f8..ba85463 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LabelFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext$EscapingExceptionCatchSite.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext$EscapingExceptionCatchSite.class
index b1e90d3..5abdce6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext$EscapingExceptionCatchSite.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext$EscapingExceptionCatchSite.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.class
index 00c77eb..dc5bb42 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.class
index 27d6f02..ba1949f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/SwitchFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.class
index cb80b39..dcaf9e3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/TryFlowContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo$AssertionFailedException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo$AssertionFailedException.class
index c1ee325..75e91ad 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo$AssertionFailedException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo$AssertionFailedException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.class
index ec3e82c..f3a029e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.class
index 2e5c9ed..7d470ca 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/BooleanConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ByteConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ByteConstant.class
index 3e94fea..679df3f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ByteConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ByteConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CharConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CharConstant.class
index 2e9c2a5..619c32e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CharConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CharConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.class
index 544e6cd..eff2bb4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerStats.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerStats.class
index 910b3ff..ebcd91c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerStats.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerStats.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/Constant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/Constant.class
index c7c25e0..02fdaba 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/Constant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/Constant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.class
index a949620..1a674fe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/DoubleConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/FloatConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/FloatConstant.class
index a89c339..70e1d0a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/FloatConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/FloatConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.class
index 10293d3..da6da1d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ITypeRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IntConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IntConstant.class
index bd601ff..a0b4da2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IntConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IntConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.class
index 5800bd0..bd1f4df 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/LongConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/LongConstant.class
index 3522f00..f23114e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/LongConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/LongConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.class
index efcaf89..8510322 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ReferenceContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ShortConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ShortConstant.class
index 13b8b42..7c1edeb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ShortConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/ShortConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/StringConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/StringConstant.class
index ec288a5..778e7fe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/StringConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/impl/StringConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.class
index 6ffaed0..e66e3f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.class
index 5bc4a57..0a088d7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$AnnotationMethodHolder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$AnnotationMethodHolder.class
index 06f4d81..b8796ea 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$AnnotationMethodHolder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$AnnotationMethodHolder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$MethodHolder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$MethodHolder.class
index 2e80bff..5c1a78d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$MethodHolder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder$MethodHolder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.class
index 828cf59..92e5035 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotationHolder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptBinaryLocalVariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptBinaryLocalVariableBinding.class
index c150a22..511ea66 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptBinaryLocalVariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptBinaryLocalVariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptSourceLocalVariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptSourceLocalVariableBinding.class
index aceea76..64e8043 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptSourceLocalVariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AptSourceLocalVariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.class
index 59c4600..c2640c6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.class
index 6cba986..a09a5e9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.class
index 96b16b8..51fa785 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.class
index 161e834..059762e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.class
index 996548f..15526b3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$1.class
index 38dd885..e9ae53e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$ThreeSets.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$ThreeSets.class
index 8865f90..8406b58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$ThreeSets.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet$ThreeSets.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.class
index 18098d6..7df4898 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.class
index 91ca74c..2f84ec1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18$1.class
index 6ef0681..edc02b7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.class
index eb49834..ffaf4d6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.class
index cf32ab9..6b99c85 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CatchParameterBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.class
index 3300ec0..f643de0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.class
index ad7c0b6..29007f5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.class
index 1322e5b..bc108c0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula$1.class
deleted file mode 100644
index fa28f83..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula$1.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.class
index 1372909..0ddb904 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.class
index 491ec1f..50f1497 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.class
index 63f2a95..23a436b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair$UnresolvedEnumConstant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair$UnresolvedEnumConstant.class
index c6c89c6..b502fe4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair$UnresolvedEnumConstant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair$UnresolvedEnumConstant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.class
index 5ce356c..8e08ebe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ElementValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.class
index 74ad2c8..07180f7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.class
index d2f2ebc..f3d092b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IMemberFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IMemberFinder.class
index 5e27f73..21940f6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IMemberFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IMemberFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.class
index cbb1a21..dcef0eb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IPrivilegedHandler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IQualifiedTypeResolutionListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IQualifiedTypeResolutionListener.class
index 7a77d8a..09d73b4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IQualifiedTypeResolutionListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IQualifiedTypeResolutionListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ITypeFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ITypeFinder.class
index 125cf25..e93b868 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ITypeFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ITypeFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier$InheritedNonNullnessInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier$InheritedNonNullnessInfo.class
index 87b1df6..68c809a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier$InheritedNonNullnessInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier$InheritedNonNullnessInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.class
index 5a9d043..22fe251 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.class
index acedc0d..89dce64 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportConflictBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportConflictBinding.class
index ed3747c..ea300b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportConflictBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImportConflictBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.class
index 3da5a79..119aeb6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$1.class
index 5b9808d..38e9ab1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$2.class
index 03b4fba..8ed9c89 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$3.class
index 3fe9751..5d4d93d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$Solution.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$Solution.class
deleted file mode 100644
index b4fe857..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$Solution.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$SuspendedInferenceRecord.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$SuspendedInferenceRecord.class
index ce03237..e61b212 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$SuspendedInferenceRecord.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18$SuspendedInferenceRecord.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.class
index 4081469..3620eef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.class
index 02411aa..326618f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceFailureException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.class
index 8bf3685..c06e4c8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.class
index 9f0e95c..1a282b8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InnerEmulationDependency.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InnerEmulationDependency.class
index 552df74..3f48510 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InnerEmulationDependency.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InnerEmulationDependency.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.class
deleted file mode 100644
index 9ad24cb..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.class
new file mode 100644
index 0000000..e5c3295
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite$EmptyWithAstNode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite$EmptyWithAstNode.class
index 432f041..0f214bb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite$EmptyWithAstNode.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite$EmptyWithAstNode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.class
index ace548e..85bf93f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.class
index dc52eb0..a23317f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.class
index de79833..8a4190b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.class
index 98b7659..e83e24d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.class
index 6c89cf7..0e58d2d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.class
index 2cc3a3b..fc6cbd2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.class
index ad8b576..5833fc9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.class
index e086741..4ed371a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.class
index 263764a..f79b185 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.class
index f2c720b..cf6a23c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MissingTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MostSpecificExceptionMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MostSpecificExceptionMethodBinding.class
index 9c7f866..176d6d4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MostSpecificExceptionMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MostSpecificExceptionMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.class
index 778cb68..d294922 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.class
index e6e3c9d..d15a0af 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.class
index bedbb07..075256f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedFieldBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedFieldBinding.class
index f27e206..df8b838 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedFieldBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedFieldBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding$LingeringTypeVariableEliminator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding$LingeringTypeVariableEliminator.class
index 5dfe0e2..504f3e0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding$LingeringTypeVariableEliminator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding$LingeringTypeVariableEliminator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.class
index 6e47880..65f88ac 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$1.class
index b827abd..b9d87c4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$2.class
index 0ccd905..16fc8fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.class
index d8c2dc3..dc5b9cf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding$1MentionListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding$1MentionListener.class
deleted file mode 100644
index 995043a..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding$1MentionListener.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.class
index 5ec9203..e70a152 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.class
new file mode 100644
index 0000000..30ef951
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.class
index 1306e20..1a6d99e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.class
index 5ef10bf..9de72ba 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolymorphicMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemBinding.class
index 0d809c2..4fd1684 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemFieldBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemFieldBinding.class
index 5ebe7a9..099ee00 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemFieldBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemFieldBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.class
index 9a607fe..a6a5866 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemPackageBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemPackageBinding.class
index ec93217..1327371 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemPackageBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemPackageBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.class
index 3768f34..f568d50 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.class
index 1f00309..5515bb3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReferenceBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.class
index 21e9e06..0415cb2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$1.class
index 2ac3d25..f2e10e6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$2.class
index b7a6aa1..a3cf8ef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.class
index f9fbb76..e322f0a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$1.class
index 65b8460..54ab1e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$2.class
index c396523..baa7fe0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$3.class
index d1c725f..8223c73 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.class
index b557aeb..a9bbe0d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$1.class
index 1ced30e..8ec6af4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$2.class
index be067d2..eba5c7e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$MethodClashException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$MethodClashException.class
index 6d23be0..4e39748 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$MethodClashException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$MethodClashException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$Substitutor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$Substitutor.class
index b8731bd..35a273b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$Substitutor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope$Substitutor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.class
index 3978208..b44db76 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.class
index dccbdf6..8d6039e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.class
index b43476d..1acc98f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.class
index 8ebe959..e3f4bbf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Substitution.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Substitution.class
index de5851b..cdd2235 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Substitution.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Substitution.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticArgumentBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticArgumentBinding.class
index a1150f9..3dafcf9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticArgumentBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticArgumentBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.class
index a63bf31..af05fa7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.class
index fcb62bf..c2ac1d6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFieldBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.class
index c6dcad1..82fccd3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.class
index 36e7900..d527628 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding$1.class
index 729ef61..22f2e5e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.class
index 70c65d6..7908678 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.class
index 78b62ac..0a70b3f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.class
index c0a5d96..c2c363c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants$CloseMethodRecord.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants$CloseMethodRecord.class
index ba528de..6ce853d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants$CloseMethodRecord.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants$CloseMethodRecord.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.class
index 841b00e..dba2d12 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.class
index dcc57b5..b5efc0e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem$HashedParameterizedTypes$InternalParameterizedTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem$HashedParameterizedTypes$InternalParameterizedTypeBinding.class
new file mode 100644
index 0000000..9589378
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem$HashedParameterizedTypes$InternalParameterizedTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem$HashedParameterizedTypes.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem$HashedParameterizedTypes.class
new file mode 100644
index 0000000..5ff4211
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem$HashedParameterizedTypes.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.class
index 141a960..25d902d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.class
index 603aab9..c20b5d7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.class
index 386f1a3..b014642 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedAnnotationBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.class
index e38eb3f..f06f0e0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.class
index c3d95f0..aa10947 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.class
index 0858cab..31e0ebe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.class
index 68ad76f..8ad62f6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.class
index c0f1cb9..fcc3697 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/CommitRollbackParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/CommitRollbackParser.class
deleted file mode 100644
index 0210a6e..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/CommitRollbackParser.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.class
index 83cc009..2e102d1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocParser.class
index 1f856fc..831261b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.class
index 2445c52..55d6d3d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/NLSTag.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/NLSTag.class
index 42f5d73..7ee58eb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/NLSTag.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/NLSTag.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser$IDeclarationFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser$IDeclarationFactory.class
index 6ff9d8d..2f09160 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser$IDeclarationFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser$IDeclarationFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.class
index da2a50d..deeaabe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.class
index 290efc8..090c55e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.class
index 45ef9b9..2d36fef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.class
index 09463eb..48fee2f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.class
index 3a086e7..6daabd8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.class
index b55b51e..116f893 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.class
index 35d1f2f..d867edc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredImport.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.class
index 436194f..91929b3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.class
index 89b0a5a..defb755 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.class
index 7add1d0..22a5d1b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.class
index 3cb8add..cdf152e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.class
index 326a539..2d210cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.class
index 9ef6c24..319eaa7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.class
index 313ec4e..beaf71c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScannerData.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScannerData.class
index 7234846..f8caec2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScannerData.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScannerData.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Scanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Scanner.class
index 8b78d46..58249e2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Scanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Scanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.class
index 52e1697..239207f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter$AnonymousMemberFound.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter$AnonymousMemberFound.class
index 6ed12ce..d6298fd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter$AnonymousMemberFound.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter$AnonymousMemberFound.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.class
index 65a02b5..7568c74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.class
index fe7f113..a9fab81 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1.class
index ca989c8..117cdd3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1MethodVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1MethodVisitor.class
index 609626e..95f7aa8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1MethodVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1MethodVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1TypeVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1TypeVisitor.class
index 16b02ce..3b4aca9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1TypeVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$1TypeVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$LocalTypeKind.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$LocalTypeKind.class
index f41fd51..d429060 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$LocalTypeKind.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass$LocalTypeKind.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.class
index 38dac75..1cf22a6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$Goal.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$Goal.class
index 6fbd106..273ec67 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$Goal.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$Goal.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardParser.class
index fb5a1e4..799b3ef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardScanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardScanner.class
index 5f2fe90..2775838 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardScanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass$VanguardScanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.class
index 0ca2c39..6a1a25c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TypeConverter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TypeConverter.class
index 15f35fa..96cb780 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TypeConverter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TypeConverter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$PrimaryRepairInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$PrimaryRepairInfo.class
index 070ea35..1090a1b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$PrimaryRepairInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$PrimaryRepairInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$RepairCandidate.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$RepairCandidate.class
index e532ac3..7896577 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$RepairCandidate.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$RepairCandidate.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$SecondaryRepairInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$SecondaryRepairInfo.class
index 31904f9..e7c0331 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$SecondaryRepairInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$SecondaryRepairInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$StateInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$StateInfo.class
index 2edfeb8..e1ddfc1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$StateInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser$StateInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.class
index bdbae97..1fa55b2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream$Token.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream$Token.class
index eed5c6e..890c24a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream$Token.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream$Token.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.class
index 619e144..2dd6fa3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/LexStream.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil$RangeResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil$RangeResult.class
index a67ccf0..acc5ffc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil$RangeResult.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil$RangeResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.class
index 58598df..68e9d9e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/RangeUtil.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
index 35ff8d05..fc2f483 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
index 31091df..72150db 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
index 9586c4a..e65e729 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
index a2405da..c71fcca 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
index c93b080..c826c26 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
index c287cad..2e822a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
index cc8990c..54dd5b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
index 687bd27..26cb4cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
index b0fdf76..4c106ba 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
index 297858e..2460c79 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
index 8caf5a7..d57c580 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
index d34b764..fbfdb5c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
index dab1c01..9fbbacf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
index c74948a..447a60f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
index 7e6c951..4c5f7e1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
index 565a167..83c1da0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
index 9c7914f..c394f36 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.class
index 003e481..8f96f1e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilationUnit.class
index 44d9c8d..0b59daf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortCompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortMethod.class
index 466d5a9..73d8c46 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortType.class
index ea4962e..167019c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/AbortType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.class
index a885b5c..4a89bbd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.class
index e6a1ef6..6e6230c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/DefaultProblemFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.class
index 3ca6e1a..4b5a730 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.class
index 403600f..2b6b5a5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.class
index 963a150..6da4600 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemSeverities.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ShouldNotImplement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ShouldNotImplement.class
index dae3108..d38313a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ShouldNotImplement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ShouldNotImplement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties
index 11c0127..e592117 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -41,6 +41,7 @@
# Bug 434600 - Incorrect null analysis error reporting on type parameters
# Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
# Bug 438467 - [compiler][null] Better error position for "The method _ cannot implement the corresponding method _ due to incompatible nullness constraints"
+# Bug 458361 - [1.8][null] reconciler throws NPE in ProblemReporter.illegalReturnRedefinition()
# Jesper S Moller <jesper@selskabet.org> - Contributions for
# bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
# bug 384567 - [1.5][compiler] Compiler accepts illegal modifiers on package declaration
@@ -571,6 +572,7 @@
579 = Unused type arguments for the non generic method {0}({1}) of type {2}; it should not be parameterized with arguments <{3}>
583 = Duplicate methods named {0} with the parameters ({1}) and ({2}) are inherited from the types {3} and {4}
584 = Name clash: The method {0}({1}) of type {2} has the same erasure as {0}({3}) of type {4} but does not hide it
+586 = Type arguments are not allowed here
### FOREACH
580 = Type mismatch: cannot convert from element type {0} to {1}
@@ -817,8 +819,8 @@
956 = Null type safety (type annotations): The expression of type ''{1}'' needs unchecked conversion to conform to ''{0}'', corresponding supertype is ''{2}''
957 = Null type mismatch at parameter {0}: required ''{1}'' but provided ''{2}'' via method descriptor {3}
958 = Null type safety: parameter {0} provided via method descriptor {3} needs unchecked conversion to conform to ''{1}''
-959 = Null type mismatch at method return type: Method descriptor {0} promises ''@{1} {2}'' but referenced method provides ''{3}{4}''
-960 = Null type safety at method return type: Method descriptor {0} promises ''@{1} {2}'' but referenced method provides ''{3}{4}''
+959 = Null type mismatch at method return type: Method descriptor {0} promises ''{1}'' but referenced method provides ''{2}''
+960 = Null type safety at method return type: Method descriptor {0} promises ''{1}'' but referenced method provides ''{2}''
961 = Redundant null check: comparing ''{0}'' against null
962 = The nullness annotation ''{0}'' is not applicable at this location
963 = Nullness annotations are not applicable at this location
@@ -831,6 +833,8 @@
970 = Null type mismatch (type annotations): required ''{0}'' but this expression has type ''{1}'', where ''{0}'' is a free type variable
971 = The explicit type bound 'Object' is not affected by the nullness default for DefaultLocation.TYPE_BOUND.
972 = Illegal redefinition of parameter {0}, inherited method from {1} declares this parameter as ''{2}'' (mismatching null constraints)
+973 = Contradictory null annotations: function type was inferred as ''{2} ({4})'', but only one of ''@{0}'' and ''@{1}'' can be effective at any location
+974 = The return type is incompatible with the free type variable ''{1}'' returned from {0} (mismatching null constraints)
# Java 8
1001 = Syntax error, modifiers and annotations are not allowed for the lambda parameter {0} as its type is elided
@@ -850,7 +854,6 @@
1058 = Default methods are allowed only in interfaces.
1100 = Problem detected during type inference: {0}
-1101 = (Recovered) Internal inconsistency detected during lambda shape analysis
### ELABORATIONS
## Access restrictions
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/CompoundNameVector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/CompoundNameVector.class
index 6fa2628..12f5bd4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/CompoundNameVector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/CompoundNameVector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/FloatUtil.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/FloatUtil.class
index a9fdd7b..8de6860 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/FloatUtil.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/FloatUtil.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter$1.class
index ec1384f..0fd0db4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.class
index 5f181ed..5a4fdd7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashSetOfInt.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashSetOfInt.class
index 13a1aec..c7a7a70 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashSetOfInt.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashSetOfInt.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.class
index 83cddef..68c074f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfInt.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfIntValues.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfIntValues.class
index e7699fb..49b86b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfIntValues.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfIntValues.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfLong.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfLong.class
index 30b9cca..41ab12d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfLong.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfLong.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.class
index 6da0622..697c39a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToInt.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToInt.class
index 58f0fe7..f799ac2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToInt.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToInt.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.class
index c07f13f..a0b2c28 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.class
index 0475c40..592d0a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfPackage.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfType.class
index 42f8517..14e2804 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/HashtableOfType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.class
index e06fcf7..a615315 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages$MessagesProperties.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages$MessagesProperties.class
index 5b671eb..3206897 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages$MessagesProperties.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages$MessagesProperties.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages.class
index 9748092..cb012ac 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Messages.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ObjectVector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ObjectVector.class
index e94326b..6d77518 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ObjectVector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/ObjectVector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleLookupTable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleLookupTable.class
index e05231e..89d4298 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleLookupTable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleLookupTable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.class
index 1c18d48..1f0b7d3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleNameVector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSet.class
index bb3e86d..b7be217 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSetOfCharArray.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSetOfCharArray.class
index 2e54602..14ea489 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSetOfCharArray.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SimpleSetOfCharArray.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting$1.class
index 5970bba..00ca433 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting.class
index c455083..6b88593 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Sorting.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SuffixConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SuffixConstants.class
index f992828..9b666f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SuffixConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/SuffixConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$1.class
index c1fb55c..0af66eb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$Displayable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$Displayable.class
index 159c13a..438b9a6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$Displayable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util$Displayable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.class
index 7f08c98..de65e6b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ASTHolderCUInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ASTHolderCUInfo.class
index d90e271..5fe2c57 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ASTHolderCUInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ASTHolderCUInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotatableInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotatableInfo.class
index f1acdb7..b288b11 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotatableInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotatableInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Annotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Annotation.class
index 7ec3358..e34b571 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Annotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Annotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotationInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotationInfo.class
index ae941e6..3685425 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotationInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/AnnotationInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BasicCompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BasicCompilationUnit.class
index b354a73..f3015b0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BasicCompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BasicCompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchInitializationMonitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchInitializationMonitor.class
index 11a7723..fa19f70 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchInitializationMonitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchInitializationMonitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchOperation.class
index 1282381..b1e7922 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BatchOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.class
index 5f7f76a..1fdf032 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryField.class
index db3905d..8d886cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaExpression.class
index aa29635..b0bacde 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaMethod.class
index 94e4ef1..4363335 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryLambdaMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMember.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMember.class
index 902daec..ec4b910 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMember.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMember.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1.class
index a71d6ba..504f2f5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1ParametersNameCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1ParametersNameCollector.class
index a6eb067..daa9922 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1ParametersNameCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod$1ParametersNameCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod.class
index 7e5f449..84d0d55 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryType.class
index c2e0332..d2a7bdf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryTypeConverter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryTypeConverter.class
index 903d3c3..df04ec4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryTypeConverter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BinaryTypeConverter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer$1.class
index 6dcd456..9154aeb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer.class
index c288b1a..4d1cb78 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Buffer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferCache.class
index b78696c..b9cce54 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferFactoryWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferFactoryWrapper.class
index 43c84b4..d658d15 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferFactoryWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferFactoryWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager$1.class
index d7d9c33..7781eda 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager.class
index 5358f7e..d8ce169 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/BufferManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableNameEnvironment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableNameEnvironment.class
index e950b17..44df95d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableNameEnvironment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableNameEnvironment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableProblemFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableProblemFactory.class
index 9ddcc36..96caeb6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableProblemFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CancelableProblemFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ChangeClasspathOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ChangeClasspathOperation.class
index 0aa63eb..2fa88c9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ChangeClasspathOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ChangeClasspathOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile$1.class
index 06601a5..3287e3d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile$2.class
new file mode 100644
index 0000000..4c6df63
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.class
index 5f79f4a..b019693 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$1.class
index c3cdfb9..34d9725 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$2.class
index 9742d84..57d87af 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo.class
index fc3bab7..479ec6c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.class
index 6e83689..63fbd94 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAccessRule.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAccessRule.class
index 21d98e8..6435dbb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAccessRule.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAccessRule.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAttribute.class
index eba9edb..e0aa811 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.class
index 64d9904..b437af8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$1.class
index 0db7e14..3330404 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$AssertionFailedException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$AssertionFailedException.class
index 0d9fa11..22180a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$AssertionFailedException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$AssertionFailedException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$UnknownXmlElements.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$UnknownXmlElements.class
index 07d7c5c..52b305c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$UnknownXmlElements.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry$UnknownXmlElements.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.class
index 3eea2fd..d4d5592 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathValidation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathValidation.class
index e7ead20..a699e00 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathValidation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ClasspathValidation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.class
index 5fa2e05..52cf4b7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$1.class
index 17b3239..2cbb699 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$2.class
index 8a8504d..2edfc7b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$3.class
index 5ee1fa9..6a192bf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.class
index 5e264cb..a987f8e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.class
index 5647da2..f343c97 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder$1.class
index 6229a25..ed2d2b9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.class
index 7bdfcfb..fc1dffb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitProblemFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor$1.class
index 60fea6c..912ebbd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.class
index bf0ce85..47f2d94 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyElementsOperation.class
index a3b7b55..22b227e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation$1.class
index 4e56faf..bb36b2b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation.class
index 0e33496..1fab63e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyPackageFragmentRootOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.class
index a8ab029..1723442 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.class
index 1078d97..f3bff78 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateElementInCUOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateElementInCUOperation.class
index d62e998..ee26f50 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateElementInCUOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateElementInCUOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateFieldOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateFieldOperation.class
index e1bdf6c..2498d6d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateFieldOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateFieldOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateImportOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateImportOperation.class
index ceeed33..94e8759 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateImportOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateImportOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateInitializerOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateInitializerOperation.class
index 3b4a65e..5de53b6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateInitializerOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateInitializerOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateMethodOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateMethodOperation.class
index c11dc28..96993d4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateMethodOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateMethodOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.class
index 7425118..2c05193 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.class
index 8ded0af..fffb0b5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeHierarchyOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeHierarchyOperation.class
index 330395a..a58058f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeHierarchyOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeHierarchyOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.class
index a70496e..13fe62c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeOperation.class
index f4a941a..9ab1b61 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/CreateTypeOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.class
index f209b7c..729c50b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DefaultWorkingCopyOwner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteElementsOperation.class
index c8bde4e..515d2bd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation$1.class
index 569a20e..a050ea6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation.class
index 982584d..d3ddd24 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeletePackageFragmentRootOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.class
index 745f062..85500b6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState$1.class
index 5d9f3ce..a18e18e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState.class
index e402f37..ace8055 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessingState.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1.class
index 9ed284a..64b1044 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1FoundRelevantDeltaException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1FoundRelevantDeltaException.class
index 1a4a37f..f605c21 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1FoundRelevantDeltaException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$1FoundRelevantDeltaException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$2.class
index d9550e5..2925126 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$3.class
index 1863606..876674c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$4.class
index f4de218..b992460 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$5.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$5.class
deleted file mode 100644
index d4a8549..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$5.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$OutputsInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$OutputsInfo.class
index f2f7f37..02a30bd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$OutputsInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$OutputsInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$RootInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$RootInfo.class
index d30e548..e27342d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$RootInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor$RootInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.class
index de8993a..f227d73 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.class
index e59bd4d..d50a9c8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DocumentAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DocumentAdapter.class
index a2f3d54..a78c727 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DocumentAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/DocumentAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ElementCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ElementCache.class
index c71f35e..f6e0782 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ElementCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ElementCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker$DirectoryNode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker$DirectoryNode.class
new file mode 100644
index 0000000..d2ba721
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker$DirectoryNode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.class
new file mode 100644
index 0000000..fbd1489
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFolderChange.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFolderChange.class
index 7bd2940..0d79f6a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFolderChange.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFolderChange.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager$RefreshJob.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager$RefreshJob.class
index f4d2674..00126e8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager$RefreshJob.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager$RefreshJob.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager.class
index 77283a5..51aa8a8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalFoldersManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalJavaProject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalJavaProject.class
index 9975ef7..dcf8b5d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalJavaProject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalJavaProject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.class
index 3bb136a..cd68a7c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IJavaElementRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IJavaElementRequestor.class
index 7d29455..d6aa8e7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IJavaElementRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IJavaElementRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.class
index dea41c2..cab29fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INameEnvironmentWithProgress.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INamingRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INamingRequestor.class
index ca92a71..eb2d61b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INamingRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/INamingRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IPathRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IPathRequestor.class
index 3a29fdb..23a4c0d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IPathRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/IPathRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainer.class
index 6332ea2..d870b8f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainerInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainerInfo.class
index 92792e2..791c2a5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainerInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportContainerInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclaration.class
index 8f958e9..56ad005 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclarationElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclarationElementInfo.class
index 0d906e8..4e2d110 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclarationElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ImportDeclarationElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Initializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Initializer.class
index 518fa21..690d8a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Initializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Initializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerElementInfo.class
index 61d04af..135154f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.class
index cd7b1b5..10cfeed 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InitializerWithChildrenInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InternalNamingConventions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InternalNamingConventions.class
index 0b867c2..1df474c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InternalNamingConventions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/InternalNamingConventions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryDirectory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryDirectory.class
index 0a40e3d..6b744d1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryDirectory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryDirectory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryFile.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryFile.class
index b60658d..f097f06 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryFile.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryFile.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryResource.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryResource.class
index 625abf7..15dea6f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryResource.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarEntryResource.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragment.class
index bcc0ad3..69a4bd0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentInfo.class
index 2cf4ee1..5c3b77a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.class
index 26035d5..93b3e88 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.class
index 77e6f96..101622a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRootInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.class
index 2812f75..a960039 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceModifyListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceModifyListener.class
index ba8b8e5..ca40fa5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceModifyListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceModifyListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement$1NoResourceSchedulingRule.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement$1NoResourceSchedulingRule.class
index b09bf7f..be6c9ae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement$1NoResourceSchedulingRule.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement$1NoResourceSchedulingRule.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.class
index a5cf1d3..4cfd772 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta$Key.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta$Key.class
new file mode 100644
index 0000000..0aff97d
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta$Key.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.class
index 6ad6533..7dc2edf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder$ListItem.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder$ListItem.class
index c95c8d2..1868046 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder$ListItem.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder$ListItem.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.class
index 48a2ee4..72dce1e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementInfo.class
index b493c7f..1cb65b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementRequestor.class
index 1740c5a..ac6fb01 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaElementRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModel.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModel.class
index 0eec096..2a4c5c9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModel.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModel.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.class
index f724aa5..39130e2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelInfo.class
index 3ab4d3c..ec4b22c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$1.class
index b49e76a..3b8d8cd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$10.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$10.class
index bf7960d..55d1799 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$10.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$10.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$11.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$11.class
index baa513c..90b77d6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$11.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$11.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$12.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$12.class
index 7c4e549..fe3bb2e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$12.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$12.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$13.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$13.class
index 622a2b1..08d9d29 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$13.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$13.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$14.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$14.class
index 923b678..4d158f5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$14.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$14.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$15.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$15.class
index c5b6066..2d99796 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$15.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$15.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$16.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$16.class
index cc54d94..5d2216f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$16.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$16.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$17.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$17.class
index 2b68b44..ab18714 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$17.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$17.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$18.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$18.class
new file mode 100644
index 0000000..6ac08e2
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$18.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$17$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$19$1.class
similarity index 69%
rename from org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$17$1.class
rename to org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$19$1.class
index 43ce7e7..0913c58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$17$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$19$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$19.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$19.class
new file mode 100644
index 0000000..05e758e
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$19.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$2.class
index 55fea23..7e00d94 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$3.class
index a65e33a..d7eba1a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$4.class
index 1c0c29c..fac4e7b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$5.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$5.class
index 9adeffd..b71a3e8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$5.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$5.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$6.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$6.class
index 91941ec..6854291 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$6.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$6.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$7.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$7.class
index 2df536a..65120ce 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$7.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$7.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$8.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$8.class
index 824ea4b..a3d1fc9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$8.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$8.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$9.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$9.class
index a257563..6fd4c71 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$9.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$9.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$1.class
index 3796017..4ff1bc7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$2.class
index 093dda4..b00c2c0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants.class
index 6bf8f7f..4e73257 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$CompilationParticipants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$EclipsePreferencesListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$EclipsePreferencesListener.class
index 7fad277..f5c8aab 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$EclipsePreferencesListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$EclipsePreferencesListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerProjectInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerProjectInfo.class
index bb10dde..e9fa04d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerProjectInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerProjectInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerWorkingCopyInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerWorkingCopyInfo.class
index 180d488..28c12cd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerWorkingCopyInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PerWorkingCopyInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PersistedClasspathContainer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PersistedClasspathContainer.class
index c59d05a..c7ec9e5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PersistedClasspathContainer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$PersistedClasspathContainer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersLoadHelper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersLoadHelper.class
index e4d8b4e..4afb6b6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersLoadHelper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersLoadHelper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersSaveHelper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersSaveHelper.class
index f2b0082..16bb6f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersSaveHelper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$VariablesAndContainersSaveHelper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$ZipCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$ZipCache.class
index 29b15b3..9d19747 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$ZipCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager$ZipCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.class
index 59d485d..55e7f6c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation$IPostAction.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation$IPostAction.class
index 11f06ca..915ae29 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation$IPostAction.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation$IPostAction.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation.class
index 7fb3097..f9c8b01 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelStatus.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelStatus.class
index f5be3b2..01d9998 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelStatus.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaModelStatus.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$1.class
index 381d666..fc6449b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$2.class
index 0a5f8c4..6b8e6e4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$3.class
index c58c5c5..10a94ee 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ClasspathResolutionBreakpointListener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ClasspathResolutionBreakpointListener.class
index 4f01748..35fdd81 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ClasspathResolutionBreakpointListener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ClasspathResolutionBreakpointListener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ResolvedClasspath.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ResolvedClasspath.class
index cb8cc54..37c27eb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ResolvedClasspath.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject$ResolvedClasspath.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.class
index ddd1bd1..ebeef52 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo$ProjectCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo$ProjectCache.class
index 80c0d2b..474572a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo$ProjectCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo$ProjectCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo.class
index bbce245..b4601b9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavaProjectElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.class
index d8b855a..3e1cf59 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.class
index e503c7e..4677166 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator$LRUEnumeratorElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator$LRUEnumeratorElement.class
index 7901dc2..2d3e885 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator$LRUEnumeratorElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator$LRUEnumeratorElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator.class
index f35e773..8be68b3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LRUCacheEnumerator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression$1.class
new file mode 100644
index 0000000..bdfffeb
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.class
index 2a0465d..d8e8ac2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaFactory.class
index 60f9b18..378fd6f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaMethod.class
index aaf1886..5fecece 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LambdaMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable$1LocalVarAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable$1LocalVarAnnotation.class
index d24f53a..1c4e6ed 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable$1LocalVarAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable$1LocalVarAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.class
index 51cd202..a0ef5fa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Member.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Member.class
index 2fe50b9..2fd2570 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Member.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Member.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberElementInfo.class
index 8005d02..2280ad3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberValuePair.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberValuePair.class
index 909cbf6..f8b28f2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberValuePair.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MemberValuePair.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ModelUpdater.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ModelUpdater.class
index 598bd0c..415ea18 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ModelUpdater.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ModelUpdater.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveElementsOperation.class
index 44e6b82..8ce7f06 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation$1.class
index 75dddf5..82d65b0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation.class
index aea7869..b48c718 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MovePackageFragmentRootOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.class
index 1414450..6093d3a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MultiOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MultiOperation.class
index 7df6312..aa2e88f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MultiOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/MultiOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup$Answer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup$Answer.class
index 136ed6a..6cd7bc7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup$Answer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup$Answer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.class
index 042b92d..1a9645e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember$1TypeResolveRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember$1TypeResolveRequestor.class
index 470e709..953721a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember$1TypeResolveRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember$1TypeResolveRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember.class
index e77b860..d220192 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NamedMember.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NonJavaResource.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NonJavaResource.class
index 7cd17e8..ed8c28b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NonJavaResource.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NonJavaResource.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NullBuffer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NullBuffer.class
index bba0ef8..e0be00d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NullBuffer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/NullBuffer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Openable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Openable.class
index d53508d..6f088c1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Openable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Openable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.class
index 9005d96..05e0add 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache$1Temp.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache$1Temp.class
index 0547edf..e6e2003 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache$1Temp.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache$1Temp.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache.class
index 358d13d..86ff22f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/OverflowingLRUCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageDeclaration.class
index 6f585ee..def0d75 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragment.class
index b546393..8bca2ef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentInfo.class
index 77a632c..1e70e3e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRoot.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRoot.class
index a01e55e..7847ec1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRoot.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRoot.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.class
index 16c6ffc..b6cd946 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange$1.class
index 0161f06..1ebd2c5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange.class
index 5bb185e..b381a9c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ProjectReferenceChange.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation$1.class
index ab3985d..583d63c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.class
index 1c57e75..7451412 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ReconcileWorkingCopyOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Region.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Region.class
index 5eeb33c..65f3eb9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Region.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/Region.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameElementsOperation.class
index 9727990..1c416a6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.class
index cb322ef..34f2c10 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.class
index a49fda3..9af1d8f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.class
index dc02af3..3dcfb07 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.class
index f669bb0..c969c2b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.class
index dc6a667..9bddbe4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceField.class
index a8d3a46..64072f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceMethod.class
index e71cc6e..2a2d2b8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceType.class
index d60c790..5a9f792 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/ResolvedSourceType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$1.class
index 65f117a..9a08804 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$2.class
index 42cd141..42d4927 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$3.class
index 625064c..ea492f2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$4.class
index 2b968a8..970c9dc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$5.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$5.class
index b5a59a6..641693f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$5.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$5.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$6.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$6.class
index ff7f38b..e05d250 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$6.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment$6.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment.class
index 59fe87b..6768e2b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironmentRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironmentRequestor.class
index a280614..18439cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironmentRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SearchableEnvironmentRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.class
index 08883c5..0d48a3f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetClasspathOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetClasspathOperation.class
index 1500b67..e167d48 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetClasspathOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetClasspathOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$1.class
index 8045a6e..dbe5f79 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$2.class
index 42ab8e7..a6b69a4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation.class
index 8a1ae55..b450e09 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetContainerOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetVariablesOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetVariablesOperation.class
index 7a149d3..f5e4692 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetVariablesOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SetVariablesOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SimpleDelta.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SimpleDelta.class
index 01b4d4b..0f61db3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SimpleDelta.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SimpleDelta.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SingleTypeRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SingleTypeRequestor.class
index 7b542e4..32119d8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SingleTypeRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SingleTypeRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$1.class
index 3bc74a7..7b989fa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$2.class
index 1efc66d..a801ddb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.class
index cbe8f1c..363bcc4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.class
index b84dfe4..0982ec0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceAnnotationMethodInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorInfo.class
index 2acdbd9..8fdf997 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.class
index 95654e7..3981d10 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceConstructorWithChildrenInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceField.class
index 7db66ee..46e92b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldElementInfo.class
index ebb85e6..4168a0b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.class
index 539b10b..126dd83 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceFieldWithChildrenInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$1.class
index 5da75f2..1bb8cc7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$LocalVariableElementKey.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$LocalVariableElementKey.class
index 433b8d8..67ff8d6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$LocalVariableElementKey.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper$LocalVariableElementKey.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper.class
index c3b3073..b7ef7fb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethod.class
index 94b4985..660f0e4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodElementInfo.class
index facaa44..25a0062 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodInfo.class
index 5b1f9e0..ad9d46d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.class
index da16eb3..fb4aa00 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceMethodWithChildrenInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElement.class
index 0d21057..1bbe58d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElementInfo.class
index ae2e817..9f3315b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceRefElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceType.class
index fae0588..2ee4d0b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceTypeElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceTypeElementInfo.class
index 601647c..5f7ddd3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceTypeElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/SourceTypeElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.class
index 952872e..a5e18fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameterElementInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameterElementInfo.class
index aa069f0..c836f9b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameterElementInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeParameterElementInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.class
index 1f51d05..9dc0bbe 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibrary.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibrary.class
index efb00b8..1feb4a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibrary.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibrary.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainer.class
index f8bba7c..18e2060 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainerInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainerInitializer.class
index 1f00c7f..7aacd80 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainerInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryClasspathContainerInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryManager.class
index 7f3aa46..790b4d8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/UserLibraryManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/VerboseElementCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/VerboseElementCache.class
index 4392d16..f592833 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/VerboseElementCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/VerboseElementCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/XMLWriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/XMLWriter.class
index 717d646..56af464 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/XMLWriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/XMLWriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbortIncrementalBuildException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbortIncrementalBuildException.class
index 743dc77..88f284d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbortIncrementalBuildException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbortIncrementalBuildException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder$1.class
index 12f6505..0e514d5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.class
index 5a9a9e6..8325a65 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AbstractImageBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AdditionalTypeCollection.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AdditionalTypeCollection.class
index 378551d..293d62d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AdditionalTypeCollection.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/AdditionalTypeCollection.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$1.class
index 8eb2a86..e4c9780 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$2.class
index 96686f7..894f074 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$3.class
index 4025402..2987e7b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.class
index 6f3a3d3..35ee1f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BuildNotifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BuildNotifier.class
index f13a423..1b5b8d3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BuildNotifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/BuildNotifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.class
index 796753d..afec93f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathDirectory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar$PackageCacheEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar$PackageCacheEntry.class
index 91a72d7..f694b72 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar$PackageCacheEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar$PackageCacheEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.class
index fb119c1..af9064f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.class
index 28bc389..bcdc43f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.class
index 71efe8a..6f04445 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathMultiDirectory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/CompilationParticipantResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/CompilationParticipantResult.class
index 925eff9..291dffb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/CompilationParticipantResult.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/CompilationParticipantResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ICompilationUnitLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ICompilationUnitLocator.class
index c1d87e0..df65f2a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ICompilationUnitLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ICompilationUnitLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ImageBuilderInternalException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ImageBuilderInternalException.class
index 73e7b40..1bc2b60 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ImageBuilderInternalException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ImageBuilderInternalException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.class
index d19b998..ffa4af7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/JavaBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/JavaBuilder.class
index 4343c94..4360105 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/JavaBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/JavaBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/MissingSourceFileException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/MissingSourceFileException.class
index 4611f37..b000ef7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/MissingSourceFileException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/MissingSourceFileException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.class
index d6de242..1bd16ae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameSet.class
index a4df4e5..94ed7bd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/NameSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ProblemFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ProblemFactory.class
index bd3d79c..f1b4e07 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ProblemFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ProblemFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/QualifiedNameSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/QualifiedNameSet.class
index 4080fdc..8ad9daa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/QualifiedNameSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/QualifiedNameSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ReferenceCollection.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ReferenceCollection.class
index dbbed32..77afb36 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ReferenceCollection.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/ReferenceCollection.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/SourceFile.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/SourceFile.class
index b19f19d..0a72b67 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/SourceFile.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/SourceFile.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/State.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/State.class
index c661968..2da52b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/State.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/State.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/StringSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/StringSet.class
index 68a4c7c..53d0c75 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/StringSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/StringSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/WorkQueue.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/WorkQueue.class
index 96da014..ce79adb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/WorkQueue.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/builder/WorkQueue.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.class
index 96477e5..5087fd3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.class
index b903b4b..ca3791c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$IASTRewriteAnalyzerFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$IASTRewriteAnalyzerFactory.class
index fcb2742..cca3af6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$IASTRewriteAnalyzerFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$IASTRewriteAnalyzerFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ListRewriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ListRewriter.class
index 8472132..d81738c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ListRewriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ListRewriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ModifierRewriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ModifierRewriter.class
index cafee62..29862d1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ModifierRewriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ModifierRewriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ParagraphListRewriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ParagraphListRewriter.class
index 4ad854d..e0e9e61 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ParagraphListRewriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$ParagraphListRewriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$SwitchListRewriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$SwitchListRewriter.class
index 3fedf45..a44d097 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$SwitchListRewriter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer$SwitchListRewriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.class
index f212909..c903c52 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.class
index 1fce489..13a74c7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$1.class
index fd1143a..6ff3b90 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockContext.class
index 6e81135..3485ea3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefix.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefix.class
index 4c18d28..ad488be 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefix.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefix.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefixSuffix.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefixSuffix.class
index 559a57f..b002e20 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefixSuffix.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$BlockFormattingPrefixSuffix.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ConstPrefix.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ConstPrefix.class
index 68ecb93..46919d9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ConstPrefix.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ConstPrefix.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ExtendedFlattener.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ExtendedFlattener.class
index 3fed9b1..206e804 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ExtendedFlattener.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$ExtendedFlattener.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$FormattingPrefix.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$FormattingPrefix.class
index f4c84e8..6b922d6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$FormattingPrefix.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$FormattingPrefix.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$NodeMarker.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$NodeMarker.class
index 078ec82..61ca5c1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$NodeMarker.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$NodeMarker.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$Prefix.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$Prefix.class
index 6795476..6d87c03 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$Prefix.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter$Prefix.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.class
index 6187a93..9989ff4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$1.class
deleted file mode 100644
index 65250d5..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$1.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$2.class
deleted file mode 100644
index 39fcf12..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$2.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$3.class
deleted file mode 100644
index 4d2d1a5..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$3.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$ImportDeclEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$ImportDeclEntry.class
deleted file mode 100644
index be47ee7..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$ImportDeclEntry.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$PackageEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$PackageEntry.class
deleted file mode 100644
index 1e1f23c..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$PackageEntry.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$PackageMatcher.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$PackageMatcher.class
deleted file mode 100644
index 3d60fe5..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer$PackageMatcher.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.class
deleted file mode 100644
index afb474b..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineCommentEndOffsets.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineCommentEndOffsets.class
index bc219da..f229a9f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineCommentEndOffsets.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineCommentEndOffsets.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$1.class
index 4cad9e7..cb559c4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$2.class
index fef9e12..c281344 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation.class
index 6066149..379a25f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/LineInformation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ListRewriteEvent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ListRewriteEvent.class
index a8b9519..37754cb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ListRewriteEvent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ListRewriteEvent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$CopyPlaceholderData.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$CopyPlaceholderData.class
index 1ea22c3..3a4889c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$CopyPlaceholderData.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$CopyPlaceholderData.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$PlaceholderData.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$PlaceholderData.class
index ba7fef7..46c2ec5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$PlaceholderData.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$PlaceholderData.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$StringPlaceholderData.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$StringPlaceholderData.class
index 80f1679..55b68cd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$StringPlaceholderData.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore$StringPlaceholderData.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore.class
index ddfe421..0974893 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeInfoStore.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeRewriteEvent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeRewriteEvent.class
index b31b470..18f93a3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeRewriteEvent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/NodeRewriteEvent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEvent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEvent.class
index 522b3fd..cf96215 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEvent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEvent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$CopySourceInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$CopySourceInfo.class
index b6ee394..ec96c6b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$CopySourceInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$CopySourceInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$EventHolder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$EventHolder.class
index afa86e3..0759308 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$EventHolder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$EventHolder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$INodePropertyMapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$INodePropertyMapper.class
index c4ee805..a867385 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$INodePropertyMapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$INodePropertyMapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$NodeRangeInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$NodeRangeInfo.class
index 240bc0f..87c6552 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$NodeRangeInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$NodeRangeInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$ParentIterator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$ParentIterator.class
index 4c16e0c..bbebb27 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$ParentIterator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$ParentIterator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$PropertyLocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$PropertyLocation.class
index 2b9086e..c59a07c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$PropertyLocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore$PropertyLocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.class
index 91a42a2..82fb01d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/SourceModifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/SourceModifier.class
index 2592d96..ed7ad92 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/SourceModifier.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/SourceModifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TokenScanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TokenScanner.class
index 7057b11..126897d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TokenScanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TokenScanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TrackedNodePosition.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TrackedNodePosition.class
index 6aece61..1e18bd0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TrackedNodePosition.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/TrackedNodePosition.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier$Conflicts.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier$Conflicts.class
new file mode 100644
index 0000000..384ac91
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier$Conflicts.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier.class
new file mode 100644
index 0000000..3ff0a66
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictingSimpleNameFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictingSimpleNameFinder.class
new file mode 100644
index 0000000..4dc3ed4
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictingSimpleNameFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportAdder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportAdder.class
new file mode 100644
index 0000000..d307f48
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportAdder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComment.class
new file mode 100644
index 0000000..5ec0903
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator$1.class
new file mode 100644
index 0000000..80e2849
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator.class
new file mode 100644
index 0000000..a42b46b
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportDeclarationWriter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportDeclarationWriter.class
new file mode 100644
index 0000000..553ff6f
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportDeclarationWriter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$1.class
new file mode 100644
index 0000000..9e30475
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$ImportEdits.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$ImportEdits.class
new file mode 100644
index 0000000..05d9720
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$ImportEdits.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$OriginalImportsCursor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$OriginalImportsCursor.class
new file mode 100644
index 0000000..f506fd8
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor$OriginalImportsCursor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor.class
new file mode 100644
index 0000000..3ac111f
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEntry.class
new file mode 100644
index 0000000..985709d
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator$ImportGroup.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator$ImportGroup.class
new file mode 100644
index 0000000..4deb9e0
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator$ImportGroup.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator$IndexedImportGroups.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator$IndexedImportGroups.class
new file mode 100644
index 0000000..033abff
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator$IndexedImportGroups.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.class
new file mode 100644
index 0000000..42bd3fe
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportName.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportName.class
new file mode 100644
index 0000000..ece085b
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportName.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer$RewriteResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer$RewriteResult.class
new file mode 100644
index 0000000..0708038
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer$RewriteResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer.class
new file mode 100644
index 0000000..d666bcf
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$Builder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$Builder.class
new file mode 100644
index 0000000..efea708
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$Builder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification$1.class
new file mode 100644
index 0000000..7ab7e5d
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification$2.class
new file mode 100644
index 0000000..774693c
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification.class
new file mode 100644
index 0000000..2c90fc4
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImplicitImportIdentification.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting$1.class
new file mode 100644
index 0000000..36ec1d0
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting$2.class
new file mode 100644
index 0000000..450b9f6
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting.class
new file mode 100644
index 0000000..7956319
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$ImportContainerSorting.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling$1.class
new file mode 100644
index 0000000..23f838e
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling$2.class
new file mode 100644
index 0000000..36fd7da
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling.class
new file mode 100644
index 0000000..8803117
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration$OriginalImportHandling.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration.class
new file mode 100644
index 0000000..73bfa18
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportsDelta.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportsDelta.class
new file mode 100644
index 0000000..815e538
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportsDelta.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/NewImportEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/NewImportEntry.class
new file mode 100644
index 0000000..984c483
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/NewImportEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandComputer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandComputer.class
new file mode 100644
index 0000000..ba93090
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandComputer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandReduction.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandReduction.class
new file mode 100644
index 0000000..0d22311
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandReduction.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder$AdjacentImports.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder$AdjacentImports.class
new file mode 100644
index 0000000..46ace9a
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder$AdjacentImports.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder.class
new file mode 100644
index 0000000..513d24a
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OriginalImportEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OriginalImportEntry.class
new file mode 100644
index 0000000..3b46f81
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OriginalImportEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageAndContainingTypeImportComparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageAndContainingTypeImportComparator.class
new file mode 100644
index 0000000..2831852
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageAndContainingTypeImportComparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageImportComparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageImportComparator.class
new file mode 100644
index 0000000..f579ae0
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageImportComparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RemovedImportCommentReassigner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RemovedImportCommentReassigner.class
new file mode 100644
index 0000000..7ada5c5
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RemovedImportCommentReassigner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ReorderingImportAdder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ReorderingImportAdder.class
new file mode 100644
index 0000000..f497c7a
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ReorderingImportAdder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RewriteSite.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RewriteSite.class
new file mode 100644
index 0000000..6838ee1
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RewriteSite.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/StaticConflictingSimpleNameFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/StaticConflictingSimpleNameFinder.class
new file mode 100644
index 0000000..a48af74
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/StaticConflictingSimpleNameFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder$ConflictAccumulatingTypeRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder$ConflictAccumulatingTypeRequestor.class
new file mode 100644
index 0000000..bbfb977
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder$ConflictAccumulatingTypeRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder.class
new file mode 100644
index 0000000..667c0c7
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper$1.class
index 5fd76cb..a126a8d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.class
index 1614a9f..85b2f8f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/GlobalVariableWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/GlobalVariableWrapper.class
index 8928abc..1ffdbcc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/GlobalVariableWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/GlobalVariableWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/RequestorWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/RequestorWrapper.class
index b1e5e01..2e84677 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/RequestorWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/eval/RequestorWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/ChangeCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/ChangeCollector.class
index b4e9153..864d481 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/ChangeCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/ChangeCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.class
index 25facac..069dc1d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder$1.class
index a1447f6..f6f0aa1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.class
index 1fcab9e..248d768 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.class
index ec124df..217eb62 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.class
index 006d485..28bb90f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1.class
index 299942c..0d24b71 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1PathCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1PathCollector.class
index ac06172..8b99481 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1PathCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$1PathCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$2.class
index 98c5b42..1c859eb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$3.class
index 673fd76..5ad58a2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$Queue.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$Queue.class
index b0605fa..6f3b00d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$Queue.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder$Queue.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.class
index dfd5584..f215db4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedHierarchyBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedHierarchyBuilder.class
index 50e5f57..9cb82b4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedHierarchyBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedHierarchyBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy$1.class
index 70c5a2f..3d1d207 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.class
index 9273176..bcb0e08 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/RegionBasedTypeHierarchy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy$1.class
index c6509ca..aae794c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.class
index 2fd6fdd..47d8073 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex$IntList.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex$IntList.class
index 44035c4..be7683b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex$IntList.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex$IntList.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex.class
index a0d7c8c..aac70a0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/DiskIndex.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/EntryResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/EntryResult.class
index 8a634db..9836c08 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/EntryResult.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/EntryResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/FileIndexLocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/FileIndexLocation.class
index 1f2e858..a718d73 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/FileIndexLocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/FileIndexLocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/Index.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/Index.class
index 3a82622..46ac7b7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/Index.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/Index.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/IndexLocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/IndexLocation.class
index 7e16f30..bb2f2e6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/IndexLocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/IndexLocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/JarIndexLocation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/JarIndexLocation.class
index 9a733fd..87df1ec 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/JarIndexLocation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/JarIndexLocation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/MemoryIndex.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/MemoryIndex.class
index 0e3c990..73d0547 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/MemoryIndex.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/index/MemoryIndex.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/AbstractDOMBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/AbstractDOMBuilder.class
index f9f5587..9afe2ff 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/AbstractDOMBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/AbstractDOMBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/CompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/CompilationUnit.class
index d18671c..229a5f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/CompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/CompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMBuilder.class
index 9836d19..8fb64db 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.class
index 36d562b..4359ba8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMField.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMField.class
index 7ea5da2..096df01 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMField.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMField.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMImport.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMImport.class
index ba7e27c..0baacce 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMImport.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMImport.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMInitializer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMInitializer.class
index 1b1adda..d657a26 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMInitializer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMInitializer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMember.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMember.class
index 7825d3c..a239fa6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMember.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMember.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMethod.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMethod.class
index dcd4763..38b8bf4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMethod.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMMethod.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMNode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMNode.class
index 4231099..b9d7e04 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMNode.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMNode.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMPackage.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMPackage.class
index 4ad8f57..183456a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMPackage.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMPackage.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMType.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMType.class
index 480ac0e..a1d82ae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMType.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/DOMType.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.class
index 8538f88..2ae37f2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SiblingEnumeration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SiblingEnumeration.class
index 30d90a0..d8c5633 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SiblingEnumeration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SiblingEnumeration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.class
index 67c75f6..f8eb3b2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.class
index 57c3d70..70be9b3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractJavaSearchScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractSearchScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractSearchScope.class
index bda95ac..f30497e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractSearchScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/AbstractSearchScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1.class
index 45cac63..de38a8f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllConstructorDeclarationsVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllConstructorDeclarationsVisitor.class
index 6063809..ccb2028 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllConstructorDeclarationsVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllConstructorDeclarationsVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllTypeDeclarationsVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllTypeDeclarationsVisitor.class
index a6aeb42..79616fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllTypeDeclarationsVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$1AllTypeDeclarationsVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2.class
index c5218ad..d7fc85b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2AllTypeDeclarationsVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2AllTypeDeclarationsVisitor.class
index 737c935..7a1e6cc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2AllTypeDeclarationsVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$2AllTypeDeclarationsVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$3.class
index ad397df..acae713 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$4.class
index d423fe0..d92c728 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine.class
index e5f2f9b..fe065a9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/BasicSearchEngine.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/HierarchyScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/HierarchyScope.class
index 66e25e0..736fd53 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/HierarchyScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/HierarchyScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessConstructorRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessConstructorRequestor.class
index a9c485f..f4bb8f5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessConstructorRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessConstructorRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.class
index 734897c..a132de1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IRestrictedAccessTypeRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.class
index b0aa4f6..2b487b1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexQueryRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.class
index a2b89cd..b1557d1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchDocument.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchDocument.class
index 1cdaa34..2afe19f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchDocument.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchDocument.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.class
index e4955ae..e46d2c5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchParticipant.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchScope.class
index 1a15276..18b3de5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.class
index da557ec..425a627 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaSearchTypeNameMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaWorkspaceScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaWorkspaceScope.class
index 4255201..e653b73 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaWorkspaceScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/JavaWorkspaceScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PathCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PathCollector.class
index 2f4ca52..6ac4239 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PathCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PathCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PatternSearchJob.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PatternSearchJob.class
index f017840..6000020 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PatternSearchJob.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/PatternSearchJob.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/StringOperation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/StringOperation.class
index 94dac44..8702a6d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/StringOperation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/StringOperation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.class
index 8cc5055..3d839f3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.class
index 7fe2e10..ff2549e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.class
index c7e49b3..ea945f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/TypeNameRequestorWrapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.class
index 8f1b2dd..2ee9496 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$1.class
index e088a37..a5a27cb 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$2.class
index 4b1694c..56d6981 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex.class
index 69a4cd1..d285661 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddFolderToIndex.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.class
index 5e16f16..ac279d8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.class
index 6f70290..dea6cbd 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.class
index 500d71a..0c86226 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/DefaultJavaIndexer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.class
index f873804..a0cb464 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$1.class
index 16bdc39..e9a460b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$2.class
index b22effc..c563a2f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.class
index f82bfa6..b46b795 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$1.class
index 5246e55..56e3202 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$2.class
index a7fdce7..d0ff7b5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.class
index 174510d..6687c74 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexBinaryFolder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager$1.class
index 01af7fd..3c07424 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager.class
index 1f6ff13..2b91ab5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexRequest.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexRequest.class
index aab1979..97d0817 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexRequest.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexRequest.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.class
index 552e9fc..42c23fa 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/IndexingParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/ReadWriteMonitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/ReadWriteMonitor.class
index 3f3a768..da7c2e5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/ReadWriteMonitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/ReadWriteMonitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFolderFromIndex.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFolderFromIndex.class
index c3b7403..c57bb3b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFolderFromIndex.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFolderFromIndex.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.class
index 2b8ca9e..a7fb5ae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/RemoveFromIndex.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SaveIndex.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SaveIndex.class
index e7628f4..78898f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SaveIndex.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SaveIndex.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.class
index afb900c..91c5e25 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.class
index 9b82051..7e5535f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndLocator.class
index 19edc3f..459cf6c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndPattern.class
index 7e9b0b7..63e8c66 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/AndPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.class
index bda4d18..29eae58 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.class
index dcd43f3..e810dc4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.class
index 11074d4..a0b3bd2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorDeclarationPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.class
index 059ace9..525718b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.class
index 2af2294..dcccb3d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.class
index 11171ef..49087d9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.class
index 8b5c3f2..b247403 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedTypesPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedTypesPattern.class
index d9183e6..c709087 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedTypesPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedTypesPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldLocator.class
index ed089c5..c66390f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldPattern.class
index 3a245a8..4b57315 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/FieldPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.class
index 5efdd63..ba65528 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/IntersectingPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/IntersectingPattern.class
index d5ca195..c3bae56 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/IntersectingPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/IntersectingPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.class
index c460e8b..bbe3a6d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.class
index 3fb65f2..559e190 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.class
index bdf557b..a5c777b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.class
index 7e38803..2f73bc3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$1.class
index d51d1d8..8476075 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WorkingCopyDocument.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WorkingCopyDocument.class
index 260c0fc..23f0b55 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WorkingCopyDocument.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WorkingCopyDocument.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WrappedCoreException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WrappedCoreException.class
index 17c4b91..33ddd19 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WrappedCoreException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator$WrappedCoreException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.class
index 0a24b3d..9429cb6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassAndMethodDeclarationVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassAndMethodDeclarationVisitor.class
index 766bd5c..f1a413e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassAndMethodDeclarationVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassAndMethodDeclarationVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassButNoMethodDeclarationVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassButNoMethodDeclarationVisitor.class
index f9769fb..d2c162e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassButNoMethodDeclarationVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$ClassButNoMethodDeclarationVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$MethodButNoClassDeclarationVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$MethodButNoClassDeclarationVisitor.class
index 4097ce1..473f369 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$MethodButNoClassDeclarationVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$MethodButNoClassDeclarationVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$NoClassNoMethodDeclarationVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$NoClassNoMethodDeclarationVisitor.class
index efcf7ae..07b83d3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$NoClassNoMethodDeclarationVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser$NoClassNoMethodDeclarationVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.class
index 8569a1e..6940b60 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet$1.class
index 13c42fc..75ae8da 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.class
index e3106cd..5195644 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.class
index 20b0071..1443ac1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MemberDeclarationVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.class
index 4770ec7..38ed28f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodPattern.class
index d07d054..dcb4925 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.class
index bbca556..ed742c0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrLocator.class
index bcdde09..32ee10b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrPattern.class
index 1aca09b..0cb82a5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/OrPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationLocator.class
index 5722e40..a7d7831 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.class
index a1ae1c2..d072852 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.class
index d2eb15b..c3219b4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.class
index ed46b71..2085dd2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PatternLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PatternLocator.class
index eed1516..8818fa3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PatternLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PatternLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.class
index f0f09de..d704c17 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatchSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatchSet.class
index 3206409..f90809c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatchSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/PossibleMatchSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.class
index 862fd99..5a03db0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.class
index e7cdf69..158f4f3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$1.class
index 5664cf8..055cea5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$TypeDeclarationVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$TypeDeclarationVisitor.class
index 71bbf2d..d0adb77 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$TypeDeclarationVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector$TypeDeclarationVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.class
index d8b7967..77deb59 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.class
index d2106fb..1d5580c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferenceLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.class
index aaa7727..298b73c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.class
index 7e61898..6cd2c0b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern$PackageNameSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern$PackageNameSet.class
index b590919..b8664b6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern$PackageNameSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern$PackageNameSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.class
index 0143142..9c09510 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.class
index 16f1654..30c78af 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.class
index e977166..6006b3c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.class
index 0620d21..d493694 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.class
index f9d36b9..1dd928b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariableLocator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariableLocator.class
index 485683a..684a6e5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariableLocator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariableLocator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariablePattern.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariablePattern.class
index 2bc11fd..1808ce1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariablePattern.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/matching/VariablePattern.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/IJob.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/IJob.class
index 01b5338..1d57819 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/IJob.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/IJob.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager$1ProgressJob.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager$1ProgressJob.class
index 9ac55b8..acd4d45 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager$1ProgressJob.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager$1ProgressJob.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager.class
index 038f035..cd55aba 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/search/processing/JobManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder$1Visitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder$1Visitor.class
index 75ffd43..7163474 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder$1Visitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder$1Visitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder.class
index 8f82537..54185c8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ASTNodeFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Annotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Annotation.class
index f204e6f..9a11200 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Annotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Annotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponent.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponent.class
index d799152..26c04fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponent.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponent.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponentValue.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponentValue.class
index 50f03a8..254d7bf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponentValue.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationComponentValue.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationDefaultAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationDefaultAttribute.class
index 93614c3..7307706 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationDefaultAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/AnnotationDefaultAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser$Scanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser$Scanner.class
index 01db96a..d86aa01 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser$Scanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser$Scanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.class
index cddd14b..6a03020 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver$1CaptureFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver$1CaptureFinder.class
index be4c4a2..2f3a45e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver$1CaptureFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver$1CaptureFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver$SyntheticLocalVariableBinding.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver$SyntheticLocalVariableBinding.class
new file mode 100644
index 0000000..901093e
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver$SyntheticLocalVariableBinding.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.class
index f59eb1e..b17d973 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.class
index 641ec7f..f227773 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsEntry.class
index 07de7b3..52acd0c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/BootstrapMethodsEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CharArrayBuffer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CharArrayBuffer.class
index 68fc8b1..714f056 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CharArrayBuffer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CharArrayBuffer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileAttribute.class
index 2aebd28..7493796 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileReader.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileReader.class
index 4b65f15..8c5870d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileReader.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileReader.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileStruct.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileStruct.class
index 2c27d64..62229a7 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileStruct.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ClassFileStruct.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeAttribute.class
index 682839f..e1aa3f4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.class
index 5e0fea6..90c2fac 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CodeSnippetParsingUtil.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CommentRecorderParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CommentRecorderParser.class
index 430b663..930af93 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CommentRecorderParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/CommentRecorderParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPool.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPool.class
index 5244b7a..e1023a1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPool.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPool.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry.class
index 1b320ab..ee695a2 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.class
index d9e865d..8d4c855 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantPoolEntry2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantValueAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantValueAttribute.class
index 0017991..9ba79c0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantValueAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ConstantValueAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.class
index f12f898..40253ac 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.class
index fa75238..77eee01 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultStackMapFrame.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultStackMapFrame.class
index 2934e3c..10da441 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultStackMapFrame.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/DefaultStackMapFrame.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.class
index 535fa15..853d637 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/EnclosingMethodAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/EnclosingMethodAttribute.class
index 6059dab..01abfd4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/EnclosingMethodAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/EnclosingMethodAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionAttribute.class
index a562c81..eed2671 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionTableEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionTableEntry.class
index 3187091..f0b792c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionTableEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExceptionTableEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.class
index a2f6680..e3b9209 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ExtendedAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/FieldInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/FieldInfo.class
index 302cce6..6ab2ae5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/FieldInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/FieldInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HandleFactory.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HandleFactory.class
index a7d7790..de220f9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HandleFactory.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HandleFactory.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfArray.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfArray.class
index 28aa13d..21fdcd3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfArray.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfArray.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfCharArrayArray.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfCharArrayArray.class
index 3d5bb56..fcad745 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfCharArrayArray.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashSetOfCharArrayArray.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.class
index 3e8d29e..30c6b56 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/HashtableOfArrayToObject.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ICacheEnumeration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ICacheEnumeration.class
index 5616122..e78fe66 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ICacheEnumeration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ICacheEnumeration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ILRUCacheable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ILRUCacheable.class
index f495fe8..d76391c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ILRUCacheable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ILRUCacheable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttribute.class
index baf058b..2f2738a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttributeEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttributeEntry.class
index 2a171d6..a829a3f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttributeEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/InnerClassesAttributeEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/JavaElementFinder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/JavaElementFinder.class
index 11cf1a2..bd659c4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/JavaElementFinder.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/JavaElementFinder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.class
index 1e9268b..b907f0a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.class
index 9b01fc3..674338f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$1.class
index 2c4cec5..7046731 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$LRUCacheEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$LRUCacheEntry.class
index 1cd0b7c..c917d85 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$LRUCacheEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$LRUCacheEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$Stats.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$Stats.class
index ccf0680..3d826a8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$Stats.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache$Stats.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache.class
index b333972..e95abcf 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LRUCache.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LineNumberAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LineNumberAttribute.class
index f645585..6477764 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LineNumberAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LineNumberAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableAttribute.class
index c79d9ac..bcf37e4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableReferenceInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableReferenceInfo.class
index 37e04be..b0044db 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableReferenceInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableReferenceInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTableEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTableEntry.class
index 4db328b..7e6b6f0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTableEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTableEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeAttribute.class
index 7b90db5..b6d8419 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeTableEntry.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeTableEntry.class
index 45e371e..55d9462 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeTableEntry.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/LocalVariableTypeTableEntry.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MementoTokenizer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MementoTokenizer.class
index eb3bb2a..0533850 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MementoTokenizer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MementoTokenizer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.class
index fd2dee6..d3ee763 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodInfo.class
index fa35cfc..1f7b241 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.class
index e1e1497..d8c38e5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/MethodParametersAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ParameterAnnotation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ParameterAnnotation.class
index 4f2b9bc..c62685d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ParameterAnnotation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ParameterAnnotation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/PublicScanner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/PublicScanner.class
index 5ed1f4a..072339d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/PublicScanner.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/PublicScanner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RecordedParsingInformation.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RecordedParsingInformation.class
index 669a604..36a3492 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RecordedParsingInformation.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RecordedParsingInformation.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.class
index bc6810a..d7f393e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ResourceCompilationUnit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ResourceCompilationUnit.class
index 62a029e..4ab27ea 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ResourceCompilationUnit.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ResourceCompilationUnit.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleAnnotationsAttribute.class
index ee106ca..0634a89 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleParameterAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleParameterAnnotationsAttribute.class
index ea69937..078721e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleParameterAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleParameterAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleTypeAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleTypeAnnotationsAttribute.class
index 4f99200..33d2ed9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleTypeAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeInvisibleTypeAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleAnnotationsAttribute.class
index 082de07..8ec0ed3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleParameterAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleParameterAnnotationsAttribute.class
index 7c151db..45e7e9e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleParameterAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleParameterAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleTypeAnnotationsAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleTypeAnnotationsAttribute.class
index 93a4628..a1ab1ae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleTypeAnnotationsAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/RuntimeVisibleTypeAnnotationsAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SignatureAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SignatureAttribute.class
index 56de7e1..6410c69 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SignatureAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SignatureAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleDocument.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleDocument.class
index 9917ffb..229a5c9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleDocument.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleDocument.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleWordSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleWordSet.class
index 378f75e..b30bc9d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleWordSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SimpleWordSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SourceFileAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SourceFileAttribute.class
index 29f72e2..4153d1e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SourceFileAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/SourceFileAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapAttribute.class
index 1c1705e..ad7c5e9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapFrame.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapFrame.class
index 559496d..3c27e9a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapFrame.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapFrame.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapTableAttribute.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapTableAttribute.class
index fb8bb4e..2b84ad9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapTableAttribute.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/StackMapTableAttribute.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ToStringSorter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ToStringSorter.class
index 7fbc26c..40e34d5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ToStringSorter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/ToStringSorter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$1.class
index 3e06f20..a6f370f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$BindingsToNodesMap.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$BindingsToNodesMap.class
index 51970e0..8163050 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$BindingsToNodesMap.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$BindingsToNodesMap.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparable.class
index 5fbb369..86ee679 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparer.class
index e21deb4..a7ca90f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparer.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util$Comparer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util.class
index 51cbce2..689ebb3 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/Util.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/VerificationInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/VerificationInfo.class
index 0163b60..d92ff89 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/VerificationInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/VerificationInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet$HashableWeakReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet$HashableWeakReference.class
index 2b83d72..3a02f94 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet$HashableWeakReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet$HashableWeakReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet.class
index 06b5d59..97c566d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSet.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray$HashableWeakReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray$HashableWeakReference.class
index 64bd785..5370c29 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray$HashableWeakReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray$HashableWeakReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray.class
index 217968a..634716d 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/WeakHashSetOfCharArray.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties
index d5908f8..bf3c646 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties
@@ -191,7 +191,7 @@
cache_invalidLoadFactor = Incorrect load factor
savedState_jobName = Processing Java changes since last activation
refreshing_external_folders = Refreshing external folders
-updating_external_archives_jobName = Refreshing external archives
+synchronizing_projects_job = Synchronizing projects
## java model initialization
javamodel_initialization = Initializing Java tooling
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.class
index 4c37351..176b071 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.class
index 5877c7f..dc5e7b9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.class
index 5698d86..efc8cad 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetCompiler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEnvironment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEnvironment.class
index e4f45f2..9b32d4b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEnvironment.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEnvironment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.class
index ca7c374..d596560 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetEvaluator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.class
index d61dc52..5ab6913 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.class
index 3a210b1..fa221fc 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetParser.class
index afb1618..da645f5 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetParser.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetParser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.class
index 4a8aaf3..a799599 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.class
index a4c606e..3aacff8 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetReturnStatement.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.class
index 2061dc7..4567fa0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.class
index 819d4f7..5ae1c30 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton$BinaryMethodSkeleton.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton$BinaryMethodSkeleton.class
index 0d2e143..96f516b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton$BinaryMethodSkeleton.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton$BinaryMethodSkeleton.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.class
index 9358a3c..46fc6c6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.class
index 77613df..17b5cef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.class
index 8eb2851..53fc91c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$1.class
index a6ea28c..f406b23 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$2.class
index 414ea0b..3e30e2f 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.class
index c69f4db..7e51d2c 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.class
index 981583e..cd6ed1b 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetTypeDeclaration.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationConstants.class
index f30f32b..1953050 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationConstants.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationConstants.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1.class
index be79d92..64aa4ed 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1ForwardingRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1ForwardingRequestor.class
index 653768f..e2dc6f1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1ForwardingRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$1ForwardingRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$2.class
index 9276186..87e4f12 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$2.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$3.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$3.class
index a9dfeee..2c7e91e 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$3.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$3.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$4.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$4.class
index e4f6ea7..629bdc1 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$4.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$4.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$5.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$5.class
index a250b85..c4dc31a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$5.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext$5.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext.class
index dc4f9ea..1bef125 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationContext.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationResult.class
index 6a57fba..ed418a4 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationResult.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/EvaluationResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1.class
index 5312899..729eb3a 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1CompilerRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1CompilerRequestor.class
index 291105a..4a12624 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1CompilerRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator$1CompilerRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator.class
index 5ebdd3c..2548250 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/Evaluator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/GlobalVariable.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/GlobalVariable.class
index 1ed8a85..6d1e714 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/GlobalVariable.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/GlobalVariable.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/IRequestor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/IRequestor.class
index 33fdfb1..c9f2356 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/IRequestor.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/IRequestor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/InstallException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/InstallException.class
index 8d2c1ce..b591fae 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/InstallException.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/InstallException.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesEvaluator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesEvaluator.class
index c62bc3f..66174e6 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesEvaluator.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesEvaluator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesInfo.class
index 28b18fc..fc4e052 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesInfo.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/eval/VariablesInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/AbortFormatting.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/AbortFormatting.class
deleted file mode 100644
index 398f87e..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/AbortFormatting.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/BinaryExpressionFragmentBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/BinaryExpressionFragmentBuilder.class
deleted file mode 100644
index 6a2860d..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/BinaryExpressionFragmentBuilder.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CascadingMethodInvocationFragmentBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CascadingMethodInvocationFragmentBuilder.class
deleted file mode 100644
index e8b8d2a..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CascadingMethodInvocationFragmentBuilder.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor$MultiFieldDeclaration.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor$MultiFieldDeclaration.class
deleted file mode 100644
index a9188a6..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor$MultiFieldDeclaration.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.class
deleted file mode 100644
index 00d44a3..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CommentsPreparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CommentsPreparator.class
new file mode 100644
index 0000000..5a60f4a
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/CommentsPreparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.class
index ceb155a..3a66ff0 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions$Alignment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions$Alignment.class
new file mode 100644
index 0000000..dc49d35
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions$Alignment.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.class
index a18b94d..2701064 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadoc.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadoc.class
deleted file mode 100644
index 3667f11..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadoc.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.class
deleted file mode 100644
index d49391b..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocNode.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocNode.class
deleted file mode 100644
index 06443eb..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocNode.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocReference.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocReference.class
deleted file mode 100644
index 90ed457..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocReference.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocText.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocText.class
deleted file mode 100644
index 8032217..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocText.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatterCommentParser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatterCommentParser.class
deleted file mode 100644
index 09b52ad..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/FormatterCommentParser.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/ICodeFormatterConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/ICodeFormatterConstants.class
deleted file mode 100644
index f02d91f..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/ICodeFormatterConstants.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.class
new file mode 100644
index 0000000..715db7c
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Location.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Location.class
deleted file mode 100644
index 978e3f2..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Location.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/OptimizedReplaceEdit.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/OptimizedReplaceEdit.class
deleted file mode 100644
index 5ce0088..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/OptimizedReplaceEdit.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe$1.class
deleted file mode 100644
index 71382f5..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe$1.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe$LineComment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe$LineComment.class
deleted file mode 100644
index 7b290f5..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe$LineComment.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe.class
deleted file mode 100644
index 9cbaaf4..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator$1.class
new file mode 100644
index 0000000..6ddf6b7
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator.class
new file mode 100644
index 0000000..74782d4
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TextEditsBuilder.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TextEditsBuilder.class
new file mode 100644
index 0000000..91674f6
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TextEditsBuilder.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Token$WrapPolicy.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Token$WrapPolicy.class
new file mode 100644
index 0000000..2500c70
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Token$WrapPolicy.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Token.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Token.class
new file mode 100644
index 0000000..85f39af
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/Token.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager$1.class
new file mode 100644
index 0000000..a6e253c
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager.class
new file mode 100644
index 0000000..e7c7ccf
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenTraverser.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenTraverser.class
new file mode 100644
index 0000000..39cb20b
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/TokenTraverser.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/align/Alignment.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/align/Alignment.class
deleted file mode 100644
index 460b8eb..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/align/Alignment.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/align/AlignmentException.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/align/AlignmentException.class
deleted file mode 100644
index 58caae2..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/align/AlignmentException.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil$1.class
deleted file mode 100644
index 57444ba..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil$1.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.class
deleted file mode 100644
index bdd181e..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/HTMLEntity2JavaReader.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/HTMLEntity2JavaReader.class
deleted file mode 100644
index 6de9e99..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/HTMLEntity2JavaReader.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.class
deleted file mode 100644
index 2072b3b..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.class
deleted file mode 100644
index c4e0e76..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.class
deleted file mode 100644
index 6cecc53..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.class
+++ /dev/null
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/package.html b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/package.html
deleted file mode 100644
index d2210a7..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/comment/package.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-Provides facilities to format comments in Java source code.
-<h2>
-Package Specification</h2>
-This package provides interfaces and implementations for three kinds of comment types used in
-Java source code:
-<ul>
-<li>Javadoc comments</li>
-<li>Multi-line comments</li>
-<li>Single-line comments</li>
-</ul>
-<h3>
-Comment Formatting</h3>
-Comment regions form the principle access point to the formatting of comments. To create a comment
-region for a specified comment type, the factory method
-<tt>CommentObjectFactory#createRegion(IDocument, TypedPosition, String, Map, StyledText)</tt>
-should be used.<p>
-The formatting process is then launch by calling <tt>CommentRegion#format(String)</tt>, where
-the argument denotes the desired indentation. This method returns a textedit representing the changes that where made during
-the formatting process. The document for which the comment region was created is therefore guaranteed
-to remain unchanged.<p>
-Internally, the comment region is first cast into comment lines to form the basis of the following scan step:
-Each comment line is scanned for valid prefixes and tokenized afterwards. This tokenize step yields a stream of
-tokens called comment ranges that are then marked with attributes representing information about the kind of
-token associated with that comment range.<p>
-Once the comment ranges have enough attributed information, the comment region wraps the comment ranges at
-the line margin boundary. This is coordinated by a set of rules that can be contributed to a certain type of comment
-region. At this point of time, the comment range stream already represents the formatted comment region. The last
-step therefore is to record the edits and to construct the resulting text edit, which describes all the changes that were
-made to the comment region.
-<br>
-Note that the changes are not directly applied to the document. Clients are responsible for applying the textedit
-and updating and preserving the document structure.
-<p>
-All the objects used during comment formatting should not directly be instantiated, but
-rather retrieved from the factory <tt>CommentObjectFactory</tt>. This factory ensures
-that the right kind of regions and lines are returned for a specific comment type.
-</body>
-</html>
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/CommentWrapExecutor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/CommentWrapExecutor.class
new file mode 100644
index 0000000..e224650
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/CommentWrapExecutor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner$PositionCounter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner$PositionCounter.class
new file mode 100644
index 0000000..5b4e387
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner$PositionCounter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner.class
new file mode 100644
index 0000000..29c6fd7
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$LineAnalyzer.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$LineAnalyzer.class
new file mode 100644
index 0000000..9699225
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$LineAnalyzer.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$NLSTagHandler.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$NLSTagHandler.class
new file mode 100644
index 0000000..3fbf88c
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$NLSTagHandler.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$WrapInfo.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$WrapInfo.class
new file mode 100644
index 0000000..4057913
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$WrapInfo.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$WrapResult.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$WrapResult.class
new file mode 100644
index 0000000..5e50eb7
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor$WrapResult.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.class
new file mode 100644
index 0000000..63e48c9
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator$1.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator$1.class
new file mode 100644
index 0000000..a2505bb
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator$1.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator$2.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator$2.class
new file mode 100644
index 0000000..3761d4a
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator$2.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.class
new file mode 100644
index 0000000..edf5681
--- /dev/null
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/old/CodeFormatter.class b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/old/CodeFormatter.class
index 6c4c97e..a8c3cef 100644
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/old/CodeFormatter.class
+++ b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/old/CodeFormatter.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/options.properties b/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/options.properties
deleted file mode 100644
index 40f9549..0000000
--- a/org.aspectj.ajde/classes/org/aspectj/org/eclipse/jdt/internal/formatter/options.properties
+++ /dev/null
@@ -1,75 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-newline.openingBrace.number=1
-newline.openingBrace.category=Newline
-newline.openingBrace.name=I&nsert new line before opening brace
-newline.openingBrace.possibleValues=2|Insert|Do not insert
-newline.openingBrace.description=When Insert, a new line is inserted before an opening brace, otherwise nothing is inserted
-
-newline.controlStatement.number=2
-newline.controlStatement.category=Newline
-newline.controlStatement.name=Insert new &line in control statement
-newline.controlStatement.possibleValues=2|Insert|Do not insert
-newline.controlStatement.description=When Insert, a new line is inserted between } and else, catch, finally
-
-newline.clearAll.number=3
-newline.clearAll.category=Newline
-newline.clearAll.name=Clear all &blank lines
-newline.clearAll.possibleValues=2|Clear|Preserve one
-newline.clearAll.description=When Clear, all blank lines are removed. When Preserve one, only one is kept and all others removed.
-
-newline.elseIf.number=4
-newline.elseIf.category=Newline
-newline.elseIf.name=&Keep else if on the same line
-newline.elseIf.possibleValues=2|Yes|No
-newline.elseIf.description=When Yes, a blank line is inserted between a else and a if when they are contiguous
-
-newline.emptyBlock.number=5
-newline.emptyBlock.category=Newline
-newline.emptyBlock.name=In&sert a new line inside an empty block
-newline.emptyBlock.possibleValues=2|Insert|Do not insert
-newline.emptyBlock.description=When insert, a line break is inserted between contiguous { and }, if } is not followed by a keyword.
-
-line.split.number=6
-line.split.category=Line splitting
-line.split.name=Ma&ximum line length
-line.split.possibleValues=-1
-line.split.description=Enable splitting of long lines (exceeding the configurable length). Length of 0 will disable line splitting
-
-style.compactAssignment.number=7
-style.compactAssignment.category=Style
-style.compactAssignment.name=&Compact assignment
-style.compactAssignment.possibleValues=2|Compact|Normal
-style.compactAssignment.description=Assignments can be formatted asymmetrically, e.g. 'int x= 2;', when Normal, a space is inserted before the assignment operator
-
-style.reuseExistingLayout.number=8
-style.reuseExistingLayout.category=Style
-style.reuseExistingLayout.name=&Reuse existing layout
-style.reuseExistingLayout.possibleValues=2|Reuse|Do not reuse
-style.reuseExistingLayout.description=If the user has formatted his code a certain way, the formatter does not try to reformat it
-
-tabulation.char.number=9
-tabulation.char.category=Style
-tabulation.char.name=Indentation is represented by &tab
-tabulation.char.possibleValues=2|Tab|Spaces
-tabulation.char.description=Either choose to indent with tab characters or spaces
-
-tabulation.size.number=10
-tabulation.size.category=Style
-tabulation.size.name=&Amount of spaces representing a tab
-tabulation.size.possibleValues=-1
-tabulation.size.description=Tabulation size in term of space characters
-
-space.castexpression.number=11
-space.castexpression.category=Style
-space.castexpression.name=&Insert a space in cast expression
-space.castexpression.size.possibleValues=2|Insert|Do not insert
-space.castexpression.description=When insert, a space is added between the closing parenthesis and the expression of the cast expression
diff --git a/org.aspectj.ajde/classes/org/aspectj/tools/ajc/Main.class b/org.aspectj.ajde/classes/org/aspectj/tools/ajc/Main.class
index 4d4f66d..2500216 100644
--- a/org.aspectj.ajde/classes/org/aspectj/tools/ajc/Main.class
+++ b/org.aspectj.ajde/classes/org/aspectj/tools/ajc/Main.class
Binary files differ
diff --git a/org.aspectj.ajde/classes/org/aspectj/tools/ajdoc/Main.class b/org.aspectj.ajde/classes/org/aspectj/tools/ajdoc/Main.class
index 84597fb..6d01bf9 100644
--- a/org.aspectj.ajde/classes/org/aspectj/tools/ajdoc/Main.class
+++ b/org.aspectj.ajde/classes/org/aspectj/tools/ajdoc/Main.class
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java b/org.aspectj.ajde/source/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java
index 6cf6527..20bbef5 100644
--- a/org.aspectj.ajde/source/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java
+++ b/org.aspectj.ajde/source/org/aspectj/ajdt/internal/compiler/ast/KnownMessageSend.java
@@ -28,7 +28,11 @@
this.receiver = receiver;
this.actualReceiverType = binding.declaringClass;
this.selector = binding.selector;
- constant = Constant.NotAConstant;
+ // 1.8.7 change:
+ // If we don't set this to NotAConstant then we run the code in MessageSend.resolveType that sorts
+ // out this.argumentTypes - which we need set because further down MessageSend.resolveType it will
+ // attempt to use it.
+// constant = Constant.NotAConstant;
}
public void manageSyntheticAccessIfNecessary(BlockScope currentScope) {
@@ -38,8 +42,7 @@
protected void resolveMethodBinding(
BlockScope scope,
TypeBinding[] argumentTypes) {
- // we've already resolved this
-
+ // we've already resolved this
}
public String toStringExpression() {
diff --git a/org.aspectj.ajde/source/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java b/org.aspectj.ajde/source/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java
index 6770b64..1a88cb3 100644
--- a/org.aspectj.ajde/source/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java
+++ b/org.aspectj.ajde/source/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java
@@ -19,6 +19,8 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
/**
* Used to determine if a type has structurally changed during incremental compilation. At the end of compilation we create one of
@@ -181,4 +183,10 @@
return typeAnnotations;
}
+ public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member,
+ LookupEnvironment environment) {
+ // TODO[1.8.7] more to do here? In what contexts?
+ return walker;
+ }
+
}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/CheckDebugAttributes.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/CheckDebugAttributes.java
index eb6d265..be0472e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/CheckDebugAttributes.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/CheckDebugAttributes.java
@@ -61,6 +61,10 @@
jarFile = new ZipFile(this.file);
} catch (ZipException e) {
throw new BuildException(AntAdapterMessages.getString("checkDebugAttributes.file.argument.must.be.a.classfile.or.a.jarfile")); //$NON-NLS-1$
+ } finally {
+ if (jarFile != null) {
+ jarFile.close();
+ }
}
for (Enumeration entries = jarFile.entries(); !hasDebugAttributes && entries.hasMoreElements(); ) {
ZipEntry entry = (ZipEntry) entries.nextElement();
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.java
index d26218e..a6863f5 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/IClasspathAttribute.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core;
@@ -113,6 +115,17 @@
String OPTIONAL = "optional"; //$NON-NLS-1$
/**
+ * Constant for the name of the external annotation path attribute.
+ *
+ * <p>The value for this attribute has to be the string representation of a path.
+ * It should point to an existing directory where external annotations can be
+ * found to support annotation based null analysis involving 3rd party libraries.</p>
+ *
+ * @since 3.11
+ */
+ String EXTERNAL_ANNOTATION_PATH = "annotationpath"; //$NON-NLS-1$
+
+ /**
* Returns the name of this classpath attribute.
*
* @return the name of this classpath attribute.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.java
index 5897e67..81099b2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ICompilationUnit.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -333,8 +333,12 @@
* their respective compilation units.
* <li>A exists.
* </ul>
- * Returns <code>null</code> if no such java elements can be found
- * or if the given element is not included in a compilation unit.
+ * Returns <code>null</code> for the following cases:
+ * <ul>
+ * <li>if no such java elements can be found or if the given element is not included in this compilation unit</li>
+ * <li>the element is a lambda expression, i.e. calling {@link IType#isLambda()} returns true</li>
+ * <li>the element is an {@link ILocalVariable}</li>
+ * </ul>
*
* @param element the given element
* @return the found elements in this compilation unit that correspond to the given element
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/JavaCore.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/JavaCore.java
index 1e36963..7b8fe82 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/JavaCore.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/JavaCore.java
@@ -101,6 +101,7 @@
* Jesper S Moller - Contributions for bug 381345 : [1.8] Take care of the Java 8 major version
* - added the following constants:
* COMPILER_CODEGEN_METHOD_PARAMETERS_ATTR
+ * Harry Terkelsen (het@google.com) - Bug 449262 - Allow the use of third-party Java formatters
*
*******************************************************************************/
@@ -286,17 +287,19 @@
public static final String COMPILER_CODEGEN_METHOD_PARAMETERS_ATTR = PLUGIN_ID + ".compiler.codegen.methodParameters"; //$NON-NLS-1$
/**
* Compiler option ID: Defining Target Java Platform.
- * <p>For binary compatibility reason, .class files can be tagged to with certain VM versions and later.</p>
- * <p>Note that <code>"1.4"</code> target requires to toggle compliance mode to <code>"1.4"</code>, <code>"1.5"</code> target requires
- * to toggle compliance mode to <code>"1.5"</code>, <code>"1.6"</code> target requires to toggle compliance mode to <code>"1.6"</code> and
- * <code>"1.7"</code> target requires to toggle compliance mode to <code>"1.7"</code>.
- * <code>"cldc1.1"</code> requires the source version to be <code>"1.3"</code> and the compliance version to be <code>"1.4"</code> or lower.</p>
+ * <p>For binary compatibility reasons, .class files are tagged with a minimal required VM version.</p>
+ * <p>Note that <code>"1.4"</code> and higher target versions require the compliance mode to be at least as high
+ * as the target version. Usually, compliance, target, and source versions are set to the same values.</p>
+ * <p><code>"cldc1.1"</code> requires the source version to be <code>"1.3"</code> and the compliance version to be <code>"1.4"</code> or lower.</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.aspectj.org.eclipse.jdt.core.compiler.codegen.targetPlatform"</code></dd>
- * <dt>Possible values:</dt><dd><code>{ "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "cldc1.1" }</code></dd>
+ * <dt>Possible values:</dt><dd><code>{ "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "cldc1.1" }</code></dd>
* <dt>Default:</dt><dd><code>"1.2"</code></dd>
* </dl>
* @category CompilerOptionID
+ * @see #COMPILER_COMPLIANCE
+ * @see #COMPILER_SOURCE
+ * @see #setComplianceOptions(String, Map)
*/
public static final String COMPILER_CODEGEN_TARGET_PLATFORM = PLUGIN_ID + ".compiler.codegen.targetPlatform"; //$NON-NLS-1$
/**
@@ -451,6 +454,19 @@
*/
public static final String COMPILER_PB_UNUSED_PARAMETER = PLUGIN_ID + ".compiler.problem.unusedParameter"; //$NON-NLS-1$
/**
+ * Compiler option ID: Reporting Unused Exception Parameter.
+ * <p>When enabled, the compiler will issue an error or a warning for unused exception
+ * parameters (that is, the thrown exception is never read from).</p>
+ * <dl>
+ * <dt>Option id:</dt><dd><code>"org.aspectj.org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter"</code></dd>
+ * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
+ * <dt>Default:</dt><dd><code>"ignore"</code></dd>
+ * </dl>
+ * @category CompilerOptionID
+ * @since 3.11
+ */
+ public static final String COMPILER_PB_UNUSED_EXCEPTION_PARAMETER = PLUGIN_ID + ".compiler.problem.unusedExceptionParameter"; //$NON-NLS-1$
+ /**
* Compiler option ID: Reporting Unused Parameter if Implementing Abstract Method.
* <p>When enabled, the compiler will signal unused parameters in abstract method implementations.</p>
* <p>The severity of the problem is controlled with option {@link #COMPILER_PB_UNUSED_PARAMETER}.</p>
@@ -1774,32 +1790,37 @@
* reserved for assertion support. Also note, than when toggling to 1.4 mode, the target VM
* level should be set to <code>"1.4"</code> and the compliance mode should be <code>"1.4"</code>.</p>
* <p>Source level 1.5 is necessary to enable generics, autoboxing, covariance, annotations, enumerations
- * enhanced for loop, static imports and varargs. Once toggled, the target VM level should be set to <code>"1.5"</code>
- * and the compliance mode should be <code>"1.5"</code>.</p>
- * <p>Source level 1.6 is necessary to enable the computation of stack map tables. Once toggled, the target
- * VM level should be set to <code>"1.6"</code> and the compliance mode should be <code>"1.6"</code>.</p>
- * <p>Once the source level 1.7 is toggled, the target VM level should be set to <code>"1.7"</code> and the compliance mode
- * should be <code>"1.7"</code>.</p>
+ * enhanced for loop, static imports and varargs.</p>
+ * <p>In source levels <code>"1.5"</code> and higher, the compliance and target settings should be
+ * set to the same version as the source level.</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.aspectj.org.eclipse.jdt.core.compiler.source"</code></dd>
- * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7" }</code></dd>
+ * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7", "1.8" }</code></dd>
* <dt>Default:</dt><dd><code>"1.3"</code></dd>
* </dl>
* @since 2.0
* @category CompilerOptionID
+ * @see #COMPILER_COMPLIANCE
+ * @see #COMPILER_CODEGEN_TARGET_PLATFORM
+ * @see #setComplianceOptions(String, Map)
*/
public static final String COMPILER_SOURCE = PLUGIN_ID + ".compiler.source"; //$NON-NLS-1$
/**
* Compiler option ID: Setting Compliance Level.
- * <p>Select the compliance level for the compiler. In <code>"1.3"</code> mode, source and target settings
- * should not go beyond <code>"1.3"</code> level.</p>
+ * <p>Select the compliance level for the compiler.
+ * {@link #COMPILER_SOURCE} and {@link #COMPILER_CODEGEN_TARGET_PLATFORM} settings cannot be
+ * higher than the compiler compliance level. In <code>"1.5"</code> and higher compliance, source and target settings
+ * should match the compliance setting.</p>
* <dl>
* <dt>Option id:</dt><dd><code>"org.aspectj.org.eclipse.jdt.core.compiler.compliance"</code></dd>
- * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7" }</code></dd>
+ * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7", "1.8" }</code></dd>
* <dt>Default:</dt><dd><code>"1.4"</code></dd>
* </dl>
* @since 2.0
* @category CompilerOptionID
+ * @see #COMPILER_SOURCE
+ * @see #COMPILER_CODEGEN_TARGET_PLATFORM
+ * @see #setComplianceOptions(String, Map)
*/
public static final String COMPILER_COMPLIANCE = PLUGIN_ID + ".compiler.compliance"; //$NON-NLS-1$
/**
@@ -2268,6 +2289,19 @@
public static final String TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC = PLUGIN_ID + ".timeoutForParameterNameFromAttachedJavadoc"; //$NON-NLS-1$
/**
+ * Core option ID: The ID of the formatter to use in formatting operations.
+ * <dl>
+ * <dt>Option id:</dt><dd><code>"org.aspectj.org.eclipse.jdt.core.javaFormatter"</code></dd>
+ * <dt>Default:</dt><dd><code>"org.aspectj.org.eclipse.jdt.core.defaultJavaFormatter"</code></dd>
+ * </dl>
+ * @see #DEFAULT_JAVA_FORMATTER
+ * @see #JAVA_FORMATTER_EXTENSION_POINT_ID
+ * @since 3.11
+ * @category CoreOptionID
+ */
+ public static final String JAVA_FORMATTER = PLUGIN_ID + ".javaFormatter"; //$NON-NLS-1$
+
+ /**
* @since 2.0
* @deprecated Use {@link org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION},
* {@link org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_BLOCK} ,
@@ -2824,6 +2858,23 @@
public static final String JAVA_SOURCE_CONTENT_TYPE = JavaCore.PLUGIN_ID+".javaSource" ; //$NON-NLS-1$
/**
+ * The ID of the Eclipse built-in formatter.
+ *
+ * @see #JAVA_FORMATTER
+ * @see #JAVA_FORMATTER_EXTENSION_POINT_ID
+ * @since 3.11
+ */
+ public static final String DEFAULT_JAVA_FORMATTER = PLUGIN_ID + ".defaultJavaFormatter"; //$NON-NLS-1$
+
+ /**
+ * Name of the extension point for contributing a source code formatter
+ * @see #JAVA_FORMATTER
+ * @see #DEFAULT_JAVA_FORMATTER
+ * @since 3.11
+ */
+ public static final String JAVA_FORMATTER_EXTENSION_POINT_ID = "javaFormatter" ; //$NON-NLS-1$
+
+ /**
* Creates the Java core plug-in.
* <p>
* The plug-in instance is created automatically by the
@@ -5543,7 +5594,7 @@
*
* <p>If the given compliance is unknown, the given map is unmodified.</p>
*
- * @param compliance the given compliance
+ * @param compliance the given {@link #COMPILER_COMPLIANCE compliance}
* @param options the given options map
* @since 3.3
*/
@@ -5630,6 +5681,7 @@
*/
public void stop(BundleContext context) throws Exception {
try {
+ JavaModelManager.unregisterDebugOptionsListener();
JavaModelManager.getJavaModelManager().shutdown();
} finally {
// ensure we call super.stop as the last thing
@@ -5648,6 +5700,7 @@
*/
public void start(BundleContext context) throws Exception {
super.start(context);
+ JavaModelManager.registerDebugOptionsListener(context);
JavaModelManager.getJavaModelManager().startup();
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/Signature.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/Signature.java
index 45a096d..1f5fdcc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/Signature.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/Signature.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,8 @@
* Contributors:
* IBM Corporation - initial API and implementation
* IBM Corporation - added J2SE 1.5 support
+ * Stephan Herrmann - Contribution for
+ * Bug 463533 - Signature.getSignatureSimpleName() returns different results for resolved and unresolved extends
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core;
@@ -1884,12 +1886,21 @@
}
if(dotCount > 0) {
+ int typeStart = 0;
for(int i = 0; i < qualifiedType.length; i++) {
- if(qualifiedType[i] == '.') {
- dotCount--;
+ switch (qualifiedType[i]) {
+ case '.':
+ dotCount--;
+ break;
+ case ' ':
+ typeStart = i+1;
+ break;
}
if(dotCount <= 0) {
- return CharOperation.subarray(qualifiedType, i + 1, qualifiedType.length);
+ char[] simpleName = CharOperation.subarray(qualifiedType, i + 1, qualifiedType.length);
+ if (typeStart > 0 && typeStart < qualifiedType.length)
+ return CharOperation.concat(CharOperation.subarray(qualifiedType, 0, typeStart), simpleName);
+ return simpleName;
}
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ToolFactory.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ToolFactory.java
index 97d1faf..8506e43 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ToolFactory.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/ToolFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,19 +7,18 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Harry Terkelsen (het@google.com) - Bug 449262 - Allow the use of third-party Java formatters
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
import org.aspectj.org.eclipse.jdt.core.compiler.IScanner;
import org.aspectj.org.eclipse.jdt.core.compiler.ITerminalSymbols;
import org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter;
@@ -40,6 +39,14 @@
import org.aspectj.org.eclipse.jdt.internal.core.util.PublicScanner;
import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatter;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
/**
* Factory for creating various compiler tools, such as scanners, parsers and compilers.
* <p>
@@ -95,7 +102,7 @@
Plugin jdtCorePlugin = JavaCore.getPlugin();
if (jdtCorePlugin == null) return null;
- IExtensionPoint extension = jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.FORMATTER_EXTPOINT_ID);
+ IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(JavaCore.PLUGIN_ID, JavaModelManager.FORMATTER_EXTPOINT_ID);
if (extension != null) {
IExtension[] extensions = extension.getExtensions();
for(int i = 0; i < extensions.length; i++){
@@ -140,7 +147,10 @@
}
/**
- * Create an instance of the built-in code formatter.
+ * Creates an instance of a code formatter. A code formatter implementation can be contributed via the extension
+ * point "org.aspectj.org.eclipse.jdt.core.javaFormatter". The formatter id specified in the
+ * "org.aspectj.org.eclipse.jdt.core.javaFormatter" is instantiated. If unable to find a registered extension, the factory will
+ * default to using the default code formatter.
* <p>The given options should at least provide the source level ({@link JavaCore#COMPILER_SOURCE}),
* the compiler compliance level ({@link JavaCore#COMPILER_COMPLIANCE}) and the target platform
* ({@link JavaCore#COMPILER_CODEGEN_TARGET_PLATFORM}).
@@ -170,6 +180,35 @@
currentOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
currentOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
}
+ String formatterId = (String) options.get(JavaCore.JAVA_FORMATTER);
+ if (formatterId != null) {
+ IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(JavaCore.PLUGIN_ID,
+ JavaCore.JAVA_FORMATTER_EXTENSION_POINT_ID);
+ if (extension != null) {
+ IExtension[] extensions = extension.getExtensions();
+ for (int i = 0; i < extensions.length; i++) {
+ IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
+ for (int j = 0; j < configElements.length; j++) {
+ String initializerID = configElements[j].getAttribute("id"); //$NON-NLS-1$
+ if (initializerID != null && initializerID.equals(formatterId)) {
+ try {
+ Object execExt = configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
+ if (execExt instanceof CodeFormatter) {
+ CodeFormatter formatter = (CodeFormatter) execExt;
+ formatter.setOptions(currentOptions);
+ return formatter;
+ }
+ } catch (CoreException e) {
+ org.aspectj.org.eclipse.jdt.internal.core.util.Util.log(e.getStatus());
+ break;
+ }
+ }
+ }
+ }
+ }
+ org.aspectj.org.eclipse.jdt.internal.core.util.Util.log(IStatus.WARNING,
+ "Unable to instantiate formatter extension '" + formatterId + "', returning built-in formatter."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
return new DefaultCodeFormatter(currentOptions);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.java
index 22d9ae8..8e565ef 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/CharOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,6 +70,44 @@
}
/**
+ * Answers a new array with appending the sub-array at the end of the array.
+ * <br>
+ * <br>
+ * For example:<br>
+ * <ol>
+ * <li><pre>
+ * array = { 'a', 'b' }
+ * suffix = { 'c', 'd' }
+ * => result = { 'a', 'b' , 'c' , d' }
+ * </pre>
+ * </li>
+ * <li><pre>
+ * array = null
+ * suffix = { 'c' }
+ * => result = { 'c' }
+ * </pre></li>
+ * </ol>
+ *
+ * @param target the array that is concatenated with the suffix array.
+ * @param suffix the array that will be concatenated to the target
+ * @return the new array
+ * @throws NullPointerException if the target array is null
+ * @since 3.11
+ */
+public static final char[] append(char[] target, char[] suffix) {
+ if(suffix == null || suffix.length == 0)
+ return target;
+ int targetLength = target.length;
+ int subLength = suffix.length;
+ int newTargetLength = targetLength + subLength;
+ if (newTargetLength > targetLength) {
+ System.arraycopy(target, 0, target = new char[newTargetLength], 0, targetLength);
+ }
+ System.arraycopy(suffix, 0, target, targetLength, subLength);
+ return target;
+}
+
+/**
* Append the given sub-array to the target array starting at the given index in the target array.
* The start of the sub-array is inclusive, the end is exclusive.
* Answers a new target array if it needs to grow, otherwise answers the same target array.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.java
index 1a1f6f7..28ad592 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/compiler/IProblem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -194,6 +194,8 @@
* NullityMismatchAgainstFreeTypeVariable
* ImplicitObjectBoundNoNullDefault
* IllegalParameterNullityRedefinition
+ * ContradictoryNullAnnotationsInferredFunctionType
+ * IllegalReturnNullityRedefinitionFreeTypeVariable
* Jesper S Moller - added the following constants
* TargetTypeNotAFunctionalInterface
* OuterLocalMustBeEffectivelyFinal
@@ -1318,6 +1320,8 @@
/** @since 3.9 */
int UnsafeElementTypeConversion = TypeRelated + 585;
+ /** @since 3.11 */
+ int InvalidTypeArguments = MethodRelated + TypeRelated + 586;
/**
* 1.5 Syntax errors (when source level < 1.5)
@@ -1822,6 +1826,10 @@
int ImplicitObjectBoundNoNullDefault = 971;
/** @since 3.11 */
int IllegalParameterNullityRedefinition = MethodRelated + 972;
+ /** @since 3.11 */
+ int ContradictoryNullAnnotationsInferredFunctionType = MethodRelated + 973;
+ /** @since 3.11 */
+ int IllegalReturnNullityRedefinitionFreeTypeVariable = MethodRelated + 974;
// Java 8 work
@@ -1860,6 +1868,7 @@
/** @since 3.10 */
int GenericInferenceError = 1100; // FIXME: This is just a stop-gap measure, be more specific via https://bugs.eclipse.org/404675
- /** @since 3.10 */
+ /** @deprecated - problem is no longer generated (implementation issue has been resolved)
+ * @since 3.10 */
int LambdaShapeComputationError = 1101;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.java
index bf42ae4..98f44f5 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTConverter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -643,7 +643,7 @@
start = retrieveStartBlockPosition(methodHeaderEnd, methodDeclaration.bodyStart);
if (start == -1) start = methodDeclaration.bodyStart; // use recovery position for body start
- end = retrieveRightBrace(methodDeclaration.bodyEnd, declarationSourceEnd);
+ end = retrieveRightBrace(methodDeclaration.bodyEnd + 1, declarationSourceEnd);
Block block = null;
if (start != -1 && end != -1) {
/*
@@ -1592,7 +1592,7 @@
if (anonymousType != null) {
AnonymousClassDeclaration anonymousClassDeclaration = new AnonymousClassDeclaration(this.ast);
int start = retrieveStartBlockPosition(anonymousType.sourceEnd, anonymousType.bodyEnd);
- int end = retrieveRightBrace(anonymousType.bodyEnd, declarationSourceEnd);
+ int end = retrieveRightBrace(anonymousType.bodyEnd +1, declarationSourceEnd);
if (end == -1) end = anonymousType.bodyEnd;
anonymousClassDeclaration.setSourceRange(start, end - start + 1);
enumConstantDeclaration.setAnonymousClassDeclaration(anonymousClassDeclaration);
@@ -3457,11 +3457,11 @@
List dimensions = arrayType.dimensions();
Type elementType = arrayType.getElementType();
int start = elementType.getStartPosition();
- int endElement = start + elementType.getLength();
+ int endElement = start + elementType.getLength() - 1;
int end = retrieveProperRightBracketPosition(dimensions.size(), endElement);
arrayType.setSourceRange(start, end - start + 1);
- start = endElement;
+ start = endElement + 1;
for (int i = 0; i < dimensions.size(); i++) {
Dimension currentDimension = (Dimension) dimensions.get(i);
setTypeAnnotationsOnDimension(currentDimension, annotationsOnDimensions, i);
@@ -4641,6 +4641,8 @@
return -1;
}
+
+ // Aspectj keeping this for now, we use it.
/**
* This method is used to retrieve the end position of the block.
* @return int the dimension found, -1 if none
@@ -4904,7 +4906,7 @@
return hasTokens ? Integer.MIN_VALUE : pos;
}
- protected int retrieveProperRightBracketPosition(int bracketNumber, int start) {
+ protected int retrieveProperRightBracketPosition(int bracketNumber, int start, int end) {
this.scanner.resetTo(start, this.compilationUnitSourceLength);
try {
int token, count = 0, lParentCount = 0, balance = 0;
@@ -4938,6 +4940,10 @@
return -1;
}
+ protected int retrieveProperRightBracketPosition(int bracketNumber, int start) {
+ return retrieveProperRightBracketPosition(bracketNumber, start, this.compilationUnitSourceLength);
+ }
+
/**
* This method is used to retrieve position before the next right brace or semi-colon.
* @return int the position found.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.java
index 6ff4721..ff9adac 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ASTParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2014 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 458577 - IClassFile.getWorkingCopy() may lead to NPE in BecomeWorkingCopyOperation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -30,6 +32,7 @@
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.Main;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveryScanner;
@@ -1145,6 +1148,10 @@
NodeSearcher searcher = null;
org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = null;
WorkingCopyOwner wcOwner = this.workingCopyOwner;
+ if (this.typeRoot instanceof ClassFileWorkingCopy) {
+ // special case: class file mimics as compilation unit, but that would use a wrong file name below, so better unwrap now:
+ this.typeRoot = ((ClassFileWorkingCopy) this.typeRoot).classFile;
+ }
if (this.typeRoot instanceof ICompilationUnit) {
/*
* this.compilationUnitSource is an instance of org.aspectj.org.eclipse.jdt.internal.core.CompilationUnit that implements
@@ -1394,6 +1401,10 @@
compilationUnit.setLineEndTable(recordedParsingInformation.lineEnds);
Block block = ast.newBlock();
block.setSourceRange(this.sourceOffset, this.sourceOffset + this.sourceLength);
+ ExplicitConstructorCall constructorCall = constructorDeclaration.constructorCall;
+ if (constructorCall != null && constructorCall.accessMode != org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall.ImplicitSuper) {
+ block.statements().add(converter.convert(constructorCall));
+ }
org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement[] statements = constructorDeclaration.statements;
if (statements != null) {
int statementsLength = statements.length;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.java
index 2d44a6e..26cab40 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/BindingComparator.java
@@ -232,7 +232,7 @@
}
CaptureBinding captureBinding = (CaptureBinding) typeBinding;
CaptureBinding captureBinding2 = (CaptureBinding) typeBinding2;
- if (captureBinding.position == captureBinding2.position) {
+ if (captureBinding.end == captureBinding2.end) {
if (visitedTypes.contains(typeBinding)) return true;
visitedTypes.add(typeBinding);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.java
index 6698518..949207a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CharacterLiteral.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
+import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
/**
* Character literal nodes.
@@ -316,58 +317,7 @@
StringBuffer b = new StringBuffer(3);
b.append('\''); // opening delimiter
- switch(value) {
- case '\b' :
- b.append("\\b"); //$NON-NLS-1$
- break;
- case '\t' :
- b.append("\\t"); //$NON-NLS-1$
- break;
- case '\n' :
- b.append("\\n"); //$NON-NLS-1$
- break;
- case '\f' :
- b.append("\\f"); //$NON-NLS-1$
- break;
- case '\r' :
- b.append("\\r"); //$NON-NLS-1$
- break;
- case '\"':
- b.append("\\\""); //$NON-NLS-1$
- break;
- case '\'':
- b.append("\\\'"); //$NON-NLS-1$
- break;
- case '\\':
- b.append("\\\\"); //$NON-NLS-1$
- break;
- case '\0' :
- b.append("\\0"); //$NON-NLS-1$
- break;
- case '\1' :
- b.append("\\1"); //$NON-NLS-1$
- break;
- case '\2' :
- b.append("\\2"); //$NON-NLS-1$
- break;
- case '\3' :
- b.append("\\3"); //$NON-NLS-1$
- break;
- case '\4' :
- b.append("\\4"); //$NON-NLS-1$
- break;
- case '\5' :
- b.append("\\5"); //$NON-NLS-1$
- break;
- case '\6' :
- b.append("\\6"); //$NON-NLS-1$
- break;
- case '\7' :
- b.append("\\7"); //$NON-NLS-1$
- break;
- default:
- b.append(value);
- }
+ Util.appendEscapedChar(b, value, false);
b.append('\''); // closing delimiter
setEscapedValue(b.toString());
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.java
index 049a2e6..390c648 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/CompilationUnitResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contribution for bug 363858 - [dom] early throwing of AbortCompilation causes NPE in CompilationUnitResolver
+ * Stephan Herrmann - Contribution for
+ * bug 363858 - [dom] early throwing of AbortCompilation causes NPE in CompilationUnitResolver
+ * Bug 466279 - [hovering] IAE on hover when annotation-based null analysis is enabled
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -58,6 +60,7 @@
import org.aspectj.org.eclipse.jdt.internal.core.CancelableProblemFactory;
import org.aspectj.org.eclipse.jdt.internal.core.INameEnvironmentWithProgress;
import org.aspectj.org.eclipse.jdt.internal.core.JavaProject;
+import org.aspectj.org.eclipse.jdt.internal.core.LocalVariable;
import org.aspectj.org.eclipse.jdt.internal.core.NameLookup;
import org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement;
import org.aspectj.org.eclipse.jdt.internal.core.SourceTypeElementInfo;
@@ -763,9 +766,17 @@
}
intList.add(i);
} else {
- // binary member
+ // binary member or method argument
try {
- String key = ((BinaryMember) element).getKey(true/*open to get resolved info*/);
+ String key;
+ if (element instanceof BinaryMember)
+ key = ((BinaryMember) element).getKey(true/*open to get resolved info*/);
+ else if (element instanceof LocalVariable)
+ key = ((LocalVariable) element).getKey(true/*open to get resolved info*/);
+ else if (element instanceof org.aspectj.org.eclipse.jdt.internal.core.TypeParameter)
+ key = ((org.aspectj.org.eclipse.jdt.internal.core.TypeParameter) element).getKey(true/*open to get resolved info*/);
+ else
+ throw new IllegalArgumentException(element + " has an unexpected type"); //$NON-NLS-1$
binaryElementPositions.put(key, i);
} catch (JavaModelException e) {
throw new IllegalArgumentException(element + " does not exist"); //$NON-NLS-1$
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
index 7e8fa09..3ecf8a2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/DefaultBindingResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contribution for Bug 342671 - ClassCastException: org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding cannot be cast to org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding
+ * Stephan Herrmann - Contribution for
+ * Bug 342671 - ClassCastException: org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding cannot be cast to org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -23,6 +25,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ImportReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.JavadocAllocationExpression;
@@ -54,6 +57,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemFieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
@@ -92,14 +96,21 @@
*/
Map bindingKeysToBindings;
/**
- * This map is used to keep the correspondance between new bindings and the
- * compiler bindings as well as new annotation instances to their internal counterpart.
- * This is an identity map. We should only create one object for one binding or annotation.
+ * This map is used to keep the correspondence between new bindings and the
+ * compiler bindings to their internal counterpart.
+ * This is an identity map. We should only create one object for one binding.
*/
Map compilerBindingsToASTBindings;
+ /**
+ * This map is used to keep the correspondence between new annotation instances to their internal counterpart.
+ * This is an identity map. We should only create one object for one annotation.
+ */
+ Map compilerAnnotationBindingsToASTBindings;
+
BindingTables() {
this.compilerBindingsToASTBindings = new ConcurrentHashMap();
+ this.compilerAnnotationBindingsToASTBindings = new ConcurrentHashMap();
this.bindingKeysToBindings = new ConcurrentHashMap();
}
@@ -242,6 +253,13 @@
* Method declared on BindingResolver.
*/
synchronized IMethodBinding getMethodBinding(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding) {
+ return getMethodOrLambdaBinding(methodBinding, null, null);
+ }
+
+ private synchronized IMethodBinding getMethodOrLambdaBinding(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding,
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding descriptor,
+ IBinding enclosingBinding)
+ {
if (methodBinding != null && !methodBinding.isValidBinding()) {
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding problemMethodBinding =
(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding) methodBinding;
@@ -256,7 +274,11 @@
if (binding != null) {
return binding;
}
- binding = new MethodBinding(this, methodBinding);
+ if (descriptor != null && enclosingBinding != null) {
+ binding = new MethodBinding.LambdaMethod(this, descriptor, methodBinding, enclosingBinding);
+ } else {
+ binding = new MethodBinding(this, methodBinding);
+ }
this.bindingTables.compilerBindingsToASTBindings.put(methodBinding, binding);
return binding;
}
@@ -349,6 +371,11 @@
* Method declared on BindingResolver.
*/
synchronized ITypeBinding getTypeBinding(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding referenceBinding) {
+ return internalGetTypeBinding(referenceBinding, null);
+ }
+
+ private synchronized ITypeBinding internalGetTypeBinding(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding referenceBinding, IBinding declaringMember) {
+ // may also create an TypeBinding.AnonymousTypeBinding
if (referenceBinding == null) {
return null;
} else if (!referenceBinding.isValidBinding()) {
@@ -362,7 +389,7 @@
if (binding != null) {
return binding;
}
- binding = new TypeBinding(this, binding2);
+ binding = TypeBinding.createTypeBinding(this, binding2, declaringMember);
this.bindingTables.compilerBindingsToASTBindings.put(binding2, binding);
return binding;
}
@@ -376,7 +403,7 @@
return binding;
}
if ((referenceBinding.tagBits & TagBits.HasMissingType) != 0) {
- binding = new TypeBinding(this, referenceBinding);
+ binding = TypeBinding.createTypeBinding(this, referenceBinding, declaringMember);
} else {
binding = new RecoveredTypeBinding(this, referenceBinding);
}
@@ -392,7 +419,7 @@
if (binding != null) {
return binding;
}
- binding = new TypeBinding(this, referenceBinding);
+ binding = TypeBinding.createTypeBinding(this, referenceBinding, declaringMember);
this.bindingTables.compilerBindingsToASTBindings.put(referenceBinding, binding);
return binding;
}
@@ -506,6 +533,21 @@
return null;
}
+ class AnnotationIdentityBinding {
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding internalInstance;
+ AnnotationIdentityBinding(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding internalInstance) {
+ this.internalInstance = internalInstance;
+ }
+ @Override
+ public boolean equals(Object o) {
+ return o instanceof AnnotationIdentityBinding && this.internalInstance == ((AnnotationIdentityBinding)o).internalInstance;
+ }
+ @Override
+ public int hashCode() {
+ return this.internalInstance.hashCode();
+ }
+ }
+
synchronized IAnnotationBinding getAnnotationInstance(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding internalInstance) {
if (internalInstance == null) return null;
ReferenceBinding annotationType = internalInstance.getAnnotationType();
@@ -514,12 +556,13 @@
return null;
}
}
+ Object key = new AnnotationIdentityBinding(internalInstance);
IAnnotationBinding domInstance =
- (IAnnotationBinding) this.bindingTables.compilerBindingsToASTBindings.get(internalInstance);
+ (IAnnotationBinding) this.bindingTables.compilerAnnotationBindingsToASTBindings.get(key);
if (domInstance != null)
return domInstance;
domInstance = new AnnotationBinding(internalInstance, this);
- this.bindingTables.compilerBindingsToASTBindings.put(internalInstance, domInstance);
+ this.bindingTables.compilerAnnotationBindingsToASTBindings.put(key, domInstance);
return domInstance;
}
@@ -882,7 +925,12 @@
Object oldNode = this.newAstToOldAst.get(lambda);
if (oldNode instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression) {
org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression lambdaExpression = (org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression) oldNode;
- IMethodBinding methodBinding = getMethodBinding(lambdaExpression.getMethodBinding());
+ IMethodBinding methodBinding = null;
+ if (lambdaExpression.descriptor != null) {
+ IBinding declaringMember = getDeclaringMember(lambdaExpression, lambdaExpression.enclosingScope);
+ if (declaringMember != null)
+ methodBinding = getMethodOrLambdaBinding(lambdaExpression.getMethodBinding(), lambdaExpression.descriptor, declaringMember);
+ }
if (methodBinding == null) {
return null;
}
@@ -895,6 +943,48 @@
}
return null;
}
+
+ private IBinding getDeclaringMember(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode node, Scope currentScope) {
+ MethodScope methodScope = currentScope != null ? currentScope.methodScope() : null;
+ if (methodScope != null) {
+ if (methodScope.isInsideInitializer()) {
+ org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration enclosingType = methodScope.referenceType();
+ if (enclosingType.fields != null) {
+ for (int i = 0; i < enclosingType.fields.length; i++) {
+ FieldDeclaration field = enclosingType.fields[i];
+ if (field.declarationSourceStart <= node.sourceStart && node.sourceEnd <= field.declarationSourceEnd) {
+ if (field instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.Initializer)
+ return getMethodBinding(((org.aspectj.org.eclipse.jdt.internal.compiler.ast.Initializer) field).getMethodBinding());
+ else
+ return getVariableBinding(field.binding);
+ }
+ }
+ }
+ } else {
+ if (methodScope.isLambdaScope()) {
+ org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression lambdaExpression = (org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression) methodScope.referenceContext;
+ IMethodBinding methodBinding = null;
+ if (lambdaExpression.descriptor != null) {
+ IBinding declaringMember = getDeclaringMember(lambdaExpression, lambdaExpression.enclosingScope);
+ if (declaringMember != null)
+ methodBinding = getMethodOrLambdaBinding(lambdaExpression.getMethodBinding(), lambdaExpression.descriptor, declaringMember);
+ }
+ if (methodBinding == null) {
+ return null;
+ }
+ String key = methodBinding.getKey();
+ if (key != null) {
+ this.bindingTables.bindingKeysToBindings.put(key, methodBinding);
+ }
+ return methodBinding;
+ } else {
+ return getMethodBinding(methodScope.referenceMethodBinding());
+ }
+ }
+ }
+ return null;
+ }
+
/*
* Method declared on BindingResolver.
*/
@@ -933,15 +1023,12 @@
Object oldNode = this.newAstToOldAst.get(methodReference);
if (oldNode instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression) {
org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression referenceExpression = (org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression) oldNode;
+ if (referenceExpression.receiverType != null && referenceExpression.receiverType.isArrayType())
+ return null;
IMethodBinding methodBinding = getMethodBinding(referenceExpression.getMethodBinding());
if (methodBinding == null) {
return null;
}
- this.bindingsToAstNodes.put(methodBinding, methodReference);
- String key = methodBinding.getKey();
- if (key != null) {
- this.bindingTables.bindingKeysToBindings.put(key, methodBinding);
- }
return methodBinding;
}
return null;
@@ -1548,7 +1635,8 @@
org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(type);
if (node != null && (node.bits & org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode.IsAnonymousType) != 0) {
org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration anonymousLocalTypeDeclaration = (org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) node;
- ITypeBinding typeBinding = this.getTypeBinding(anonymousLocalTypeDeclaration.binding);
+ IBinding declaringMember = getDeclaringMember(anonymousLocalTypeDeclaration, anonymousLocalTypeDeclaration.scope);
+ ITypeBinding typeBinding = internalGetTypeBinding(anonymousLocalTypeDeclaration.binding, declaringMember);
if (typeBinding == null) {
return null;
}
@@ -1709,7 +1797,8 @@
final Object node = this.newAstToOldAst.get(type);
if (node instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) {
org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration = (org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) node;
- ITypeBinding typeBinding = this.getTypeBinding(typeDeclaration.binding);
+ IBinding declaringMember = getDeclaringMember(typeDeclaration, typeDeclaration.scope);
+ ITypeBinding typeBinding = internalGetTypeBinding(typeDeclaration.binding, declaringMember);
if (typeBinding == null) {
return null;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.java
index 2b47a5f..6d2afd8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IDocElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,11 +12,22 @@
package org.aspectj.org.eclipse.jdt.core.dom;
/**
- * Internal marker-type interface used to tag node types that can legitimately
- * be included in {@link TagElement#fragments() TagElement.fragments()}.
- *
- * @since 3.0
+ * Common marker interface for AST nodes that represent fragments in doc elements.
+ * These are node types that can legitimately be included in {@link TagElement#fragments()}.
+ * <pre>
+ * IDocElement:
+ * {@link MemberRef}
+ * {@link MethodRef}
+ * {@link Name}
+ * {@link TagElement}
+ * {@link TextElement}
+ * </pre>
+ *
+ * @since 3.11, internal interface since 3.0
+ * @see TagElement#fragments()
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
*/
-interface IDocElement {
+public interface IDocElement {
// marker-type interfaces have no members
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.java
index 1886c6e..894961f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IExtendedModifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,11 +14,13 @@
* Common interface for AST nodes that represent modifiers or
* annotations.
* <pre>
- * ExtendedModifier:
+ * IExtendedModifier:
* Modifier
* Annotation
* </pre>
* @since 3.1
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
*/
public interface IExtendedModifier {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.java
index 5488e68..1092c89 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/IMethodBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -86,6 +88,31 @@
public ITypeBinding getDeclaringClass();
/**
+ * If this method binding represents a lambda expression then:
+ * <ul>
+ * <li>If the lambda expression is declared in the body of a method,
+ * answers the binding of that declaring method.
+ * </li>
+ * <li>Otherwise, if the lambda expression is declared in the
+ * initializer of a field, answers the binding of that declaring field.
+ * </li>
+ * <li>Otherwise, if the lambda expression is declared in a static initializer or an
+ * instance initializer, a method binding is returned to represent that initializer
+ * (selector is an empty string in this case).
+ * </li>
+ * </ul>
+ * <p>
+ * If this method binding does not represent a lambda expression,
+ * <code>null</code> is returned.
+ * </p>
+ * @return a method binding or field binding representing the member that
+ * contains the lambda expression represented by this method binding,
+ * or null for regular method bindings.
+ * @since 3.11
+ */
+ public IBinding getDeclaringMember();
+
+ /**
* Returns the resolved default value of an annotation type member,
* or <code>null</code> if the member has no default value, or if this
* is not the binding for an annotation type member.
@@ -292,6 +319,8 @@
* <li>For references to a signature polymorphic method from class MethodHandle,
* returns the declaration of the method. In the reference binding, the parameter types and
* the return type are determined by the concrete invocation context.</li>
+ * <li>For lambda methods, returns the (possibly parameterized) single abstract method
+ * of the functional type.</li>
* <li>For other method bindings, this returns the same binding.</li>
* </ul>
*
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.java
index cda59da..1d2df8f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/ITypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -251,6 +253,30 @@
public IMethodBinding getDeclaringMethod();
/**
+ * If this type binding represents a local type, possibly an anonymous class, then:
+ * <ul>
+ * <li>If the local type is declared in the body of a method,
+ * answers the binding of that declaring method.
+ * </li>
+ * <li>Otherwise, if the local type (an anonymous class in this case) is declared
+ * in the initializer of a field, answers the binding of that declaring field.
+ * </li>
+ * <li>Otherwise, if the local type is declared in a static initializer or
+ * an instance initializer, a method binding is returned to represent that initializer
+ * (selector is an empty string in this case).
+ * </li>
+ * </ul>
+ * <p>
+ * If this type binding does not represent a local type, <code>null</code> is returned.
+ * </p>
+ * @return a method binding or field binding representing the member that
+ * contains the local type represented by this type binding,
+ * or null for non-local type bindings.
+ * @since 3.11
+ */
+ public IBinding getDeclaringMember();
+
+ /**
* Returns the dimensionality of this array type, or <code>0</code> if this
* is not an array type binding.
*
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.java
index d0e0b8d..8d5710c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/MethodBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,12 +7,15 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
import org.aspectj.org.eclipse.jdt.core.IJavaElement;
import org.aspectj.org.eclipse.jdt.core.JavaCore;
+import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
@@ -34,8 +37,8 @@
Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL | Modifier.SYNCHRONIZED | Modifier.NATIVE |
Modifier.STRICTFP | Modifier.DEFAULT;
private static final ITypeBinding[] NO_TYPE_BINDINGS = new ITypeBinding[0];
- private org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding;
- private BindingResolver resolver;
+ protected org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding;
+ protected BindingResolver resolver;
private ITypeBinding[] parameterTypes;
private ITypeBinding[] exceptionTypes;
private String name;
@@ -114,6 +117,11 @@
return this.declaringClass;
}
+ @Override
+ public IBinding getDeclaringMember() {
+ return null;
+ }
+
public IAnnotationBinding[] getParameterAnnotations(int index) {
if (getParameterTypes() == NO_TYPE_BINDINGS) {
return AnnotationBinding.NoAnnotations;
@@ -463,4 +471,69 @@
public String toString() {
return this.binding.toString();
}
+
+ /*
+ * Method binding representing a lambda expression.
+ * Most properties are read from the SAM descriptor,
+ * but key, parameter types, and annotations are taken from the lambda implementation.
+ * Additionally we store the declaring member (see #getDeclaringMember()).
+ */
+ static class LambdaMethod extends MethodBinding {
+
+ private MethodBinding implementation;
+ private IBinding declaringMember;
+
+ public LambdaMethod(DefaultBindingResolver resolver,
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding lambdaDescriptor,
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding implementation,
+ IBinding declaringMember)
+ {
+ super(resolver, lambdaDescriptor);
+ this.implementation = new MethodBinding(resolver, implementation);
+ this.declaringMember = declaringMember;
+ }
+
+ /**
+ * @see IBinding#getModifiers()
+ */
+ public int getModifiers() {
+ return super.getModifiers() & ~ClassFileConstants.AccAbstract;
+ }
+
+ /**
+ * @see IBinding#getKey()
+ */
+ public String getKey() {
+ return this.implementation.getKey();
+ }
+
+ @Override
+ public ITypeBinding[] getParameterTypes() {
+ return this.implementation.getParameterTypes();
+ }
+
+ @Override
+ public IAnnotationBinding[] getParameterAnnotations(int paramIndex) {
+ return this.implementation.getParameterAnnotations(paramIndex);
+ }
+
+ public IAnnotationBinding[] getAnnotations() {
+ return this.implementation.getAnnotations();
+ }
+
+ @Override
+ public IBinding getDeclaringMember() {
+ return this.declaringMember;
+ }
+
+ @Override
+ public IMethodBinding getMethodDeclaration() {
+ return this.resolver.getMethodBinding(this.binding);
+ }
+
+ @Override
+ public String toString() {
+ return super.toString().replace("public abstract ", "public "); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java
index 7797180..1826003 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,11 +7,15 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440687 - [compiler][batch][null] improve command line option for external annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathDirectory;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
@@ -26,7 +30,7 @@
IProgressMonitor monitor;
public NameEnvironmentWithProgress(Classpath[] paths, String[] initialFileNames, IProgressMonitor monitor) {
- super(paths, initialFileNames);
+ super(paths, initialFileNames, false);
setMonitor(monitor);
}
private void checkCanceled() {
@@ -39,8 +43,29 @@
}
public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
checkCanceled();
- return super.findType(typeName, packageName);
+ NameEnvironmentAnswer answer = super.findType(typeName, packageName);
+ if (answer == null) {
+ NameEnvironmentAnswer suggestedAnswer = null;
+ String qualifiedPackageName = new String(CharOperation.concatWith(packageName, '/'));
+ String qualifiedTypeName = new String(CharOperation.concatWith(packageName, typeName, '/'));
+ String qualifiedBinaryFileName = qualifiedTypeName + SUFFIX_STRING_class;
+ for (int i = 0, length = this.classpaths.length; i < length; i++) {
+ if (!(this.classpaths[i] instanceof ClasspathDirectory)) continue;
+ ClasspathDirectory classpathDirectory = (ClasspathDirectory) this.classpaths[i];
+ answer = classpathDirectory.findSecondaryInClass(typeName, qualifiedPackageName, qualifiedBinaryFileName);
+ if (answer != null) {
+ if (!answer.ignoreIfBetter()) {
+ if (answer.isBetter(suggestedAnswer))
+ return answer;
+ } else if (answer.isBetter(suggestedAnswer))
+ // remember suggestion and keep looking
+ suggestedAnswer = answer;
+ }
+ }
+ }
+ return answer;
}
+
public NameEnvironmentAnswer findType(char[][] compoundName) {
checkCanceled();
return super.findType(compoundName);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
index 99c7891..4be0a03 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2014 IBM Corporation and others.
+ * Copyright (c) 2007, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -155,6 +157,14 @@
}
/* (non-Javadoc)
+ * @see org.aspectj.org.eclipse.jdt.core.dom.ITypeBinding#getDeclaringMember()
+ */
+ @Override
+ public IBinding getDeclaringMember() {
+ return null;
+ }
+
+ /* (non-Javadoc)
* @see org.aspectj.org.eclipse.jdt.core.dom.ITypeBinding#getDimensions()
*/
public int getDimensions() {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.java
index 8c98a39..e516ba2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/StringLiteral.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@
import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
+import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
/**
* String literal nodes.
@@ -273,55 +274,7 @@
b.append("\""); // opening delimiter //$NON-NLS-1$
for (int i = 0; i < len; i++) {
char c = value.charAt(i);
- switch(c) {
- case '\b' :
- b.append("\\b"); //$NON-NLS-1$
- break;
- case '\t' :
- b.append("\\t"); //$NON-NLS-1$
- break;
- case '\n' :
- b.append("\\n"); //$NON-NLS-1$
- break;
- case '\f' :
- b.append("\\f"); //$NON-NLS-1$
- break;
- case '\r' :
- b.append("\\r"); //$NON-NLS-1$
- break;
- case '\"':
- b.append("\\\""); //$NON-NLS-1$
- break;
- case '\\':
- b.append("\\\\"); //$NON-NLS-1$
- break;
- case '\0' :
- b.append("\\0"); //$NON-NLS-1$
- break;
- case '\1' :
- b.append("\\1"); //$NON-NLS-1$
- break;
- case '\2' :
- b.append("\\2"); //$NON-NLS-1$
- break;
- case '\3' :
- b.append("\\3"); //$NON-NLS-1$
- break;
- case '\4' :
- b.append("\\4"); //$NON-NLS-1$
- break;
- case '\5' :
- b.append("\\5"); //$NON-NLS-1$
- break;
- case '\6' :
- b.append("\\6"); //$NON-NLS-1$
- break;
- case '\7' :
- b.append("\\7"); //$NON-NLS-1$
- break;
- default:
- b.append(c);
- }
+ Util.appendEscapedChar(b, c, true);
}
b.append("\""); // closing delimiter //$NON-NLS-1$
setEscapedValue(b.toString());
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.java
index 1455ca8..67de874 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/SwitchStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,7 +20,7 @@
* <pre>
* SwitchStatement:
* <b>switch</b> <b>(</b> Expression <b>)</b>
- * <b>{</b> { SwitchCase | Statement } } <b>}</b>
+ * <b>{</b> { SwitchCase | Statement } <b>}</b>
* SwitchCase:
* <b>case</b> Expression <b>:</b>
* <b>default</b> <b>:</b>
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.java
index c4c2f6a..a37f1c0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/TypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -24,8 +25,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CaptureBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionCastTypeBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionTypeBinding18;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
@@ -60,7 +60,7 @@
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding binding;
private TypeBinding prototype = null;
private String key;
- private BindingResolver resolver;
+ protected BindingResolver resolver;
private IVariableBinding[] fields;
private IAnnotationBinding[] annotations;
private IAnnotationBinding[] typeAnnotations;
@@ -71,6 +71,18 @@
private ITypeBinding[] bounds;
private ITypeBinding[] typeParameters;
+ /**
+ * Create either a regular TypeBinding or an AnonymousTypeBinding (if declaringMember is given).
+ */
+ public static TypeBinding createTypeBinding(BindingResolver resolver,
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding referenceBinding,
+ IBinding declaringMember)
+ {
+ return declaringMember != null
+ ? new LocalTypeBinding(resolver, referenceBinding, declaringMember)
+ : new TypeBinding(resolver, referenceBinding);
+ }
+
public TypeBinding(BindingResolver resolver, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding binding) {
this.binding = binding;
this.resolver = resolver;
@@ -369,8 +381,8 @@
* @see ITypeBinding#getDeclaringMethod()
*/
public synchronized IMethodBinding getDeclaringMethod() {
- if (this.binding instanceof LocalTypeBinding) {
- LocalTypeBinding localTypeBinding = (LocalTypeBinding) this.binding;
+ if (this.binding instanceof org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding) {
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding localTypeBinding = (org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding) this.binding;
MethodBinding methodBinding = localTypeBinding.enclosingMethod;
if (methodBinding != null) {
try {
@@ -440,6 +452,11 @@
return null;
}
+ @Override
+ public IBinding getDeclaringMember() {
+ return null;
+ }
+
/*
* @see ITypeBinding#getDimensions()
*/
@@ -468,7 +485,7 @@
public ITypeBinding getTypeDeclaration() {
if (this.binding instanceof ParameterizedTypeBinding)
return this.resolver.getTypeBinding(((ParameterizedTypeBinding)this.binding).genericType());
- return this.resolver.getTypeBinding(this.binding.unannotated(false));
+ return this.resolver.getTypeBinding(this.binding.unannotated());
}
/* (non-Javadoc)
@@ -685,9 +702,9 @@
buffer.append(brackets);
return String.valueOf(buffer);
- case Binding.INTERSECTION_CAST_TYPE :
- // just use the first bound for now (same kludge as in IntersectionCastTypeBinding#constantPoolName())
- return new String(((IntersectionCastTypeBinding) this.binding).getIntersectingTypes()[0].sourceName());
+ case Binding.INTERSECTION_TYPE18 :
+ // just use the first bound for now (same kludge as in IntersectionTypeBinding18#constantPoolName())
+ return new String(((IntersectionTypeBinding18) this.binding).getIntersectingTypes()[0].sourceName());
default :
if (isPrimitive() || isNullType()) {
@@ -711,7 +728,7 @@
case Binding.TYPE_PARAMETER : // includes capture scenario
case Binding.WILDCARD_TYPE :
case Binding.INTERSECTION_TYPE:
- case Binding.INTERSECTION_CAST_TYPE:
+ case Binding.INTERSECTION_TYPE18:
return null;
}
ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
@@ -808,7 +825,7 @@
}
return String.valueOf(buffer);
default :
- if (isAnonymous() || this.binding.isLocalType() || this.binding.isIntersectionCastType()) {
+ if (isAnonymous() || this.binding.isLocalType() || this.binding.isIntersectionType18()) {
return NO_NAME;
}
if (isPrimitive() || isNullType()) {
@@ -1075,7 +1092,7 @@
if (!(type instanceof TypeBinding)) return false;
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding expressionType = ((TypeBinding) type).binding;
// simulate capture in case checked binding did not properly get extracted from a reference
- expressionType = expressionType.capture(scope, 0);
+ expressionType = expressionType.capture(scope, 0, 0);
return TypeBinding.EXPRESSION.checkCastTypesCompatibility(scope, this.binding, expressionType, null);
} catch (AbortCompilation e) {
// don't surface internal exception to clients
@@ -1132,7 +1149,7 @@
return false;
}
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding otherBinding = ((TypeBinding) other).binding;
- if (org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding.equalsEquals(otherBinding.unannotated(false), this.binding.unannotated(false))) {
+ if (org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding.equalsEquals(otherBinding.unannotated(), this.binding.unannotated())) {
return true;
}
// check return type
@@ -1345,4 +1362,22 @@
this.typeAnnotations = resolveAnnotationBindings(this.binding.getTypeAnnotations(), true);
return this.typeAnnotations;
}
+
+ static class LocalTypeBinding extends TypeBinding {
+
+ private IBinding declaringMember;
+
+ public LocalTypeBinding(BindingResolver resolver,
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding binding,
+ IBinding declaringMember)
+ {
+ super(resolver, binding);
+ this.declaringMember = declaringMember;
+ }
+
+ @Override
+ public IBinding getDeclaringMember() {
+ return this.declaringMember;
+ }
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.java
index a3372fc..3f28188 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/VariableBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
+ * Bug 466308 - [hovering] Javadoc header for parameter is wrong with annotation-based null analysis
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom;
@@ -14,13 +17,10 @@
import org.aspectj.org.eclipse.jdt.core.IJavaElement;
import org.aspectj.org.eclipse.jdt.core.JavaCore;
import org.aspectj.org.eclipse.jdt.core.util.IModifierConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Initializer;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
@@ -133,16 +133,9 @@
if (node == null) {
if (this.binding instanceof LocalVariableBinding) {
LocalVariableBinding localVariableBinding = (LocalVariableBinding) this.binding;
- BlockScope blockScope = localVariableBinding.declaringScope;
- if (blockScope != null) {
- ReferenceContext referenceContext = blockScope.referenceContext();
- if (referenceContext instanceof Initializer) {
- return null;
- }
- if (referenceContext instanceof AbstractMethodDeclaration) {
- return this.resolver.getMethodBinding(((AbstractMethodDeclaration) referenceContext).binding);
- }
- }
+ org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding enclosingMethod = localVariableBinding.getEnclosingMethod();
+ if (enclosingMethod != null)
+ return this.resolver.getMethodBinding(enclosingMethod);
}
return null;
}
@@ -152,6 +145,9 @@
case ASTNode.METHOD_DECLARATION :
MethodDeclaration methodDeclaration = (MethodDeclaration) node;
return methodDeclaration.resolveBinding();
+ case ASTNode.LAMBDA_EXPRESSION :
+ LambdaExpression lambdaExpression = (LambdaExpression) node;
+ return lambdaExpression.resolveMethodBinding();
default:
node = node.getParent();
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java
index 74bc38e..38b71f0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2013 IBM Corporation and others.
+ * Copyright (c) 2004, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -51,7 +51,7 @@
* translates these descriptions into text edits that can then be applied to
* the original source. The key thing is that this is all done without actually
* modifying the original AST, which has the virtue of allowing one to entertain
- * several alternate sets of changes on the same AST (e.g., for calculating
+ * several alternate sets of changes on the same AST (e.g., for calculating multiple
* quick fix proposals). The rewrite infrastructure tries to generate minimal
* text changes, preserve existing comments and indentation, and follow code
* formatter settings.
@@ -85,11 +85,16 @@
* // are new source range for "class X {}" in document.get()
* </pre>
* <p>
- * If you are sure never have to explore multiple alternate changes and you never need
+ * If you are sure you never have to explore multiple alternate changes and you never need
* to create {@link #createCopyTarget(ASTNode) copies} or {@link #createStringPlaceholder(String, int) string placeholders},
* then you can also try {@link CompilationUnit#recordModifications()} instead.
* </p>
* <p>
+ * <code>ASTRewrite</code> cannot rewrite (non-Javadoc) comments from
+ * {@link CompilationUnit#getCommentList()}, since those comment nodes
+ * are not part of the normal node hierarchy.
+ * </p>
+ * <p>
* This class is not intended to be subclassed.
* </p>
* @since 3.0
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java
index 72b898a..de63804 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,14 +7,18 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.dom.rewrite;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -23,13 +27,49 @@
import org.aspectj.org.eclipse.jdt.core.Flags;
import org.aspectj.org.eclipse.jdt.core.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.core.IImportDeclaration;
+import org.aspectj.org.eclipse.jdt.core.IType;
import org.aspectj.org.eclipse.jdt.core.ITypeRoot;
import org.aspectj.org.eclipse.jdt.core.JavaCore;
import org.aspectj.org.eclipse.jdt.core.JavaModelException;
import org.aspectj.org.eclipse.jdt.core.Signature;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
-import org.aspectj.org.eclipse.jdt.core.dom.*;
-import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.ImportRewriteAnalyzer;
+import org.aspectj.org.eclipse.jdt.core.dom.AST;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTParser;
+import org.aspectj.org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.AnnotatableType;
+import org.aspectj.org.eclipse.jdt.core.dom.Annotation;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayInitializer;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayType;
+import org.aspectj.org.eclipse.jdt.core.dom.CharacterLiteral;
+import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.dom.Dimension;
+import org.aspectj.org.eclipse.jdt.core.dom.Expression;
+import org.aspectj.org.eclipse.jdt.core.dom.FieldAccess;
+import org.aspectj.org.eclipse.jdt.core.dom.IAnnotationBinding;
+import org.aspectj.org.eclipse.jdt.core.dom.IBinding;
+import org.aspectj.org.eclipse.jdt.core.dom.IMemberValuePairBinding;
+import org.aspectj.org.eclipse.jdt.core.dom.IMethodBinding;
+import org.aspectj.org.eclipse.jdt.core.dom.ITypeBinding;
+import org.aspectj.org.eclipse.jdt.core.dom.IVariableBinding;
+import org.aspectj.org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.MarkerAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.MemberValuePair;
+import org.aspectj.org.eclipse.jdt.core.dom.Modifier;
+import org.aspectj.org.eclipse.jdt.core.dom.Name;
+import org.aspectj.org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.ParameterizedType;
+import org.aspectj.org.eclipse.jdt.core.dom.PrimitiveType;
+import org.aspectj.org.eclipse.jdt.core.dom.SimpleName;
+import org.aspectj.org.eclipse.jdt.core.dom.SimpleType;
+import org.aspectj.org.eclipse.jdt.core.dom.SingleMemberAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.StringLiteral;
+import org.aspectj.org.eclipse.jdt.core.dom.Type;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeLiteral;
+import org.aspectj.org.eclipse.jdt.core.dom.WildcardType;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports.ImportRewriteConfiguration;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports.ImportRewriteAnalyzer;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports.ImportRewriteConfiguration.ImplicitImportIdentification;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports.ImportRewriteConfiguration.ImportContainerSorting;
import org.aspectj.org.eclipse.jdt.internal.core.util.Messages;
import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
import org.eclipse.text.edits.MultiTextEdit;
@@ -89,6 +129,14 @@
public final static int RES_NAME_CONFLICT= 3;
/**
+ * Result constant signaling that the given element must be imported explicitly (and must not be folded into
+ * an on-demand import or filtered as an implicit import).
+ *
+ * @since 3.11
+ */
+ public final static int RES_NAME_UNKNOWN_NEEDS_EXPLICIT_IMPORT= 4;
+
+ /**
* Kind constant specifying that the element is a type import.
*/
public final static int KIND_TYPE= 1;
@@ -105,14 +153,17 @@
/**
* Searches for the given element in the context and reports if the element is known ({@link #RES_NAME_FOUND}),
- * unknown ({@link #RES_NAME_UNKNOWN}) or if its name conflicts ({@link #RES_NAME_CONFLICT}) with an other element.
+ * unknown ({@link #RES_NAME_UNKNOWN}), unknown in the context but known to require an explicit import
+ * ({@link #RES_NAME_UNKNOWN_NEEDS_EXPLICIT_IMPORT}), or if its name conflicts ({@link #RES_NAME_CONFLICT})
+ * with an other element.
+ *
* @param qualifier The qualifier of the element, can be package or the qualified name of a type
* @param name The simple name of the element; either a type, method or field name or * for on-demand imports.
* @param kind The kind of the element. Can be either {@link #KIND_TYPE}, {@link #KIND_STATIC_FIELD} or
* {@link #KIND_STATIC_METHOD}. Implementors should be prepared for new, currently unspecified kinds and return
* {@link #RES_NAME_UNKNOWN} by default.
- * @return Returns the result of the lookup. Can be either {@link #RES_NAME_FOUND}, {@link #RES_NAME_UNKNOWN} or
- * {@link #RES_NAME_CONFLICT}.
+ * @return Returns the result of the lookup. Can be either {@link #RES_NAME_FOUND}, {@link #RES_NAME_UNKNOWN},
+ * {@link #RES_NAME_CONFLICT}, or {@link #RES_NAME_UNKNOWN_NEEDS_EXPLICIT_IMPORT}.
*/
public abstract int findInContext(String qualifier, String name, int kind);
}
@@ -133,8 +184,20 @@
private int importOnDemandThreshold;
private int staticImportOnDemandThreshold;
- private List addedImports;
- private List removedImports;
+ private List<String> addedImports;
+ private List<String> removedImports;
+
+ /**
+ * Simple names of non-static imports which must not be reduced into on-demand imports
+ * or filtered out as implicit.
+ */
+ private Set<String> typeExplicitSimpleNames;
+
+ /**
+ * Simple names of static imports which must not be reduced into on-demand imports
+ * or filtered out as implicit.
+ */
+ private Set<String> staticExplicitSimpleNames;
private String[] createdImports;
private String[] createdStaticImports;
@@ -233,8 +296,10 @@
return findInImports(qualifier, name, kind);
}
};
- this.addedImports= null; // Initialized on use
- this.removedImports= null; // Initialized on use
+ this.addedImports= new ArrayList<String>();
+ this.removedImports= new ArrayList<String>();
+ this.typeExplicitSimpleNames = new HashSet<String>();
+ this.staticExplicitSimpleNames = new HashSet<String>();
this.createdImports= null;
this.createdStaticImports= null;
@@ -397,15 +462,49 @@
}
}
}
- if (this.filterImplicitImports && this.useContextToFilterImplicitImports) {
- String fPackageName= this.compilationUnit.getParent().getElementName();
- String mainTypeSimpleName= JavaCore.removeJavaLikeExtension(this.compilationUnit.getElementName());
- String fMainTypeName= Util.concatenateName(fPackageName, mainTypeSimpleName, '.');
- if (kind == ImportRewriteContext.KIND_TYPE
- && (qualifier.equals(fPackageName)
- || fMainTypeName.equals(Util.concatenateName(qualifier, name, '.'))))
- return ImportRewriteContext.RES_NAME_FOUND;
+
+ String packageName= this.compilationUnit.getParent().getElementName();
+ if (kind == ImportRewriteContext.KIND_TYPE) {
+ if (this.filterImplicitImports && this.useContextToFilterImplicitImports) {
+ String mainTypeSimpleName= JavaCore.removeJavaLikeExtension(this.compilationUnit.getElementName());
+ String mainTypeName= Util.concatenateName(packageName, mainTypeSimpleName, '.');
+ if (qualifier.equals(packageName)
+ || mainTypeName.equals(Util.concatenateName(qualifier, name, '.'))) {
+ return ImportRewriteContext.RES_NAME_FOUND;
+ }
+
+ if (this.astRoot != null) {
+ List<AbstractTypeDeclaration> types = this.astRoot.types();
+ int nTypes = types.size();
+ for (int i = 0; i < nTypes; i++) {
+ AbstractTypeDeclaration type = types.get(i);
+ SimpleName simpleName = type.getName();
+ if (simpleName.getIdentifier().equals(name)) {
+ return qualifier.equals(packageName)
+ ? ImportRewriteContext.RES_NAME_FOUND
+ : ImportRewriteContext.RES_NAME_CONFLICT;
+ }
+ }
+ } else {
+ try {
+ IType[] types = this.compilationUnit.getTypes();
+ int nTypes = types.length;
+ for (int i = 0; i < nTypes; i++) {
+ IType type = types[i];
+ String typeName = type.getElementName();
+ if (typeName.equals(name)) {
+ return qualifier.equals(packageName)
+ ? ImportRewriteContext.RES_NAME_FOUND
+ : ImportRewriteContext.RES_NAME_CONFLICT;
+ }
+ }
+ } catch (JavaModelException e) {
+ // don't want to throw an exception here
+ }
+ }
+ }
}
+
return ImportRewriteContext.RES_NAME_UNKNOWN;
}
@@ -917,6 +1016,10 @@
if (res == ImportRewriteContext.RES_NAME_UNKNOWN) {
addEntry(STATIC_PREFIX + key);
}
+ if (res == ImportRewriteContext.RES_NAME_UNKNOWN_NEEDS_EXPLICIT_IMPORT) {
+ addEntry(STATIC_PREFIX + key);
+ this.staticExplicitSimpleNames.add(simpleName);
+ }
return simpleName;
}
@@ -945,35 +1048,31 @@
if (res == ImportRewriteContext.RES_NAME_UNKNOWN) {
addEntry(NORMAL_PREFIX + fullTypeName);
}
+ if (res == ImportRewriteContext.RES_NAME_UNKNOWN_NEEDS_EXPLICIT_IMPORT) {
+ addEntry(NORMAL_PREFIX + fullTypeName);
+ this.typeExplicitSimpleNames.add(typeName);
+ }
return typeName;
}
private void addEntry(String entry) {
this.existingImports.add(entry);
- if (this.removedImports != null) {
- if (this.removedImports.remove(entry)) {
- return;
- }
+ if (this.removedImports.remove(entry)) {
+ return;
}
- if (this.addedImports == null) {
- this.addedImports= new ArrayList();
- }
this.addedImports.add(entry);
}
private boolean removeEntry(String entry) {
if (this.existingImports.remove(entry)) {
- if (this.addedImports != null) {
- if (this.addedImports.remove(entry)) {
- return true;
- }
+ if (this.addedImports.remove(entry)) {
+ return true;
}
- if (this.removedImports == null) {
- this.removedImports= new ArrayList();
- }
+
this.removedImports.add(entry);
+
return true;
}
return false;
@@ -1051,40 +1150,66 @@
usedAstRoot= (CompilationUnit) parser.createAST(new SubProgressMonitor(monitor, 1));
}
+ ImportRewriteConfiguration config= buildImportRewriteConfiguration();
+
ImportRewriteAnalyzer computer=
- new ImportRewriteAnalyzer(
- this.compilationUnit,
- usedAstRoot,
- this.importOrder,
- this.importOnDemandThreshold,
- this.staticImportOnDemandThreshold,
- this.restoreExistingImports,
- this.useContextToFilterImplicitImports);
- computer.setFilterImplicitImports(this.filterImplicitImports);
+ new ImportRewriteAnalyzer(this.compilationUnit, usedAstRoot, config);
- if (this.addedImports != null) {
- for (int i= 0; i < this.addedImports.size(); i++) {
- String curr= (String) this.addedImports.get(i);
- computer.addImport(curr.substring(1), STATIC_PREFIX == curr.charAt(0), usedAstRoot, this.restoreExistingImports);
- }
+ for (String addedImport : this.addedImports) {
+ boolean isStatic = STATIC_PREFIX == addedImport.charAt(0);
+ String qualifiedName = addedImport.substring(1);
+ computer.addImport(isStatic, qualifiedName);
}
- if (this.removedImports != null) {
- for (int i= 0; i < this.removedImports.size(); i++) {
- String curr= (String) this.removedImports.get(i);
- computer.removeImport(curr.substring(1), STATIC_PREFIX == curr.charAt(0));
- }
+ for (String removedImport : this.removedImports) {
+ boolean isStatic = STATIC_PREFIX == removedImport.charAt(0);
+ String qualifiedName = removedImport.substring(1);
+ computer.removeImport(isStatic, qualifiedName);
}
- TextEdit result= computer.getResultingEdits(new SubProgressMonitor(monitor, 1));
- this.createdImports= computer.getCreatedImports();
- this.createdStaticImports= computer.getCreatedStaticImports();
- return result;
+ for (String typeExplicitSimpleName : this.typeExplicitSimpleNames) {
+ computer.requireExplicitImport(false, typeExplicitSimpleName);
+ }
+
+ for (String staticExplicitSimpleName : this.staticExplicitSimpleNames) {
+ computer.requireExplicitImport(true, staticExplicitSimpleName);
+ }
+
+ ImportRewriteAnalyzer.RewriteResult result= computer.analyzeRewrite(new SubProgressMonitor(monitor, 1));
+
+ this.createdImports= result.getCreatedImports();
+ this.createdStaticImports= result.getCreatedStaticImports();
+
+ return result.getTextEdit();
} finally {
monitor.done();
}
}
+ private ImportRewriteConfiguration buildImportRewriteConfiguration() {
+ ImportRewriteConfiguration.Builder configBuilder;
+
+ if (this.restoreExistingImports) {
+ configBuilder= ImportRewriteConfiguration.Builder.preservingOriginalImports();
+ } else {
+ configBuilder= ImportRewriteConfiguration.Builder.discardingOriginalImports();
+ }
+
+ configBuilder.setImportOrder(Arrays.asList(this.importOrder));
+ configBuilder.setTypeOnDemandThreshold(this.importOnDemandThreshold);
+ configBuilder.setStaticOnDemandThreshold(this.staticImportOnDemandThreshold);
+
+ configBuilder.setTypeContainerSorting(this.useContextToFilterImplicitImports ?
+ ImportContainerSorting.BY_PACKAGE : ImportContainerSorting.BY_PACKAGE_AND_CONTAINING_TYPE);
+
+ configBuilder.setStaticContainerSorting(ImportContainerSorting.BY_PACKAGE_AND_CONTAINING_TYPE);
+
+ configBuilder.setImplicitImportIdentification(this.filterImplicitImports ?
+ ImplicitImportIdentification.JAVA_LANG_AND_CU_PACKAGE : ImplicitImportIdentification.NONE);
+
+ return configBuilder.build();
+ }
+
/**
* Returns all new non-static imports created by the last invocation of {@link #rewriteImports(IProgressMonitor)}
* or <code>null</code> if these methods have not been called yet.
@@ -1152,24 +1277,23 @@
* @return boolean returns if any changes to imports have been recorded.
*/
public boolean hasRecordedChanges() {
- return !this.restoreExistingImports ||
- (this.addedImports != null && !this.addedImports.isEmpty()) ||
- (this.removedImports != null && !this.removedImports.isEmpty());
+ return !this.restoreExistingImports
+ || !this.addedImports.isEmpty()
+ || !this.removedImports.isEmpty();
}
- private static String[] filterFromList(List imports, char prefix) {
+ private static String[] filterFromList(List<String> imports, char prefix) {
if (imports == null) {
return CharOperation.NO_STRINGS;
}
- ArrayList res= new ArrayList();
- for (int i= 0; i < imports.size(); i++) {
- String curr= (String) imports.get(i);
+ List<String> res= new ArrayList<String>();
+ for (String curr : imports) {
if (prefix == curr.charAt(0)) {
res.add(curr.substring(1));
}
}
- return (String[]) res.toArray(new String[res.size()]);
+ return res.toArray(new String[res.size()]);
}
private void annotateList(List annotations, IAnnotationBinding [] annotationBindings, AST ast, ImportRewriteContext context) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.java
index 1cb5145..355b172 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/CodeFormatter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Harry Terkelsen (het@google.com) - Bug 449262 - Allow the use of third-party Java formatters
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.formatter;
@@ -14,11 +15,12 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.text.edits.TextEdit;
+import java.util.Map;
+
/**
* Specification for a generic source code formatter.
*
* @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
*/
public abstract class CodeFormatter {
@@ -282,4 +284,15 @@
public String createIndentationString(int indentationLevel) {
return Util.EMPTY_STRING;
}
+
+ /**
+ * Sets the formatting options for this formatter.
+ * <p>The default implementation ignores the options.
+ *
+ * @param options the options for the formatter
+ * @since 3.11
+ */
+ public void setOptions(Map<String, String> options) {
+ // Do nothing by default
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
index 7881724..d299643 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
* Brock Janiczak - Contribution for bug 150741
* Ray V. (voidstar@gmail.com) - Contribution for bug 282988
* Jesper S Moller - Contribution for bug 402173
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.core.formatter;
@@ -18,7 +19,7 @@
import org.aspectj.org.eclipse.jdt.core.JavaCore;
import org.aspectj.org.eclipse.jdt.core.ToolFactory;
import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions;
-import org.aspectj.org.eclipse.jdt.internal.formatter.align.Alignment;
+import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions.Alignment;
/**
* Constants used to set up the options of the code formatter.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java
new file mode 100644
index 0000000..cfb071a
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/core/util/ExternalAnnotationUtil.java
@@ -0,0 +1,692 @@
+/*******************************************************************************
+ * Copyright (c) 2015 GK Software AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Stephan Herrmann - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.core.util;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.aspectj.org.eclipse.jdt.core.IClasspathEntry;
+import org.aspectj.org.eclipse.jdt.core.IJavaElement;
+import org.aspectj.org.eclipse.jdt.core.IJavaProject;
+import org.aspectj.org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.aspectj.org.eclipse.jdt.core.IType;
+import org.aspectj.org.eclipse.jdt.core.JavaCore;
+import org.aspectj.org.eclipse.jdt.core.dom.IMethodBinding;
+import org.aspectj.org.eclipse.jdt.core.dom.ITypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ExternalAnnotationProvider;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SignatureWrapper;
+import org.aspectj.org.eclipse.jdt.internal.core.ClasspathEntry;
+import org.aspectj.org.eclipse.jdt.internal.core.util.KeyToSignature;
+
+/**
+ * Utilities for accessing and manipulating text files that externally define annotations for a given Java type.
+ * Files are assumed to be in ".eea format", a textual representation of annotated signatures of members of a given type.
+ *
+ * @since 3.11
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public final class ExternalAnnotationUtil {
+
+ /** Representation of a 'nullable' annotation, independent of the concrete annotation name used in Java sources. */
+ public static final char NULLABLE = ExternalAnnotationProvider.NULLABLE;
+
+ /** Representation of a 'nonnull' annotation, independent of the concrete annotation name used in Java sources. */
+ public static final char NONNULL = ExternalAnnotationProvider.NONNULL;
+
+ /**
+ * Represents absence of a null annotation. Useful for removing an existing null annotation.
+ * This character is used only internally, it is not part of the Eclipse External Annotation file format.
+ */
+ public static final char NO_ANNOTATION = ExternalAnnotationProvider.NO_ANNOTATION;
+
+ /** Strategy for merging a new signature with an existing (possibly annotated) signature. */
+ public static enum MergeStrategy {
+ /** Unconditionally replace the signature. */
+ REPLACE_SIGNATURE,
+ /** Override existing annotations, keeping old annotations in locations that are not annotated in the new signature. */
+ OVERWRITE_ANNOTATIONS,
+ /** Only add new annotations, never remove or overwrite existing annotations. */
+ ADD_ANNOTATIONS
+ }
+
+ private static final int POSITION_RETURN_TYPE = -1;
+ private static final int POSITION_FULL_SIGNATURE = -2;
+
+ /**
+ * Answer the give method's signature in class file format.
+ * @param methodBinding binding representing a method
+ * @return a signature in class file format
+ */
+ public static String extractGenericSignature(IMethodBinding methodBinding) {
+ // Note that IMethodBinding.binding is not accessible, hence we need to recover the signature from the key:
+ KeyToSignature parser = new KeyToSignature(methodBinding.getKey(), KeyToSignature.SIGNATURE, true);
+ parser.parse();
+ return parser.toString();
+ }
+
+ /**
+ * Answer the given types's signature in class file format.
+ * @param type binding representing a type
+ * @return a signature in class file format
+ */
+ public static String extractGenericTypeSignature(ITypeBinding type) {
+ KeyToSignature parser = new KeyToSignature(type.getKey(), KeyToSignature.SIGNATURE, true);
+ parser.parse();
+ return parser.toString();
+ }
+
+ /**
+ * Insert an encoded annotation into the given methodSignature affecting its return type.
+ * <p>
+ * This method is suitable for declaration annotations.
+ * </p>
+ * @param methodSignature a method signature in class file format
+ * @param annotation one of {@link #NULLABLE} and {@link #NONNULL}.
+ * @param mergeStrategy when passing {@link MergeStrategy#ADD_ANNOTATIONS} this method will
+ * refuse to overwrite any existing annotation in the specified location
+ * @return the modified method signature, or the original signature if modification would
+ * conflict with the given merge strategy.
+ * @throws IllegalArgumentException if the method signature is malformed or its return type is not a reference type.
+ */
+ public static String insertReturnAnnotation(String methodSignature, char annotation, MergeStrategy mergeStrategy) {
+ int close = methodSignature.indexOf(')');
+ if (close == -1 || close > methodSignature.length()-4)
+ throw new IllegalArgumentException("Malformed method signature"); //$NON-NLS-1$
+ switch (methodSignature.charAt(close+1)) {
+ case 'L': case 'T': case '[':
+ return insertAt(methodSignature, close+2, annotation, mergeStrategy);
+ }
+ throw new IllegalArgumentException("Return type is not a reference type"); //$NON-NLS-1$
+ }
+
+ /**
+ * Insert an encoded annotation into the given methodSignature affecting one of its parameters.
+ * <p>
+ * This method is suitable for declaration annotations.
+ * </p>
+ * @param methodSignature a method signature in class file format
+ * @param paramIdx 0-based index of the parameter to which the annotation should be attached
+ * @param annotation one of {@link #NULLABLE} and {@link #NONNULL}.
+ * @param mergeStrategy when passing {@link MergeStrategy#ADD_ANNOTATIONS} this method will
+ * refuse to overwrite any existing annotation in the specified location
+ * @return the modified method signature, or the original signature if modification would
+ * conflict with the given merge strategy.
+ * @throws IllegalArgumentException if the method signature is malformed or its specified parameter type is not a reference type.
+ */
+ public static String insertParameterAnnotation(String methodSignature, int paramIdx, char annotation, MergeStrategy mergeStrategy)
+ {
+ SignatureWrapper wrapper = new SignatureWrapper(methodSignature.toCharArray());
+ wrapper.start = 1;
+ for (int i = 0; i < paramIdx; i++)
+ wrapper.start = wrapper.computeEnd() + 1;
+ int start = wrapper.start;
+ switch (methodSignature.charAt(start)) {
+ case 'L': case 'T': case '[':
+ return insertAt(methodSignature, start+1, annotation, mergeStrategy);
+ }
+ throw new IllegalArgumentException("Paramter type is not a reference type"); //$NON-NLS-1$
+ }
+
+ /**
+ * Answer the external annotation file corresponding to the given type as seen from the given project.
+ * Note that manipulation of external annotations is only supported for annotation files in the workspace,
+ * and only in directory layout, not from zip files.
+ * @param project current project that references the given type from a jar file.
+ * @param type the type for which external annotations are sought
+ * @param monitor progress monitor to be passed through into file operations
+ * @return a file assumed (but not checked) to be in .eea format. The file may not "exist".
+ * Can be null if the given type is not contained in a jar file for which an external annotation path
+ * has been defined in the context of the given project.
+ * @throws CoreException Signals a problem in accessing any of the relevant elements: the project, the type,
+ * the containing jar file and finally the sought annotation file.
+ */
+ public static IFile getAnnotationFile(IJavaProject project, ITypeBinding type, IProgressMonitor monitor) throws CoreException {
+
+ IType targetType = project.findType(type.getErasure().getQualifiedName());
+ if (!targetType.exists())
+ return null;
+
+ String binaryTypeName = targetType.getFullyQualifiedName('$').replace('.', '/');
+
+ IPackageFragmentRoot packageRoot = (IPackageFragmentRoot) targetType.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
+ IClasspathEntry entry = packageRoot.getResolvedClasspathEntry();
+ IPath annotationPath = ClasspathEntry.getExternalAnnotationPath(entry, project.getProject(), false);
+
+ if (annotationPath == null)
+ return null;
+
+ IWorkspaceRoot workspaceRoot = project.getProject().getWorkspace().getRoot();
+
+ if (annotationPath.segmentCount() > 1) {
+ IFile annotationZip = workspaceRoot.getFile(annotationPath);
+ if (annotationZip.exists())
+ return null;
+ }
+
+ annotationPath = annotationPath.append(binaryTypeName).addFileExtension(ExternalAnnotationProvider.ANNOTION_FILE_EXTENSION);
+ return workspaceRoot.getFile(annotationPath);
+ }
+
+ /**
+ * Update the given external annotation file with details regarding annotations of one specific method or field.
+ * If the specified member already has external annotations, old and new annotations will be merged,
+ * with priorities controlled by the parameter 'mergeStrategy'.
+ * <p>
+ * This method is suitable for declaration annotations and type use annotations.
+ * </p>
+ * @param typeName binary name (slash separated) of the type being annotated
+ * @param file a file assumed to be in .eea format, will be created if it doesn't exist.
+ * @param selector selector of the method or field
+ * @param originalSignature unannotated signature of the member, used for identification
+ * @param annotatedSignature new signatures whose annotations should be superimposed on the member
+ * @param mergeStrategy controls how old and new signatures should be merged
+ * @param monitor progress monitor to be passed through into file operations, or null if no reporting is desired
+ * @throws CoreException if access to the file fails
+ * @throws IOException if reading file content fails
+ */
+ public static void annotateMember(String typeName, IFile file, String selector, String originalSignature, String annotatedSignature,
+ MergeStrategy mergeStrategy, IProgressMonitor monitor)
+ throws CoreException, IOException
+ {
+ annotateMember(typeName, file, selector, originalSignature, annotatedSignature, POSITION_FULL_SIGNATURE, mergeStrategy, monitor);
+ }
+
+ /**
+ * Update the given external annotation file with details regarding annotations of the return type of a given method.
+ * If the specified method already has external annotations, old and new annotations will be merged,
+ * with priorities controlled by the parameter 'mergeStrategy'.
+ * <p>
+ * This method is suitable for declaration annotations and type use annotations.
+ * </p>
+ * @param typeName binary name (slash separated) of the type being annotated
+ * @param file a file assumed to be in .eea format, will be created if it doesn't exist.
+ * @param selector selector of the method
+ * @param originalSignature unannotated signature of the member, used for identification
+ * @param annotatedReturnType signature of the new return type whose annotations should be superimposed on the method
+ * @param mergeStrategy controls how old and new signatures should be merged
+ * @param monitor progress monitor to be passed through into file operations, or null if no reporting is desired
+ * @throws CoreException if access to the file fails
+ * @throws IOException if reading file content fails
+ * @throws IllegalArgumentException if the annotatedReturnType does not structurally match to originalSignature
+ */
+ public static void annotateMethodReturnType(String typeName, IFile file, String selector, String originalSignature,
+ String annotatedReturnType, MergeStrategy mergeStrategy, IProgressMonitor monitor)
+ throws CoreException, IOException, IllegalArgumentException
+ {
+ annotateMember(typeName, file, selector, originalSignature, annotatedReturnType, POSITION_RETURN_TYPE, mergeStrategy, monitor);
+ }
+
+ /**
+ * Update the given external annotation file with details regarding annotations of a parameter type of a given method.
+ * If the specified method already has external annotations, old and new annotations will be merged,
+ * with priorities controlled by the parameter 'mergeStrategy'.
+ * <p>
+ * This method is suitable for declaration annotations and type use annotations.
+ * </p>
+ * @param typeName binary name (slash separated) of the type being annotated
+ * @param file a file assumed to be in .eea format, will be created if it doesn't exist.
+ * @param selector selector of the method
+ * @param originalSignature unannotated signature of the member, used for identification
+ * @param annotatedParameterType signature of the new parameter type whose annotations should be superimposed on the method
+ * @param paramIdx 0-based index of the parameter to which the annotation should be attached
+ * @param mergeStrategy controls how old and new signatures should be merged
+ * @param monitor progress monitor to be passed through into file operations, or null if no reporting is desired
+ * @throws CoreException if access to the file fails
+ * @throws IOException if reading file content fails
+ * @throws IllegalArgumentException if the annotatedParameterType does not structurally match to originalSignature
+ */
+ public static void annotateMethodParameterType(String typeName, IFile file, String selector, String originalSignature,
+ String annotatedParameterType, int paramIdx, MergeStrategy mergeStrategy, IProgressMonitor monitor)
+ throws CoreException, IOException, IllegalArgumentException
+ {
+ annotateMember(typeName, file, selector, originalSignature, annotatedParameterType, paramIdx, mergeStrategy, monitor);
+ }
+
+ private static void annotateMember(String typeName, IFile file, String selector, String originalSignature, String annotatedSignature,
+ int updatePosition, MergeStrategy mergeStrategy, IProgressMonitor monitor)
+ throws CoreException, IOException, IllegalArgumentException
+ {
+
+ if (!file.exists()) {
+ // assemble full annotatedSignature (don't bother merging since no previous signature exists):
+ annotatedSignature = updateSignature(originalSignature, annotatedSignature, updatePosition, MergeStrategy.REPLACE_SIGNATURE);
+
+ StringBuffer newContent= new StringBuffer();
+ // header:
+ newContent.append(ExternalAnnotationProvider.CLASS_PREFIX);
+ newContent.append(typeName).append('\n');
+ // new entry:
+ newContent.append(selector).append('\n');
+ newContent.append(' ').append(originalSignature).append('\n');
+ newContent.append(' ').append(annotatedSignature).append('\n');
+
+ createNewFile(file, newContent.toString(), monitor);
+ } else {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()));
+ StringBuffer newContent = new StringBuffer();
+ try {
+ newContent.append(reader.readLine()).append('\n'); // skip class name
+ String line;
+ while ((line = reader.readLine()) != null) {
+ if (line.isEmpty()) {
+ newContent.append('\n');
+ continue;
+ }
+ if (!Character.isJavaIdentifierStart(line.charAt(0))) {
+ newContent.append(line).append('\n');
+ continue;
+ }
+ // compare selectors:
+ int relation = line.compareTo(selector);
+ if (relation > 0) { // past the insertion point
+ break;
+ }
+ if (relation < 0) {
+ newContent.append(line).append('\n');
+ continue;
+ }
+ if (relation == 0) {
+ StringBuffer pending = new StringBuffer(line).append('\n');
+ pending.append(line = reader.readLine());
+ if (line == null) {
+ break; // found only the selector at EOF, append right here, ignoring 'pending'
+ }
+ // compare original signatures:
+ relation = line.trim().compareTo(originalSignature);
+ if (relation > 0) { // past the insertion point
+ // add new entry (below)
+ line = pending.toString(); // push back
+ break;
+ }
+ newContent.append(pending).append('\n');
+ if (relation < 0)
+ continue;
+ if (relation == 0) {
+ // update existing entry:
+ String annotationLine = reader.readLine();
+ String nextLine = null;
+ if (annotationLine == null || annotationLine.isEmpty() || !annotationLine.startsWith(" ")) { //$NON-NLS-1$
+ nextLine = annotationLine; // push back, since not a signature line
+ annotationLine = line; // no annotated line yet, use unannotated line instead
+ }
+ if (annotationLine.startsWith(" ")) { //$NON-NLS-1$
+ switch (mergeStrategy) {
+ case REPLACE_SIGNATURE:
+ break; // unconditionally use annotatedSignature
+ case OVERWRITE_ANNOTATIONS:
+ case ADD_ANNOTATIONS:
+ annotatedSignature = updateSignature(annotationLine.trim(), annotatedSignature, updatePosition, mergeStrategy);
+ break;
+ default:
+ JavaCore.getJavaCore().getLog().log(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID,
+ "Unexpected value for enum MergeStrategy")); //$NON-NLS-1$
+ }
+ }
+ writeFile(file, newContent, annotatedSignature, nextLine, reader, monitor);
+ return;
+ }
+ }
+ }
+ // add new entry:
+ newContent.append(selector).append('\n');
+ newContent.append(' ').append(originalSignature).append('\n');
+ annotatedSignature = updateSignature(originalSignature, annotatedSignature, updatePosition, mergeStrategy);
+ writeFile(file, newContent, annotatedSignature, line, reader, monitor);
+ } finally {
+ reader.close();
+ }
+ }
+ }
+
+ private static String updateSignature(String originalSignature, String annotatedSignature, int updatePosition, MergeStrategy mergeStrategy) {
+ StringBuffer buf = new StringBuffer();
+ String signatureToReplace;
+ String postfix = null;
+ switch (updatePosition) {
+ case POSITION_FULL_SIGNATURE:
+ signatureToReplace = originalSignature;
+ break;
+ case POSITION_RETURN_TYPE:
+ assert originalSignature.charAt(0) == '(' : "signature must start with '('"; //$NON-NLS-1$
+ int close = originalSignature.indexOf(')');
+ buf.append(originalSignature, 0, close+1);
+ signatureToReplace = originalSignature.substring(close+1);
+ break;
+ default: // parameter
+ SignatureWrapper wrapper = new SignatureWrapper(originalSignature.toCharArray(), true, true); // may already contain annotations
+ wrapper.start = 1;
+ for (int i = 0; i < updatePosition; i++)
+ wrapper.start = wrapper.computeEnd() + 1;
+ int start = wrapper.start;
+ int end = wrapper.computeEnd();
+ end = wrapper.skipAngleContents(end);
+ buf.append(originalSignature, 0, start);
+ signatureToReplace = originalSignature.substring(start, end+1);
+ postfix = originalSignature.substring(end+1, originalSignature.length());
+ }
+ updateType(buf, signatureToReplace.toCharArray(), annotatedSignature.toCharArray(), mergeStrategy);
+ if (postfix != null)
+ buf.append(postfix);
+ return buf.toString();
+ }
+
+ /**
+ * Insert that given annotation at the given position into the given signature.
+ * @param mergeStrategy if set to {@link MergeStrategy#ADD_ANNOTATIONS}, refuse to
+ * overwrite any existing annotation in the specified location.
+ */
+ private static String insertAt(String signature, int position, char annotation, MergeStrategy mergeStrategy) {
+ StringBuffer result = new StringBuffer();
+ result.append(signature, 0, position);
+ result.append(annotation);
+ char next = signature.charAt(position);
+ switch (next) {
+ case NULLABLE: case NONNULL:
+ if (mergeStrategy == MergeStrategy.ADD_ANNOTATIONS)
+ return signature; // refuse any change
+ position++; // skip old annotation
+ }
+ result.append(signature, position, signature.length());
+ return result.toString();
+ }
+
+ /**
+ * Update 'oldType' with annotations from 'newType' guided by 'mergeStrategy'.
+ * The result is written into 'buf' as we go.
+ */
+ private static boolean updateType(StringBuffer buf, char[] oldType, char[] newType, MergeStrategy mergeStrategy) {
+ if (mergeStrategy == MergeStrategy.REPLACE_SIGNATURE) {
+ buf.append(newType);
+ return false;
+ }
+ try {
+ SignatureWrapper oWrap = new SignatureWrapper(oldType, true, true); // may already contain annotations
+ SignatureWrapper nWrap = new SignatureWrapper(newType, true, true); // may already contain annotations
+ if (match(buf, oWrap, nWrap, 'L', false)
+ || match(buf, oWrap, nWrap, 'T', false))
+ {
+ mergeAnnotation(buf, oWrap, nWrap, mergeStrategy);
+ buf.append(oWrap.nextName());
+ nWrap.nextName(); // skip
+ if (match(buf, oWrap, nWrap, '<', false)) {
+ do {
+ int oStart = oWrap.start;
+ int nStart = nWrap.start;
+ oWrap.computeEnd();
+ nWrap.computeEnd();
+ if (updateType(buf, oWrap.getFrom(oStart), nWrap.getFrom(nStart), mergeStrategy))
+ mergeAnnotation(buf, oWrap, nWrap, mergeStrategy);
+ } while (!match(buf, oWrap, nWrap, '>', false));
+ }
+ match(buf, oWrap, nWrap, ';', true);
+ } else if (match(buf, oWrap, nWrap, '[', false)) {
+ mergeAnnotation(buf, oWrap, nWrap, mergeStrategy);
+ updateType(buf, oWrap.tail(), nWrap.tail(), mergeStrategy);
+ } else if (match(buf, oWrap, nWrap, '*', false)
+ || match(buf, oWrap, nWrap, '+', false)
+ || match(buf, oWrap, nWrap, '-', false))
+ {
+ return true; // annotation allowed after this (not included in oldType / newType)
+ } else {
+ buf.append(oldType);
+ }
+ } catch (ArrayIndexOutOfBoundsException aioobe) { // from several locations inside match() or mergeAnnotation().
+ StringBuilder msg = new StringBuilder("Structural mismatch between ").append(oldType).append(" and ").append(newType); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IllegalArgumentException(msg.toString(), aioobe);
+ }
+ return false;
+ }
+ /**
+ * Does the current char at both given signatures match the 'expected' char?
+ * If yes, print it into 'buf' and answer true.
+ * If no, if 'force' raise an exception, else quietly answer false without updating 'buf'.
+ */
+ private static boolean match(StringBuffer buf, SignatureWrapper sig1, SignatureWrapper sig2, char expected, boolean force) {
+ boolean match1 = sig1.signature[sig1.start] == expected;
+ boolean match2 = sig2.signature[sig2.start] == expected;
+ if (match1 != match2) {
+ StringBuilder msg = new StringBuilder("Mismatching type structures ") //$NON-NLS-1$
+ .append(sig1.signature).append(" vs ").append(sig2.signature); //$NON-NLS-1$
+ throw new IllegalArgumentException(msg.toString());
+ }
+ if (match1) {
+ buf.append(expected);
+ sig1.start++;
+ sig2.start++;
+ return true;
+ } else if (force) {
+ throw new IllegalArgumentException("Expected char "+expected+" not found in "+new String(sig1.signature)); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * If a current char of 'oldS' and/or 'newS' represents a null annotation, insert it into 'buf' guided by 'mergeStrategy'.
+ * If the new char is NO_ANNOTATION and strategy is OVERWRITE_ANNOTATIONS, silently skip over any null annotations in 'oldS'.
+ */
+ private static void mergeAnnotation(StringBuffer buf, SignatureWrapper oldS, SignatureWrapper newS, MergeStrategy mergeStrategy) {
+ // if atEnd use a char that's different from NULLABLE, NONNULL and NO_ANNOTATION:
+ char oldAnn = !oldS.atEnd() ? oldS.signature[oldS.start] : '\0';
+ char newAnn = !newS.atEnd() ? newS.signature[newS.start] : '\0';
+ switch (mergeStrategy) {
+ case ADD_ANNOTATIONS:
+ switch (oldAnn) {
+ case NULLABLE: case NONNULL:
+ oldS.start++;
+ buf.append(oldAnn); // old exists, so it remains
+ switch (newAnn) { case NULLABLE: case NONNULL: newS.start++; } // just skip
+ return;
+ }
+ //$FALL-THROUGH$
+ case OVERWRITE_ANNOTATIONS:
+ switch (newAnn) {
+ case NULLABLE: case NONNULL:
+ newS.start++;
+ buf.append(newAnn); // new exists and is not suppressed by "ADD & old exists"
+ switch (oldAnn) { case NULLABLE: case NONNULL: oldS.start++; } // just skip
+ break;
+ case NO_ANNOTATION:
+ newS.start++; // don't insert
+ switch (oldAnn) { case NULLABLE: case NONNULL: oldS.start++; } // just skip
+ break;
+ default:
+ switch (oldAnn) {
+ case NULLABLE: case NONNULL:
+ oldS.start++;
+ buf.append(oldAnn); // keep
+ }
+ }
+ break;
+ default:
+ throw new IllegalArgumentException("Unexpected merge strategy"); // REPLACE_SIGNATURE does not reach this point, see initial check in updateType() //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Write back the given annotationFile, with the following content:
+ * - head (assumed to include a member and its original signature
+ * - annotatedSignature
+ * - nextLines (optionally, may be null)
+ * - the still unconsumed content of tailReader
+ */
+ private static void writeFile(IFile annotationFile, StringBuffer head, String annotatedSignature,
+ String nextLines, BufferedReader tailReader, IProgressMonitor monitor)
+ throws CoreException, IOException
+ {
+ head.append(' ').append(annotatedSignature).append('\n');
+ if (nextLines != null)
+ head.append(nextLines).append('\n');
+ String line;
+ while ((line = tailReader.readLine()) != null)
+ head.append(line).append('\n');
+ ByteArrayInputStream newContent = new ByteArrayInputStream(head.toString().getBytes("UTF-8")); //$NON-NLS-1$
+ annotationFile.setContents(newContent, IResource.KEEP_HISTORY, monitor);
+ }
+
+ private static void createNewFile(IFile file, String newContent, IProgressMonitor monitor) throws CoreException {
+ ensureExists(file.getParent(), monitor);
+
+ try {
+ file.create(new ByteArrayInputStream(newContent.getBytes("UTF-8")), false, monitor); //$NON-NLS-1$
+ } catch (UnsupportedEncodingException e) {
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, e.getMessage(), e));
+ }
+ }
+
+ private static void ensureExists(IContainer container, IProgressMonitor monitor) throws CoreException {
+ if (container.exists()) return;
+ if (!(container instanceof IFolder)) throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, "not a folder: "+container)); //$NON-NLS-1$
+ IContainer parent= container.getParent();
+ if (parent instanceof IFolder) {
+ ensureExists(parent, monitor);
+ }
+ ((IFolder) container).create(false, true, monitor);
+ }
+
+ /**
+ * Retrieve the annotated signature of a specified member as found in the given external annotation file, if any.
+ * @param typeName fully qualified slash-separated name of the type for which the file defines external annotations
+ * @param file a file assumed to be in .eea format, must not be null, but may not exist
+ * @param selector name of the member whose annotation we are looking for
+ * @param originalSignature the unannotated signature by which the member is identified
+ * @return the annotated signature as found in the file, or null.
+ */
+ public static String getAnnotatedSignature(String typeName, IFile file, String selector, String originalSignature) {
+ if (file.exists()) {
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()))) {
+ ExternalAnnotationProvider.assertClassHeader(reader.readLine(), typeName);
+ while (true) {
+ String line = reader.readLine();
+ // selector:
+ if (selector.equals(line)) {
+ // original signature:
+ line = reader.readLine();
+ if (originalSignature.equals(ExternalAnnotationProvider.extractSignature(line))) {
+ // annotated signature:
+ return ExternalAnnotationProvider.extractSignature(reader.readLine());
+ }
+ }
+ if (line == null)
+ break;
+ }
+ } catch (IOException | CoreException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Apply the specified changes on the given type.
+ * This method can be used as a dry run without modifying an annotation file.
+ *
+ * @param originalSignature the original type signature, may be annotated already
+ * @param annotatedType a type signature with additional annotations (incl. {@link #NO_ANNOTATION}).
+ * @param mergeStrategy controls how old and new signatures should be merged
+ * @return an array of length four: <ul>
+ * <li>prefix up-to the changed type</li>
+ * <li>original type</li>
+ * <li>changed type</li>
+ * <li>postfix after the changed type <em>(here: empty string)</li>
+ * </ul>
+ */
+ public static String[] annotateType(String originalSignature, String annotatedType, MergeStrategy mergeStrategy)
+ {
+ String[] result = new String[4]; // prefix, orig, replacement, postfix
+ StringBuffer buf;
+ result[0] = ""; //$NON-NLS-1$
+ buf = new StringBuffer();
+ result[1] = originalSignature;
+ updateType(buf, originalSignature.toCharArray(), annotatedType.toCharArray(), mergeStrategy);
+ result[2] = buf.toString();
+ result[3] = ""; //$NON-NLS-1$
+ return result;
+ }
+
+ /**
+ * Apply the specified changes on the return type of the given signature.
+ * This method can be used as a dry run without modifying an annotation file.
+ *
+ * @param originalSignature the original full signature, may be annotated already
+ * @param annotatedType a type signature with additional annotations (incl. {@link #NO_ANNOTATION}).
+ * @param mergeStrategy controls how old and new signatures should be merged
+ * @return an array of length four: <ul>
+ * <li>prefix up-to the changed type</li>
+ * <li>original type</li>
+ * <li>changed type</li>
+ * <li>postfix after the changed type <em>(here: empty string)</li>
+ * </ul>
+ */
+ public static String[] annotateReturnType(String originalSignature, String annotatedType, MergeStrategy mergeStrategy)
+ {
+ String[] result = new String[4]; // prefix, orig, replacement, postfix
+ StringBuffer buf;
+ assert originalSignature.charAt(0) == '(' : "signature must start with '('"; //$NON-NLS-1$
+ int close = originalSignature.indexOf(')');
+ result[0] = originalSignature.substring(0, close+1);
+ buf = new StringBuffer();
+ result[1] = originalSignature.substring(close+1);
+ updateType(buf, result[1].toCharArray(), annotatedType.toCharArray(), mergeStrategy);
+ result[2] = buf.toString();
+ result[3] = ""; //$NON-NLS-1$
+ return result;
+ }
+
+
+ /**
+ * Apply the specified changes on a parameter within the given signature.
+ * This method can be used as a dry run without modifying an annotation file.
+ *
+ * @param originalSignature the original full signature, may be annotated already
+ * @param annotatedType a type signature with additional annotations (incl. {@link #NO_ANNOTATION}).
+ * @param paramIdx the index of a parameter to annotated
+ * @param mergeStrategy controls how old and new signatures should be merged
+ * @return an array of length four: <ul>
+ * <li>prefix up-to the changed type</li>
+ * <li>original type</li>
+ * <li>changed type</li>
+ * <li>postfix after the changed type</li>
+ * </ul>
+ */
+ public static String[] annotateParameterType(String originalSignature, String annotatedType, int paramIdx, MergeStrategy mergeStrategy)
+ {
+ String[] result = new String[4]; // prefix, orig, replacement, postfix
+ StringBuffer buf;
+ SignatureWrapper wrapper = new SignatureWrapper(originalSignature.toCharArray(), true, true); // may already contain annotations
+ wrapper.start = 1;
+ for (int i = 0; i < paramIdx; i++)
+ wrapper.start = wrapper.computeEnd() + 1;
+ int start = wrapper.start;
+ int end = wrapper.computeEnd();
+ end = wrapper.skipAngleContents(end);
+ result[0] = originalSignature.substring(0, start);
+ buf = new StringBuffer();
+ result[1] = originalSignature.substring(start, end+1);
+ updateType(buf, result[1].toCharArray(), annotatedType.toCharArray(), mergeStrategy);
+ result[2] = buf.toString();
+ result[3] = originalSignature.substring(end+1, originalSignature.length());
+ return result;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index d4eca5b..303dab0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -629,6 +629,9 @@
public boolean receiverIsImplicitThis() { return false; }
public InferenceContext18 freshInferenceContext(Scope scope) { return null; }
public ExpressionContext getExpressionContext() { return ExpressionContext.VANILLA_CONTEXT; }
+ public boolean isQualifiedSuper() { return false; }
+ public boolean checkingPotentialCompatibility() { return false; }
+ public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) {/* ignore */}
};
private int foundTypesCount;
@@ -1701,6 +1704,7 @@
buildContext(astNode, astNodeParent, compilationUnitDeclaration, qualifiedBinding, scope);
+ if (astNode instanceof CompletionOnMemberAccess && qualifiedBinding instanceof BaseTypeBinding) return true;
if (astNode instanceof CompletionOnFieldType) {
completionOnFieldType(astNode, scope);
} else if (astNode instanceof CompletionOnMethodReturnType) {
@@ -2355,7 +2359,7 @@
this.completionToken,
null,
argTypes,
- (ReferenceBinding) ((ReferenceBinding) qualifiedBinding).capture(scope, messageSend.receiver.sourceEnd),
+ (ReferenceBinding) ((ReferenceBinding) qualifiedBinding).capture(scope, messageSend.receiver.sourceStart, messageSend.receiver.sourceEnd),
scope,
new ObjectVector(),
false,
@@ -2617,7 +2621,7 @@
findFieldsAndMethods(
this.completionToken,
- ((TypeBinding) qualifiedBinding).capture(scope, access.receiver.sourceEnd),
+ ((TypeBinding) qualifiedBinding).capture(scope, access.receiver.sourceStart, access.receiver.sourceEnd),
scope,
fieldsFound,
methodsFound,
@@ -2729,7 +2733,7 @@
this.completionToken,
null,
argTypes,
- (ReferenceBinding)((ReferenceBinding) qualifiedBinding).capture(scope, messageSend.receiver.sourceEnd),
+ (ReferenceBinding)((ReferenceBinding) qualifiedBinding).capture(scope, messageSend.receiver.sourceStart, messageSend.receiver.sourceEnd),
scope,
new ObjectVector(),
false,
@@ -2773,7 +2777,7 @@
this.completionToken,
typeArgTypes,
null,
- (ReferenceBinding)receiverType.capture(scope, messageSend.receiver.sourceEnd),
+ (ReferenceBinding)receiverType.capture(scope, messageSend.receiver.sourceStart, messageSend.receiver.sourceEnd),
scope,
new ObjectVector(),
onlyStatic,
@@ -2803,11 +2807,16 @@
TypeBinding receiverType = (TypeBinding) qualifiedBinding;
if (receiverType != null && receiverType instanceof ReferenceBinding) {
+ if (!(receiverType.isInterface() || this.requestor.isIgnored(CompletionProposal.KEYWORD))) {
+ this.assistNodeIsConstructor = true;
+ setSourceAndTokenRange(referenceExpression.nameSourceStart, referenceExpression.sourceEnd);
+ findKeywords(this.completionToken, new char[][] { Keywords.NEW }, false, false);
+ }
findMethods(
this.completionToken,
referenceExpression.resolvedTypeArguments,
null,
- (ReferenceBinding)receiverType.capture(scope, referenceExpression.sourceEnd),
+ (ReferenceBinding)receiverType.capture(scope, referenceExpression.sourceStart, referenceExpression.sourceEnd),
scope,
new ObjectVector(),
onlyStatic,
@@ -3087,7 +3096,7 @@
findFieldsAndMethods(
this.completionToken,
- receiverType.capture(scope, ref.sourceEnd),
+ receiverType.capture(scope, ref.sourceStart, ref.sourceEnd),
scope,
fieldsFound,
methodsFound,
@@ -8181,6 +8190,9 @@
relevance += computeRelevanceForExpectingType(TypeBinding.BOOLEAN);
relevance += computeRelevanceForQualification(false);
}
+ if (CharOperation.equals(choices[i], Keywords.NEW)) {
+ relevance += computeRelevanceForConstructor();
+ }
this.noProposal = false;
if(!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
InternalCompletionProposal proposal = createProposal(CompletionProposal.KEYWORD, this.actualCompletionPosition);
@@ -8739,10 +8751,7 @@
}
proposal.setCompletion(completion);
proposal.setFlags(method.modifiers);
- if (completionOnReferenceExpressionName)
- proposal.setReplaceRange(this.endPosition - this.offset - methodLength, this.endPosition - this.offset);
- else
- proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
+ proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
proposal.setRelevance(relevance);
if(parameterNames != null) proposal.setParameterNames(parameterNames);
@@ -9296,7 +9305,7 @@
((scope instanceof MethodScope && !((MethodScope)scope).isStatic)
|| ((methodScope = scope.enclosingMethodScope()) != null && !methodScope.isStatic))) {
if (token.length > 0) {
- findKeywords(token, new char[][]{Keywords.THIS}, true, false);
+ findKeywords(token, new char[][]{Keywords.THIS, Keywords.SUPER}, true, false);
} else {
int relevance = computeBaseRelevance();
relevance += computeRelevanceForResolution();
@@ -10063,7 +10072,7 @@
ReferenceBinding[] superInterfaces = currentType.superInterfaces();
if (superInterfaces != null && currentType.isIntersectionType()) {
for (int i = 0; i < superInterfaces.length; i++) {
- superInterfaces[i] = (ReferenceBinding)superInterfaces[i].capture(invocationScope, invocationSite.sourceEnd());
+ superInterfaces[i] = (ReferenceBinding)superInterfaces[i].capture(invocationScope, invocationSite.sourceStart(), invocationSite.sourceEnd());
}
}
@@ -12193,6 +12202,9 @@
if(parent instanceof ParameterizedSingleTypeReference) {
ParameterizedSingleTypeReference ref = (ParameterizedSingleTypeReference) parent;
+ if (ref.resolvedType == null) {
+ return false;
+ }
TypeVariableBinding[] typeVariables = ((ReferenceBinding)ref.resolvedType).typeVariables();
int length = ref.typeArguments == null ? 0 : ref.typeArguments.length;
int nodeIndex = -1;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
index f7fca76..1f7222d 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1714,7 +1714,7 @@
buffer.append("POTENTIAL_METHOD_DECLARATION"); //$NON-NLS-1$
break;
case CompletionProposal.METHOD_NAME_REFERENCE :
- buffer.append("METHOD_IMPORT"); //$NON-NLS-1$
+ buffer.append("METHOD_NAME_REFERENCE"); //$NON-NLS-1$
break;
case CompletionProposal.ANNOTATION_ATTRIBUTE_REF :
buffer.append("ANNOTATION_ATTRIBUTE_REF"); //$NON-NLS-1$
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java
index 640e18a..7d873af 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/InternalExtendedCompletionContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* Bug 392384 - [1.8][compiler][null] Restore nullness info from type annotations in class files
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.codeassist;
@@ -19,6 +20,7 @@
import org.aspectj.org.eclipse.jdt.core.IJavaElement;
import org.aspectj.org.eclipse.jdt.core.ITypeRoot;
import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+import org.aspectj.org.eclipse.jdt.core.Signature;
import org.aspectj.org.eclipse.jdt.core.WorkingCopyOwner;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.codeassist.complete.CompletionNodeDetector;
@@ -38,7 +40,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
@@ -261,7 +263,7 @@
LocalDeclaration local = binding.declaration;
JavaElement parent = null;
- ReferenceContext referenceContext = binding.declaringScope.referenceContext();
+ ReferenceContext referenceContext = binding.declaringScope.isLambdaSubscope() ? binding.declaringScope.namedMethodScope().referenceContext() : binding.declaringScope.referenceContext();
if (referenceContext instanceof AbstractMethodDeclaration) {
AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
@@ -281,7 +283,7 @@
local.declarationSourceEnd,
local.sourceStart,
local.sourceEnd,
- Util.typeSignature(local.type),
+ local.type == null ? Signature.createTypeSignature(binding.type.signableName(), true) : Util.typeSignature(local.type),
binding.declaration.annotations,
local.modifiers,
local.getKind() == AbstractVariableDeclaration.PARAMETER);
@@ -338,7 +340,7 @@
SignatureWrapper wrapper = new SignatureWrapper(replacePackagesDot(typeSignature.toCharArray()));
// FIXME(stephan): do we interpret type annotations here?
- assignableTypeBinding = this.lookupEnvironment.getTypeFromTypeSignature(wrapper, typeVariables, this.assistScope.enclosingClassScope().referenceContext.binding, null, TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
+ assignableTypeBinding = this.lookupEnvironment.getTypeFromTypeSignature(wrapper, typeVariables, this.assistScope.enclosingClassScope().referenceContext.binding, null, ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
assignableTypeBinding = BinaryTypeBinding.resolveType(assignableTypeBinding, this.lookupEnvironment, true);
} catch (AbortCompilation e) {
assignableTypeBinding = null;
@@ -705,7 +707,7 @@
ReferenceBinding[] superInterfaces = currentType.superInterfaces();
if (superInterfaces != null && currentType.isIntersectionType()) {
for (int i = 0; i < superInterfaces.length; i++) {
- superInterfaces[i] = (ReferenceBinding)superInterfaces[i].capture(invocationScope, invocationSite.sourceEnd());
+ superInterfaces[i] = (ReferenceBinding)superInterfaces[i].capture(invocationScope, invocationSite.sourceStart(), invocationSite.sourceEnd());
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java
index ecb81e9..3b64d15 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/MissingTypesGuesser.java
@@ -564,7 +564,7 @@
missingElementsStarts,
missingElementsEnds)) {
requestor.accept(
- guessedType.capture(scope, typeRef.sourceEnd),
+ guessedType.capture(scope, typeRef.sourceStart, typeRef.sourceEnd),
missingElements,
missingElementsStarts,
missingElementsEnds,
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
index 6f15517..cea3da9 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/SelectionEngine.java
@@ -601,6 +601,15 @@
break isolateLastName;
}
break;
+ case TerminalTokens.TokenNameARROW:
+ case TerminalTokens.TokenNameCOLON_COLON:
+ if (scanner.startPosition <= selectionStart && selectionStart <= scanner.currentPosition) {
+ lastIdentifierStart = scanner.startPosition;
+ lastIdentifierEnd = scanner.currentPosition - 1;
+ lastIdentifier = scanner.getCurrentTokenSource();
+ break isolateLastName;
+ }
+ break;
}
} while (token != TerminalTokens.TokenNameEOF);
} else {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java
index 5067b67..cddd84b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionNodeDetector.java
@@ -134,6 +134,10 @@
public void endVisit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope) {
endVisit(qualifiedTypeReference);
}
+ @Override
+ public void endVisit(ReferenceExpression referenceExpression, BlockScope blockScope) {
+ endVisit(referenceExpression);
+ }
public void endVisit(SingleNameReference singleNameReference, BlockScope scope) {
endVisit(singleNameReference);
}
@@ -254,6 +258,10 @@
public boolean visit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope) {
return this.visit(qualifiedTypeReference);
}
+ @Override
+ public boolean visit(ReferenceExpression referenceExpression, BlockScope blockScope) {
+ return this.visit(referenceExpression);
+ }
public boolean visit(SingleNameReference singleNameReference, BlockScope scope) {
return this.visit(singleNameReference);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java
index 0de2a88..d31e4ac 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberAccess.java
@@ -73,7 +73,7 @@
}
}
- if (this.actualReceiverType == null || this.actualReceiverType.isBaseType() || !this.actualReceiverType.isValidBinding())
+ if (this.actualReceiverType == null || !this.actualReceiverType.isValidBinding())
throw new CompletionNodeFound();
else
throw new CompletionNodeFound(this, this.actualReceiverType, scope);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
index dd4054e..fba62bc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedAllocationExpression.java
@@ -39,13 +39,13 @@
public class CompletionOnQualifiedAllocationExpression extends QualifiedAllocationExpression {
public TypeBinding resolveType(BlockScope scope) {
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
+ this.argumentTypes = Binding.NO_PARAMETERS;
if (this.arguments != null) {
int argsLength = this.arguments.length;
int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
+ this.argumentTypes = new TypeBinding[length];
for (int a = argsLength; --a >= 0;) {
- argumentTypes[a] = this.arguments[a].resolveType(scope);
+ this.argumentTypes[a] = this.arguments[a].resolveType(scope);
}
}
final boolean isDiamond = this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0;
@@ -66,9 +66,9 @@
}
this.resolvedType = ((SingleTypeReference) this.type).resolveTypeEnclosing(scope, (ReferenceBinding) enclosingType);
if (isDiamond && (this.resolvedType instanceof ParameterizedTypeBinding)) {
- TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
+ TypeBinding [] inferredTypes = inferElidedTypes(scope);
if (inferredTypes != null) {
- this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType());
+ this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, this.resolvedType.enclosingType());
} else {
// inference failed. Resolved type will be of the form Test<>
this.bits |= ASTNode.IsDiamond;
@@ -81,9 +81,9 @@
} else {
this.resolvedType = this.type.resolveType(scope, true /* check bounds*/);
if (isDiamond && (this.resolvedType instanceof ParameterizedTypeBinding)) {
- TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
+ TypeBinding [] inferredTypes = inferElidedTypes(scope);
if (inferredTypes != null) {
- this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType());
+ this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, this.resolvedType.enclosingType());
} else {
// inference failed. Resolved type will be of the form Test<>
this.bits |= ASTNode.IsDiamond;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
index 14e1deb..9c3be60 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2318,6 +2318,11 @@
}
}
}
+protected void consumeClassInstanceCreationExpressionName() {
+ super.consumeClassInstanceCreationExpressionName();
+ this.invocationType = QUALIFIED_ALLOCATION;
+ this.qualifier = this.expressionPtr;
+}
protected void consumeClassTypeElt() {
pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION);
super.consumeClassTypeElt();
@@ -2426,9 +2431,18 @@
decide whether to call contactNodeLists. See Parser.consumeBlockStatement(s)
*/
if (this.shouldStackAssistNode && this.assistNode != null)
- this.astStack[this.astPtr] = this.assistNode;
+ this.astStack[this.astPtr] = this.assistNodeParent instanceof MessageSend ? this.assistNodeParent : this.assistNode;
this.shouldStackAssistNode = false;
}
+@Override
+protected void consumeBlockStatement() {
+ super.consumeBlockStatement();
+ if (this.shouldStackAssistNode && this.assistNode != null) {
+ Statement stmt = (Statement) this.astStack[this.astPtr];
+ if (stmt.sourceStart <= this.assistNode.sourceStart && stmt.sourceEnd >= this.assistNode.sourceEnd)
+ this.shouldStackAssistNode = false;
+ }
+}
protected void consumeEnhancedForStatement() {
super.consumeEnhancedForStatement();
@@ -2604,7 +2618,11 @@
} else if (this.assistNode != null && this.assistNode == variable.initialization) {
this.assistNodeParent = variable;
}
- triggerRecoveryUponLambdaClosure(variable, false);
+ if (triggerRecoveryUponLambdaClosure(variable, false)) {
+ if (this.currentElement != null) {
+ this.restartRecovery = true;
+ }
+ }
}
protected void consumeExitVariableWithoutInitialization() {
// ExitVariableWithoutInitialization ::= $empty
@@ -2787,7 +2805,7 @@
}
Expression castType = getTypeReference(this.intStack[this.intPtr--]);
if (additionalBoundsLength > 0) {
- bounds[0] = getTypeReference(this.intStack[this.intPtr--]);
+ bounds[0] = (TypeReference) castType;
castType = createIntersectionCastTypeReference(bounds);
}
if(isParameterized) {
@@ -3263,6 +3281,13 @@
pushOnLabelStack(this.identifierStack[this.identifierPtr]);
this.pushOnElementStack(K_LABEL, this.labelPtr);
}
+@Override
+protected void consumeLambdaExpression() {
+ super.consumeLambdaExpression();
+ Expression expression = this.expressionStack[this.expressionPtr];
+ if (this.assistNode == null || !(this.assistNode.sourceStart >= expression.sourceStart && this.assistNode.sourceEnd <= expression.sourceEnd))
+ popElement(K_LAMBDA_EXPRESSION_DELIMITER);
+}
protected void consumeMarkerAnnotation(boolean isTypeAnnotation) {
if (this.topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BETWEEN_ANNOTATION_NAME_AND_RPAREN &&
(this.topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER) & ANNOTATION_NAME_COMPLETION) != 0 ) {
@@ -3537,6 +3562,7 @@
if (token == TokenNameIdentifier
&& this.identifierStack[this.identifierPtr] == assistIdentifier()
&& this.currentElement == null
+ && (!isIndirectlyInsideLambdaExpression() || isIndirectlyInsideLambdaBlock())
&& isIndirectlyInsideFieldInitialization()) {
this.scanner.eofPosition = this.cursorLocation < Integer.MAX_VALUE ? this.cursorLocation+1 : this.cursorLocation;
}
@@ -4381,11 +4407,11 @@
return new CompletionOnSingleNameReference(assistName, position, isInsideAttributeValue());
} else {
boolean canBeExplicitConstructorCall = false;
- if(kind == K_BLOCK_DELIMITER
+ if((kind == K_BLOCK_DELIMITER || kind == K_LAMBDA_EXPRESSION_DELIMITER)
&& this.previousKind == K_BLOCK_DELIMITER
&& this.previousInfo == DO) {
return new CompletionOnKeyword3(assistName, position, Keywords.WHILE);
- } else if(kind == K_BLOCK_DELIMITER
+ } else if((kind == K_BLOCK_DELIMITER || kind == K_LAMBDA_EXPRESSION_DELIMITER)
&& this.previousKind == K_BLOCK_DELIMITER
&& this.previousInfo == TRY) {
return new CompletionOnKeyword3(assistName, position, new char[][]{Keywords.CATCH, Keywords.FINALLY});
@@ -4404,7 +4430,7 @@
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=269493: Keywords are not proposed in a for
// loop without block. Completion while at K_CONTROL_STATEMENT_DELIMITER case needs to handled
// similar to the K_BLOCK_DELIMITER with minor differences.
- if(kind == K_BLOCK_DELIMITER || kind == K_CONTROL_STATEMENT_DELIMITER) {
+ if(kind == K_BLOCK_DELIMITER || kind == K_CONTROL_STATEMENT_DELIMITER || kind == K_LAMBDA_EXPRESSION_DELIMITER) {
if(this.canBeExplicitConstructor == YES) {
canBeExplicitConstructorCall = true;
}
@@ -4661,7 +4687,7 @@
this.labelPtr = -1;
initializeForBlockStatements();
}
-public void copyState(CommitRollbackParser from) {
+public void copyState(Parser from) {
super.copyState(from);
@@ -5028,7 +5054,7 @@
}
}
-protected CommitRollbackParser createSnapShotParser() {
+protected CompletionParser createSnapShotParser() {
return new CompletionParser(this.problemReporter, this.storeSourceEnds);
}
/*
@@ -5146,6 +5172,11 @@
this.shouldStackAssistNode = true;
}
+@Override
+protected boolean assistNodeNeedsStacking() {
+ return this.shouldStackAssistNode;
+}
+
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("elementKindStack : int[] = {"); //$NON-NLS-1$
@@ -5170,14 +5201,15 @@
/* expose parser state to recovery state */
this.currentElement.updateFromParserState();
- /* may be able to retrieve completionNode as an orphan, and then attach it */
- completionIdentifierCheck();
- // attachOrphanCompletionNode pops various stacks to construct astNodeParent and enclosingNode. This does not gel well with extended recovery.
- CommitRollbackParser parser = null;
+ // completionIdentifierCheck && attachOrphanCompletionNode pops various stacks to construct astNodeParent and enclosingNode. This does not gel well with extended recovery.
+ AssistParser parser = null;
if (lastIndexOfElement(K_LAMBDA_EXPRESSION_DELIMITER) >= 0) {
parser = createSnapShotParser();
parser.copyState(this);
}
+
+ /* may be able to retrieve completionNode as an orphan, and then attach it */
+ completionIdentifierCheck();
attachOrphanCompletionNode();
if (parser != null)
this.copyState(parser);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
index c9127a0..d319f55 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java
@@ -17,6 +17,7 @@
import java.util.HashSet;
+import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration;
@@ -42,12 +43,12 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.CommitRollbackParser;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredBlock;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredElement;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredField;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredInitializer;
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredLocalVariable;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredMethod;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredStatement;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredType;
@@ -109,6 +110,9 @@
protected boolean isFirst = false;
+ public AssistParser snapShot;
+ private static final int[] RECOVERY_TOKENS = new int [] { TokenNameSEMICOLON, TokenNameRPAREN,};
+
public AssistParser(ProblemReporter problemReporter) {
super(problemReporter, true);
@@ -120,7 +124,7 @@
public abstract char[] assistIdentifier();
-public void copyState(CommitRollbackParser from) {
+public void copyState(Parser from) {
super.copyState(from);
@@ -231,7 +235,7 @@
break;
}
if (this.blockStarts[j] != lastStart){ // avoid multiple block if at same position
- block = new Block(0, lastNode instanceof LambdaExpression);
+ block = new Block(0);
block.sourceStart = lastStart = this.blockStarts[j];
element = element.add(block, 1);
}
@@ -257,7 +261,12 @@
this.lastCheckPoint = local.initialization.sourceEnd + 1;
}
} else {
- element = element.add(local, 0);
+ if (!local.isArgument()) {
+ element = element.add(local, 0);
+ } else {
+ // Bug 442868 - For arguments, let the method continue to be the current element.
+ element.add(local, 0);
+ }
this.lastCheckPoint = local.declarationSourceEnd + 1;
}
continue;
@@ -327,8 +336,11 @@
this.lastCheckPoint = importRef.declarationSourceEnd + 1;
}
}
- if (this.currentToken == TokenNameRBRACE && !isIndirectlyInsideLambdaExpression()) {
- this.currentToken = 0; // closing brace has already been taken care of
+ if (this.currentToken == TokenNameRBRACE) {
+ if (isIndirectlyInsideLambdaExpression())
+ this.ignoreNextClosingBrace = true;
+ else
+ this.currentToken = 0; // closing brace has already been taken care of
}
/* might need some extra block (after the last reduced node) */
@@ -338,7 +350,7 @@
for (int j = blockIndex; j <= this.realBlockPtr; j++){
if (this.blockStarts[j] >= 0) {
if ((this.blockStarts[j] < pos || createLambdaBlock) && (this.blockStarts[j] != lastStart)){ // avoid multiple block if at same position
- block = new Block(0, createLambdaBlock);
+ block = new Block(0);
block.sourceStart = lastStart = this.blockStarts[j];
element = element.add(block, 1);
createLambdaBlock = false;
@@ -463,29 +475,48 @@
}
}
- if (lambdaClosed && this.currentElement != null) {
- this.restartRecovery = true;
+ if (lambdaClosed && this.currentElement != null && !(this.currentElement instanceof RecoveredField)) {
if (!(statement instanceof AbstractVariableDeclaration)) { // added already as part of standard recovery since these contribute a name to the scope prevailing at the cursor.
/* See if CompletionParser.attachOrphanCompletionNode has already added bits and pieces of AST to the recovery tree. If so, we want to
replace those fragments with the fuller statement that provides target type for the lambda that got closed just now. There is prior
art/precedent in the Java 7 world to this: Search for recoveredBlock.statements[--recoveredBlock.statementCount] = null;
See also that this concern does not arise in the case of field/local initialization since the initializer is replaced with full tree by consumeExitVariableWithInitialization.
*/
- ASTNode assistNodeParent = this.assistNodeParent();
- ASTNode enclosingNode = this.enclosingNode();
- if (assistNodeParent != null || enclosingNode != null) {
- RecoveredBlock recoveredBlock = (RecoveredBlock) (this.currentElement instanceof RecoveredBlock ? this.currentElement :
- (this.currentElement.parent instanceof RecoveredBlock) ? this.currentElement.parent : null);
- if (recoveredBlock != null) {
- RecoveredStatement recoveredStatement = recoveredBlock.statementCount > 0 ? recoveredBlock.statements[recoveredBlock.statementCount - 1] : null;
- ASTNode parseTree = recoveredStatement != null ? recoveredStatement.updatedStatement(0, new HashSet()) : null;
- if (parseTree != null && (parseTree == assistNodeParent || parseTree == enclosingNode)) {
- recoveredBlock.statements[--recoveredBlock.statementCount] = null;
- this.currentElement = recoveredBlock;
+ RecoveredBlock recoveredBlock = (RecoveredBlock) (this.currentElement instanceof RecoveredBlock ? this.currentElement :
+ (this.currentElement.parent instanceof RecoveredBlock) ? this.currentElement.parent :
+ this.currentElement instanceof RecoveredMethod ? ((RecoveredMethod) this.currentElement).methodBody : null);
+ if (recoveredBlock != null) {
+ RecoveredStatement recoveredStatement = recoveredBlock.statementCount > 0 ? recoveredBlock.statements[recoveredBlock.statementCount - 1] : null;
+ ASTNode parseTree = recoveredStatement != null ? recoveredStatement.updatedStatement(0, new HashSet()) : null;
+ if (parseTree != null) {
+ if ((parseTree.sourceStart == 0 || parseTree.sourceEnd == 0) || (parseTree.sourceStart >= statementStart && parseTree.sourceEnd <= statementEnd)) {
+ recoveredBlock.statements[recoveredBlock.statementCount - 1] = new RecoveredStatement(statement, recoveredBlock, 0);
+ statement = null;
+ } else if (recoveredStatement instanceof RecoveredLocalVariable && statement instanceof Expression) {
+ RecoveredLocalVariable local = (RecoveredLocalVariable) recoveredStatement;
+ if (local.localDeclaration != null && local.localDeclaration.initialization != null) {
+ if ((local.localDeclaration.initialization.sourceStart == 0 || local.localDeclaration.initialization.sourceEnd == 0) ||
+ (local.localDeclaration.initialization.sourceStart >= statementStart && local.localDeclaration.initialization.sourceEnd <= statementEnd) ){
+ local.localDeclaration.initialization = (Expression) statement;
+ local.localDeclaration.declarationSourceEnd = statement.sourceEnd;
+ local.localDeclaration.declarationEnd = statement.sourceEnd;
+ statement = null;
+ }
+ }
}
}
}
- this.currentElement.add(statement, 0);
+
+ if (statement != null) {
+ while (this.currentElement != null) {
+ ASTNode tree = this.currentElement.parseTree();
+ if (tree.sourceStart < statement.sourceStart) {
+ this.currentElement.add(statement, 0);
+ break;
+ }
+ this.currentElement = this.currentElement.parent;
+ }
+ }
}
}
this.snapShot = null;
@@ -503,17 +534,22 @@
}
protected void consumeBlockStatement() {
super.consumeBlockStatement();
- triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true);
+ if (triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true) && this.currentElement != null)
+ this.restartRecovery = true;
}
protected void consumeBlockStatements() {
super.consumeBlockStatements();
- triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true);
+ if (triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true) && this.currentElement != null) {
+ this.restartRecovery = true;
+ }
}
protected void consumeFieldDeclaration() {
super.consumeFieldDeclaration();
if (triggerRecoveryUponLambdaClosure((Statement) this.astStack[this.astPtr], true)) {
if (this.currentElement instanceof RecoveredType)
popUntilElement(K_TYPE_DELIMITER);
+ if (this.currentElement != null)
+ this.restartRecovery = true;
}
}
protected void consumeForceNoDiet() {
@@ -764,6 +800,7 @@
// if we are not in a method (i.e. we were not in a local variable initializer)
// then we are exiting a field initializer
if (!isInsideMethod()) {
+ popUntilElement(K_FIELD_INITIALIZER_DELIMITER);
popElement(K_FIELD_INITIALIZER_DELIMITER);
}
}
@@ -1388,6 +1425,15 @@
}
return false;
}
+protected boolean isIndirectlyInsideLambdaBlock(){
+ int i = this.elementPtr;
+ while (i > -1) {
+ if (this.elementKindStack[i] == K_LAMBDA_EXPRESSION_DELIMITER && this.elementInfoStack[i] == BLOCK_BODY)
+ return true;
+ i--;
+ }
+ return false;
+}
protected boolean isIndirectlyInsideType(){
int i = this.elementPtr;
while(i > -1) {
@@ -1659,12 +1705,7 @@
return;
int stackPointer = this.elementPtr;
-
- if (this.elementKindStack[stackPointer] == K_LAMBDA_EXPRESSION_DELIMITER) {
- if (kind == K_FIELD_INITIALIZER_DELIMITER) // wait until lambda is reduced.
- return;
- }
-
+
if (kind != K_LAMBDA_EXPRESSION_DELIMITER) {
while (this.elementKindStack[stackPointer] == K_LAMBDA_EXPRESSION_DELIMITER) {
stackPointer --;
@@ -1833,6 +1874,78 @@
public void reset(){
flushAssistState();
}
+
+protected void commit() {
+ if (this.snapShot == null) {
+ this.snapShot = createSnapShotParser();
+ }
+ this.snapShot.copyState(this);
+}
+
+protected boolean assistNodeNeedsStacking() {
+ return false;
+}
+
+protected void shouldStackAssistNode() {
+ // Not relevant here.
+}
+
+protected int getNextToken() {
+ try {
+ return this.scanner.getNextToken();
+ } catch (InvalidInputException e) {
+ return TokenNameEOF;
+ }
+}
+
+protected abstract AssistParser createSnapShotParser();
+
+// We get here on real syntax error or syntax error triggered by fake EOF at completion site, never due to triggered recovery.
+protected int fallBackToSpringForward(Statement unused) {
+ int nextToken;
+ int automatonState = automatonState();
+
+ // If triggered fake EOF at completion site, see if the real next token would have passed muster.
+ if (this.currentToken == TokenNameEOF) {
+ if (this.scanner.eofPosition < this.scanner.source.length) {
+ shouldStackAssistNode();
+ this.scanner.eofPosition = this.scanner.source.length;
+ nextToken = getNextToken();
+ if (automatonWillShift(nextToken, automatonState)) {
+ this.currentToken = nextToken;
+ return RESUME;
+ }
+ this.scanner.ungetToken(nextToken); // spit out what has been bitten more than we can chew.
+ } else {
+ return HALT; // don't know how to proceed.
+ }
+ } else {
+ nextToken = this.currentToken;
+ this.scanner.ungetToken(nextToken);
+ if (nextToken == TokenNameRBRACE)
+ ignoreNextClosingBrace(); // having ungotten it, recoveryTokenCheck will see this again.
+ }
+ // OK, next token is no good to resume "in place", attempt some local repair. FIXME: need to make sure we don't get stuck keep reducing empty statements !!
+ for (int i = 0, length = RECOVERY_TOKENS.length; i < length; i++) {
+ if (automatonWillShift(RECOVERY_TOKENS[i], automatonState)) {
+ this.currentToken = RECOVERY_TOKENS[i];
+ return RESUME;
+ }
+ }
+ // OK, no in place resumption, no local repair, fast forward to next statement.
+ if (this.snapShot == null)
+ return RESTART;
+
+ this.copyState(this.snapShot);
+ if (assistNodeNeedsStacking()) {
+ this.currentToken = TokenNameSEMICOLON;
+ return RESUME;
+ }
+ this.currentToken = this.scanner.fastForward(unused);
+ return RESUME;
+}
+
+
/*
* Reset context so as to resume to regular parse loop
* If unable to reset for resuming, answers false.
@@ -1849,6 +1962,8 @@
return mode;
// else fall through and RESTART
} else {
+ if (this.currentToken == TokenNameLBRACE)
+ this.ignoreNextOpeningBrace = true; // already accounted for in recovery token check.
return RESUME;
}
}
@@ -1996,4 +2111,4 @@
return ast;
}
}
-}
\ No newline at end of file
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
index 76fc020..04201ea 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpression.java
@@ -25,7 +25,7 @@
@Override
public TypeBinding resolveType(BlockScope scope) {
TypeBinding resolveType = super.resolveType(scope);
- if (this.expectedType != null && !this.trialResolution)
+ if (this.expectedType != null && this.original == this)
throw new SelectionNodeFound(this.descriptor);
return resolveType;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java
index 0ee69b4..4958099 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionOnReferenceExpressionName.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 IBM Corporation and others.
+ * Copyright (c) 2013, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
public class SelectionOnReferenceExpressionName extends ReferenceExpression {
@@ -41,7 +42,7 @@
public TypeBinding resolveType(BlockScope scope) {
TypeBinding type = super.resolveType(scope);
- if (type instanceof PolyTypeBinding)
+ if (type == null || type instanceof ProblemReferenceBinding || type instanceof PolyTypeBinding)
return type;
MethodBinding method = getMethodBinding();
if (method != null && method.isValidBinding() && !method.isSynthetic())
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
index e553203..5c1f91b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java
@@ -52,13 +52,13 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SuperReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SwitchStatement;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ThisReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.CommitRollbackParser;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveredType;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
@@ -117,8 +117,14 @@
this.currentElement = this.currentElement.add(statement, 0);
}
}
- if (!isIndirectlyInsideLambdaExpression())
+ if (isIndirectlyInsideLambdaExpression()) {
+ if (this.currentToken == TokenNameLBRACE)
+ this.ignoreNextOpeningBrace = true;
+ else if (this.currentToken == TokenNameRBRACE)
+ this.ignoreNextClosingBrace = true;
+ } else {
this.currentToken = 0; // given we are not on an eof, we do not want side effects caused by looked-ahead token
+ }
}
}
private void buildMoreCompletionContext(Expression expression) {
@@ -551,8 +557,10 @@
if (!this.diet){
this.restartRecovery = true; // force to restart in recovery mode
this.lastIgnoredToken = -1;
- if (!isIndirectlyInsideLambdaExpression())
- this.currentToken = 0; // opening brace already taken into account
+ if (isIndirectlyInsideLambdaExpression())
+ this.ignoreNextOpeningBrace = true;
+ else
+ this.currentToken = 0; // opening brace already taken into account.
this.hasReportedError = true;
}
@@ -562,8 +570,10 @@
if (this.currentElement != null){
this.lastCheckPoint = anonymousType.bodyStart;
this.currentElement = this.currentElement.add(anonymousType, 0);
- if (!isIndirectlyInsideLambdaExpression())
- this.currentToken = 0; // opening brace already taken into account
+ if (isIndirectlyInsideLambdaExpression())
+ this.ignoreNextOpeningBrace = true;
+ else
+ this.currentToken = 0; // opening brace already taken into account.
this.lastIgnoredToken = -1;
}
}
@@ -768,6 +778,8 @@
this.expressionStack[this.expressionPtr] = new SelectionOnLambdaExpression(expression);
}
}
+ if (!(this.selectionStart >= expression.sourceStart && this.selectionEnd <= expression.sourceEnd))
+ popElement(K_LAMBDA_EXPRESSION_DELIMITER);
}
@Override
protected void consumeReferenceExpression(ReferenceExpression referenceExpression) {
@@ -786,7 +798,7 @@
super.consumeLocalVariableDeclarationStatement();
// force to restart in recovery mode if the declaration contains the selection
- if (!this.diet) {
+ if (!this.diet && this.astStack[this.astPtr] instanceof LocalDeclaration) {
LocalDeclaration localDeclaration = (LocalDeclaration) this.astStack[this.astPtr];
if ((this.selectionStart >= localDeclaration.sourceStart)
&& (this.selectionEnd <= localDeclaration.sourceEnd)) {
@@ -885,6 +897,18 @@
}
} else {
super.consumeMethodInvocationName();
+ if (requireExtendedRecovery()) {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=430572, compensate for the hacks elsewhere where super/this gets treated as identifier. See getUnspecifiedReference
+ if (this.astPtr >= 0 && this.astStack[this.astPtr] == this.assistNode && this.assistNode instanceof ThisReference) {
+ MessageSend messageSend = (MessageSend) this.expressionStack[this.expressionPtr];
+ if (messageSend.receiver instanceof SingleNameReference) {
+ SingleNameReference snr = (SingleNameReference) messageSend.receiver;
+ if (snr.token == CharOperation.NO_CHAR) { // dummy reference created by getUnspecifiedReference ???
+ messageSend.receiver = (Expression) this.astStack[this.astPtr--];
+ }
+ }
+ }
+ }
return;
}
@@ -1215,7 +1239,7 @@
this.restartRecovery = true; // used to avoid branching back into the regular automaton
}
}
-protected CommitRollbackParser createSnapShotParser() {
+protected SelectionParser createSnapShotParser() {
return new SelectionParser(this.problemReporter);
}
public ImportReference createAssistImportReference(char[][] tokens, long[] positions, int mod){
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.java
index 9b59352..04ae561 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ClassFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,8 +21,11 @@
* Bug 415470 - [1.8][compiler] Type annotations on class declaration go vanishing
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
* Bug 434556 - Broken class file generated for incorrect annotation usage
+ * Bug 442416 - $deserializeLambda$ missing cases for nested lambdas
* Stephan Herrmann - Contribution for
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
+ * Olivier Tardieu tardieu@us.ibm.com - Contributions for
+ * Bug 442416 - $deserializeLambda$ missing cases for nested lambdas
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler;
@@ -138,7 +141,7 @@
public byte[] header;
// that collection contains all the remaining bytes of the .class file
public int headerOffset;
- public Set innerClassesBindings;
+ public Map<TypeBinding, Boolean> innerClassesBindings;
public List bootstrapMethods = null;
public int methodCount;
public int methodCountOffset;
@@ -397,11 +400,22 @@
int numberOfInnerClasses = this.innerClassesBindings == null ? 0 : this.innerClassesBindings.size();
if (numberOfInnerClasses != 0) {
ReferenceBinding[] innerClasses = new ReferenceBinding[numberOfInnerClasses];
- this.innerClassesBindings.toArray(innerClasses);
+ this.innerClassesBindings.keySet().toArray(innerClasses);
Arrays.sort(innerClasses, new Comparator() {
public int compare(Object o1, Object o2) {
TypeBinding binding1 = (TypeBinding) o1;
TypeBinding binding2 = (TypeBinding) o2;
+ Boolean onBottom1 = ClassFile.this.innerClassesBindings.get(o1);
+ Boolean onBottom2 = ClassFile.this.innerClassesBindings.get(o2);
+ if (onBottom1) {
+ if (!onBottom2) {
+ return 1;
+ }
+ } else {
+ if (onBottom2) {
+ return -1;
+ }
+ }
return CharOperation.compareTo(binding1.constantPoolName(), binding2.constantPoolName());
}
});
@@ -896,6 +910,7 @@
// add synthetic methods infos
int emittedSyntheticsCount = 0;
+ SyntheticMethodBinding deserializeLambdaMethod = null;
boolean continueScanningSynthetics = true;
while (continueScanningSynthetics) {
continueScanningSynthetics = false;
@@ -956,14 +971,16 @@
addSyntheticFactoryMethod(syntheticMethod);
break;
case SyntheticMethodBinding.DeserializeLambda:
- // TODO [andy] do we need to do this after the loop to ensure it is done last?
- addSyntheticDeserializeLambda(syntheticMethod,this.referenceBinding.syntheticMethods());
+ deserializeLambdaMethod = syntheticMethod; // delay processing
break;
}
}
emittedSyntheticsCount = currentSyntheticsCount;
}
}
+ if (deserializeLambdaMethod != null) {
+ addSyntheticDeserializeLambda(deserializeLambdaMethod,this.referenceBinding.syntheticMethods());
+ }
}
public void addSyntheticArrayConstructor(SyntheticMethodBinding methodBinding) {
@@ -2281,7 +2298,7 @@
LocalVariableBinding localVariable = annotationContext.variableBinding;
int actualSize = 0;
int initializationCount = localVariable.initializationCount;
- actualSize += 6 * initializationCount;
+ actualSize += 2 /* for number of entries */ + (6 * initializationCount);
// reserve enough space
if (this.contentsOffset + actualSize >= this.contents.length) {
resizeContents(actualSize);
@@ -2345,13 +2362,14 @@
if (annotation instanceof NormalAnnotation) {
NormalAnnotation normalAnnotation = (NormalAnnotation) annotation;
MemberValuePair[] memberValuePairs = normalAnnotation.memberValuePairs;
+ int memberValuePairOffset = this.contentsOffset;
if (memberValuePairs != null) {
int memberValuePairsCount = 0;
int memberValuePairsLengthPosition = this.contentsOffset;
this.contentsOffset+=2; // leave space to fill in the pair count later
int resetPosition = this.contentsOffset;
final int memberValuePairsLength = memberValuePairs.length;
- for (int i = 0; i < memberValuePairsLength; i++) {
+ loop: for (int i = 0; i < memberValuePairsLength; i++) {
MemberValuePair memberValuePair = memberValuePairs[i];
if (this.contentsOffset + 2 >= this.contents.length) {
resizeContents(2);
@@ -2364,7 +2382,13 @@
this.contentsOffset = resetPosition;
} else {
try {
- generateElementValue(memberValuePair.value, methodBinding.returnType, startingContentsOffset);
+ generateElementValue(memberValuePair.value, methodBinding.returnType, memberValuePairOffset);
+ if (this.contentsOffset == memberValuePairOffset) {
+ // ignore all annotation values
+ this.contents[this.contentsOffset++] = 0;
+ this.contents[this.contentsOffset++] = 0;
+ break loop;
+ }
memberValuePairsCount++;
resetPosition = this.contentsOffset;
} catch(ClassCastException e) {
@@ -2399,9 +2423,8 @@
try {
generateElementValue(singleMemberAnnotation.memberValue, methodBinding.returnType, memberValuePairOffset);
if (this.contentsOffset == memberValuePairOffset) {
- // ignore annotation value
- this.contents[this.contentsOffset++] = 0;
- this.contents[this.contentsOffset++] = 0;
+ // completely remove the annotation as its value is invalid
+ this.contentsOffset = startingContentsOffset;
}
} catch(ClassCastException e) {
this.contentsOffset = startingContentsOffset;
@@ -3599,6 +3622,14 @@
}
}
+ private boolean jdk16packageInfoAnnotation(final long annotationMask, final long targetMask) {
+ if (this.targetJDK <= ClassFileConstants.JDK1_6 &&
+ targetMask == TagBits.AnnotationForPackage && annotationMask != 0 &&
+ (annotationMask & TagBits.AnnotationForPackage) == 0) {
+ return true;
+ }
+ return false;
+ }
/**
* @param annotations
* @param targetMask allowed targets
@@ -3615,7 +3646,9 @@
long annotationMask = annotation.resolvedType != null ? annotation.resolvedType.getAnnotationTagBits() & TagBits.AnnotationTargetMASK : 0;
// AspectJ Extension: this prevents a Type targeting annotation being stashed on a
// method representing an 'declare @type'. So don't enforce this restriction
-// if (annotationMask != 0 && (annotationMask & targetMask) == 0) continue;
+// if (annotationMask != 0 && (annotationMask & targetMask) == 0) {
+// if (!jdk16packageInfoAnnotation(annotationMask, targetMask)) continue;
+// }
// AspectJ Extension: End
if (annotation.isRuntimeInvisible() || annotation.isRuntimeTypeInvisible()) {
invisibleAnnotationsCounter++;
@@ -3649,7 +3682,9 @@
long annotationMask = annotation.resolvedType != null ? annotation.resolvedType.getAnnotationTagBits() & TagBits.AnnotationTargetMASK : 0;
// AspectJ Extension: this prevents a Type targeting annotation being stashed on a
// method representing an 'declare @type'. So don't enforce this restriction
-// if (annotationMask != 0 && (annotationMask & targetMask) == 0) continue;
+// if (annotationMask != 0 && (annotationMask & targetMask) == 0) {
+// if (!jdk16packageInfoAnnotation(annotationMask, targetMask)) continue;
+// }
// AspectJ Extension: end
if (annotation.isRuntimeInvisible() || annotation.isRuntimeTypeInvisible()) {
int currentAnnotationOffset = this.contentsOffset;
@@ -3703,6 +3738,8 @@
// AspectJ Extension: this prevents a Type targeting annotation being stashed on a
// method representing an 'declare @type'. So don't enforce this restriction
// if (annotationMask != 0 && (annotationMask & targetMask) == 0) continue;
+// if (!jdk16packageInfoAnnotation(annotationMask, targetMask)) continue;
+// }
// AspectJ Extension: end
if (annotation.isRuntimeVisible() || annotation.isRuntimeTypeVisible()) {
visibleAnnotationsCounter--;
@@ -5224,15 +5261,18 @@
}
public void recordInnerClasses(TypeBinding binding) {
+ recordInnerClasses(binding, false);
+ }
+ public void recordInnerClasses(TypeBinding binding, boolean onBottomForBug445231) {
if (this.innerClassesBindings == null) {
- this.innerClassesBindings = new HashSet(INNER_CLASSES_SIZE);
+ this.innerClassesBindings = new HashMap(INNER_CLASSES_SIZE);
}
ReferenceBinding innerClass = (ReferenceBinding) binding;
- this.innerClassesBindings.add(innerClass.erasure().unannotated(false)); // should not emit yet another inner class for Outer.@Inner Inner.
+ this.innerClassesBindings.put(innerClass.erasure().unannotated(), onBottomForBug445231); // should not emit yet another inner class for Outer.@Inner Inner.
ReferenceBinding enclosingType = innerClass.enclosingType();
while (enclosingType != null
&& enclosingType.isNestedType()) {
- this.innerClassesBindings.add(enclosingType.erasure().unannotated(false));
+ this.innerClassesBindings.put(enclosingType.erasure().unannotated(), onBottomForBug445231);
enclosingType = enclosingType.enclosingType();
}
}
@@ -6646,11 +6686,9 @@
int dimensions = u1At(bytecodes, 3, pc); // dimensions
frame.numberOfStackItems -= dimensions;
classNameLength = className.length;
- constantPoolName = new char[classNameLength + dimensions];
- for (int i = 0; i < dimensions; i++) {
- constantPoolName[i] = '[';
- }
- System.arraycopy(className, 0, constantPoolName, dimensions, classNameLength);
+ // class name is already the name of the right array type with all dimensions
+ constantPoolName = new char[classNameLength];
+ System.arraycopy(className, 0, constantPoolName, 0, classNameLength);
frame.addStackItem(new VerificationTypeInfo(0, constantPoolName));
pc += 4;
break;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.java
index 7dd3867..a2757a4 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/CompilationResult.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -58,7 +58,7 @@
public int problemCount;
public int taskCount;
public ICompilationUnit compilationUnit;
- private Map problemsMap;
+ private Map<CategorizedProblem, ReferenceContext> problemsMap;
private Set firstErrors;
private int maxProblemPerUnit;
public char[][][] qualifiedReferences;
@@ -112,7 +112,7 @@
if (problem.isError()){
priority += P_ERROR;
}
- ReferenceContext context = this.problemsMap == null ? null : (ReferenceContext) this.problemsMap.get(problem);
+ ReferenceContext context = this.problemsMap == null ? null : this.problemsMap.get(problem);
if (context != null){
if (context instanceof AbstractMethodDeclaration){
AbstractMethodDeclaration method = (AbstractMethodDeclaration) context;
@@ -403,6 +403,13 @@
}
}
+ReferenceContext getContext(CategorizedProblem problem) {
+ if (problem != null) {
+ return this.problemsMap.get(problem);
+ }
+ return null;
+}
+
/**
* For now, remember the compiled type using its compound name.
*/
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.java
index 8533682..b005e80 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/Compiler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,6 +41,8 @@
public CompilationUnitDeclaration[] unitsToProcess;
public int totalUnits; // (totalUnits-1) gives the last unit in unitToProcess
+ private Map<String, APTProblem[]> aptProblems;
+
// name lookup
public LookupEnvironment lookupEnvironment;
@@ -417,13 +419,7 @@
* -> recompile any required types for which we have an incomplete principle structure
*/
public void compile(ICompilationUnit[] sourceUnits) {
- compile(sourceUnits, false);
- }
-
- public void compile(ICompilationUnit[] sourceUnits, boolean ignoreAnnotationProcessing) {
this.stats.startTime = System.currentTimeMillis();
- CompilationUnitDeclaration unit = null;
- ProcessTaskManager processingTask = null;
try {
// build and record parsed units
reportProgress(Messages.compilation_beginningToCompile);
@@ -435,14 +431,13 @@
try {
beginToCompile(sourceUnits);
- if (!ignoreAnnotationProcessing) {
processAnnotations();
- }
if (!this.options.generateClassFiles) {
// -proc:only was set on the command line
return;
}
} catch (SourceTypeCollisionException e) {
+ backupAptProblems();
reset();
// a generated type was referenced before it was created
// the compiler either created a MissingType or found a BinaryType for it
@@ -454,19 +449,89 @@
System.arraycopy(originalUnits, 0, combinedUnits, 0, originalLength);
System.arraycopy(e.newAnnotationProcessorUnits, 0, combinedUnits, originalLength, newProcessedLength);
this.annotationProcessorStartIndex = originalLength;
-
- // Javadoc on javax.annotation.processing.RoundEnvironment#processingOver() claims that
- // types generated by last round of annotation processing should not be subject to a subsequent rounds
- // of annotation processing. So this flag have to be added to handle last round of annotation processing gracefully.
- compile(combinedUnits, e.afterLastAnnotationProcessingRound);
+ compile(combinedUnits);
return;
}
}
+ // Restore the problems before the results are processed and cleaned up.
+ restoreAptProblems();
+ processCompiledUnits(0);
+ } catch (AbortCompilation e) {
+ this.handleInternalException(e, null);
+ }
+ if (this.options.verbose) {
+ if (this.totalUnits > 1) {
+ this.out.println(
+ Messages.bind(Messages.compilation_units, String.valueOf(this.totalUnits)));
+ } else {
+ this.out.println(
+ Messages.bind(Messages.compilation_unit, String.valueOf(this.totalUnits)));
+ }
+ }
+ }
+ class APTProblem {
+ CategorizedProblem problem;
+ ReferenceContext context;
+ APTProblem(CategorizedProblem problem, ReferenceContext context) {
+ this.problem = problem;
+ this.context = context;
+ }
+ }
+
+ protected void backupAptProblems() {
+ if (this.unitsToProcess == null) return;
+ for (CompilationUnitDeclaration unitDecl : this.unitsToProcess) {
+ if (unitDecl == null) continue;
+ CompilationResult result = unitDecl.compilationResult;
+ if (result != null && result.hasErrors()) {
+ CategorizedProblem[] errors = result.getErrors();
+ for (CategorizedProblem problem : errors) {
+ if (problem.getCategoryID() == CategorizedProblem.CAT_UNSPECIFIED) {
+ if (this.aptProblems == null) {
+ this.aptProblems = new HashMap<>();
+ }
+ APTProblem[] problems = this.aptProblems.get(new String(unitDecl.getFileName()));
+ if (problems == null) {
+ this.aptProblems.put(
+ new String(unitDecl.getFileName()),
+ new APTProblem[] { new APTProblem(problem, result.getContext(problem)) });
+ } else {
+ APTProblem[] temp = new APTProblem[problems.length + 1];
+ System.arraycopy(problems, 0, temp, 0, problems.length);
+ temp[problems.length] = new APTProblem(problem, result.getContext(problem));
+ this.aptProblems.put(new String(unitDecl.getFileName()), temp);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ protected void restoreAptProblems() {
+ if (this.unitsToProcess != null && this.aptProblems!= null) {
+ for (CompilationUnitDeclaration unit : this.unitsToProcess) {
+ APTProblem[] problems = this.aptProblems.get(new String(unit.getFileName()));
+ if (problems != null) {
+ for (APTProblem problem : problems) {
+ unit.compilationResult.record(problem.problem, problem.context);
+ }
+ }
+ }
+ }
+ this.aptProblems = null; // No need for this.
+ }
+
+ protected void processCompiledUnits(int startingIndex) throws java.lang.Error {
+ CompilationUnitDeclaration unit = null;
+ ProcessTaskManager processingTask = null;
+ try {
if (this.useSingleThread) {
// process all units (some more could be injected in the loop by the lookup environment)
- for (int i = 0; i < this.totalUnits; i++) {
+ for (int i = startingIndex; i < this.totalUnits; i++) {
unit = this.unitsToProcess[i];
+ if (unit.compilationResult != null && unit.compilationResult.hasBeenAccepted)
+ continue;
reportProgress(Messages.bind(Messages.compilation_processing, new String(unit.getFileName())));
try {
if (this.options.verbose)
@@ -479,11 +544,14 @@
}));
process(unit, i);
} finally {
- // cleanup compilation unit result
+ // cleanup compilation unit result, but only if not annotation processed.
+ // if (this.annotationProcessorManager == null || shouldCleanup(i))
// unit.cleanUp(); // AspectJ Extension - moved to afterProcessing
}
// AspectJ Extension
+ // if (this.annotationProcessorManager == null) {
// this.unitsToProcess[i] = null; // release reference to processed unit declaration
+ // }
// AspectJ Extension end
reportWorked(1, i);
this.stats.lineCount += unit.compilationResult.lineSeparatorPositions.length;
@@ -502,7 +570,7 @@
}));
}
} else {
- processingTask = new ProcessTaskManager(this);
+ processingTask = new ProcessTaskManager(this, startingIndex);
int acceptedCount = 0;
// process all units (some more could be injected in the loop by the lookup environment)
// the processTask can continue to process units until its fixed sized cache is full then it must wait
@@ -531,6 +599,16 @@
}));
}
}
+ if (this.annotationProcessorManager != null && this.totalUnits > this.annotationProcessorStartIndex) {
+ int backup = this.annotationProcessorStartIndex;
+ int prevUnits = this.totalUnits;
+ processAnnotations();
+ // Clean up the units that were left out previously for annotation processing.
+ for (int i = backup; i < prevUnits; i++) {
+ this.unitsToProcess[i].cleanUp();
+ }
+ processCompiledUnits(backup);
+ }
} catch (AbortCompilation e) {
this.handleInternalException(e, unit);
} catch (Error e) {
@@ -550,26 +628,28 @@
this.annotationProcessorStartIndex = 0;
this.stats.endTime = System.currentTimeMillis();
}
- if (this.options.verbose) {
- if (this.totalUnits > 1) {
- this.out.println(
- Messages.bind(Messages.compilation_units, String.valueOf(this.totalUnits)));
- } else {
- this.out.println(
- Messages.bind(Messages.compilation_unit, String.valueOf(this.totalUnits)));
- }
- }
}
public synchronized CompilationUnitDeclaration getUnitToProcess(int next) {
if (next < this.totalUnits) {
CompilationUnitDeclaration unit = this.unitsToProcess[next];
+ if (this.annotationProcessorManager == null || next < this.annotationProcessorStartIndex) {
this.unitsToProcess[next] = null; // release reference to processed unit declaration
+ }
return unit;
}
return null;
}
+ /*
+ * Returns whether the compilation unit at the given index should be
+ * cleaned up after processing. This basically means whether or not
+ * the unit is still required for annotation processing.
+ */
+ public boolean shouldCleanup(int index) {
+ return index < this.annotationProcessorStartIndex;
+ }
+
public void setBinaryTypes(ReferenceBinding[] binaryTypes) {
this.referenceBindings = binaryTypes;
}
@@ -851,8 +931,8 @@
CompilationUnitDeclaration[] addedUnits = new CompilationUnitDeclaration[length];
System.arraycopy(this.unitsToProcess, top, addedUnits, 0, length);
this.annotationProcessorManager.processAnnotations(addedUnits, binaryTypeBindingsTemp, false);
- this.annotationProcessorStartIndex = top;
}
+ this.annotationProcessorStartIndex = top;
ICompilationUnit[] newUnits = this.annotationProcessorManager.getNewUnits();
newUnitSize = newUnits.length;
ReferenceBinding[] newClassFiles = this.annotationProcessorManager.getNewClassFiles();
@@ -872,6 +952,7 @@
}
bottom = top;
top = this.totalUnits; // last unit added
+ this.annotationProcessorStartIndex = top;
} else {
bottom = top;
this.annotationProcessorManager.reset();
@@ -889,7 +970,6 @@
internalBeginToCompile(newUnits, newUnitSize);
} catch (SourceTypeCollisionException e) {
e.newAnnotationProcessorUnits = newProcessedUnits;
- e.afterLastAnnotationProcessingRound = true;
throw e;
} finally {
this.lookupEnvironment.isProcessingAnnotations = false;
@@ -898,6 +978,8 @@
} else {
this.annotationProcessorManager.reset();
}
+ // Units added in final round don't get annotation processed
+ this.annotationProcessorStartIndex = this.totalUnits;
}
public void reset() {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.java
index 2db90c7..483c104 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ProcessTaskManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,9 +28,9 @@
public static final int PROCESSED_QUEUE_SIZE = 12;
-public ProcessTaskManager(Compiler compiler) {
+public ProcessTaskManager(Compiler compiler, int startingIndex) {
this.compiler = compiler;
- this.unitIndex = 0;
+ this.unitIndex = startingIndex;
this.currentIndex = 0;
this.availableIndex = 0;
@@ -109,9 +109,11 @@
}
public void run() {
+ boolean noAnnotations = this.compiler.annotationProcessorManager == null;
while (this.processingThread != null) {
this.unitToProcess = null;
int index = -1;
+ boolean cleanup = noAnnotations || this.compiler.shouldCleanup(this.unitIndex);
try {
synchronized (this) {
if (this.processingThread == null) return;
@@ -122,6 +124,8 @@
return;
}
index = this.unitIndex++;
+ if (this.unitToProcess.compilationResult.hasBeenAccepted)
+ continue;
}
try {
@@ -136,7 +140,8 @@
}));
this.compiler.process(this.unitToProcess, index);
} finally {
- if (this.unitToProcess != null)
+ // cleanup compilation unit result, but only if not annotation processed.
+ if (this.unitToProcess != null && cleanup)
this.unitToProcess.cleanUp();
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.java
index b39f975..d806f8e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/SourceElementParser.java
@@ -424,6 +424,7 @@
this.sourceEnds.put(this.astStack[this.astPtr], selectorSourceEnd);
rememberCategories();
}
+ flushCommentsDefinedPriorTo(this.scanner.currentPosition);
}
protected void consumeMethodHeaderNameWithTypeParameters(boolean isAnnotationMethod) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.java
index 3fb706a..ffd0e5f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AnnotationDiscoveryVisitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.apt.model.ElementImpl;
import org.aspectj.org.eclipse.jdt.internal.compiler.apt.model.Factory;
import org.aspectj.org.eclipse.jdt.internal.compiler.apt.util.ManyToMany;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
@@ -36,6 +35,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
@@ -230,13 +230,16 @@
boolean old = scope.insideTypeAnnotation;
scope.insideTypeAnnotation = true;
- ASTNode.resolveAnnotations(scope, annotations, currentBinding);
+ currentBinding.getAnnotationTagBits();
scope.insideTypeAnnotation = old;
ElementImpl element = (ElementImpl) _factory.newElement(currentBinding);
AnnotationBinding [] annotationBindings = element.getPackedAnnotationBindings(); // discovery is never in terms of repeating annotation.
for (AnnotationBinding binding : annotationBindings) {
- if (binding != null) { // binding should be resolved, but in case it's not, ignore it: it could have been wrapped into a container.
- TypeElement anno = (TypeElement)_factory.newElement(binding.getAnnotationType());
+ ReferenceBinding annotationType = binding.getAnnotationType();
+ if (binding != null
+ && Annotation.isAnnotationTargetAllowed(scope, annotationType, currentBinding)
+ ) { // binding should be resolved, but in case it's not, ignore it: it could have been wrapped into a container.
+ TypeElement anno = (TypeElement)_factory.newElement(annotationType);
_annoToElement.put(anno, element);
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.java
index a9e79e0..ddada85 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/AptProblem.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2001, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Sergey Stupin - contributions for adding annotation processing support to ajc
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.java
index 2a15b1c..bf6cb0a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseAnnotationProcessorManager.java
@@ -149,7 +149,6 @@
if (_isFirstRound) {
_isFirstRound = false;
}
-
PrintWriter traceProcessorInfo = _printProcessorInfo ? _out : null;
PrintWriter traceRounds = _printRounds ? _out : null;
if (traceRounds != null) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.java
index b12acc7..5b47334 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BaseMessagerImpl.java
@@ -24,6 +24,8 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.apt.model.VariableElementImpl;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
@@ -144,12 +146,7 @@
}
if (a != null && elementAnnotations != null) {
AnnotationBinding annotationBinding = ((AnnotationMirrorImpl) a)._binding;
- Annotation annotation = null;
- for (int i = 0; annotation == null && i < elementAnnotations.length; i++) {
- if (annotationBinding == elementAnnotations[i].getCompilerAnnotation()) {
- annotation = elementAnnotations[i];
- }
- }
+ Annotation annotation = findAnnotation(elementAnnotations, annotationBinding);
if (annotation != null) {
startPosition = annotation.sourceStart;
endPosition = annotation.sourceEnd;
@@ -206,6 +203,44 @@
columnNumber);
}
+ private static Annotation findAnnotation(Annotation[] elementAnnotations, AnnotationBinding annotationBinding) {
+ for (int i = 0; i < elementAnnotations.length; i++) {
+ Annotation annotation = findAnnotation(elementAnnotations[i], annotationBinding);
+ if (annotation != null) {
+ return annotation;
+ }
+ }
+ return null;
+ }
+
+ private static Annotation findAnnotation(Annotation elementAnnotation, AnnotationBinding annotationBinding) {
+ if (annotationBinding == elementAnnotation.getCompilerAnnotation()) {
+ return elementAnnotation;
+ }
+
+ MemberValuePair[] memberValuePairs = elementAnnotation.memberValuePairs();
+ for (MemberValuePair mvp : memberValuePairs) {
+ Expression v = mvp.value;
+ if (v instanceof Annotation) {
+ Annotation a = findAnnotation((Annotation) v, annotationBinding);
+ if (a != null) {
+ return a;
+ }
+ } else if (v instanceof ArrayInitializer) {
+ Expression[] expressions = ((ArrayInitializer) v).expressions;
+ for (Expression e : expressions) {
+ if (e instanceof Annotation) {
+ Annotation a = findAnnotation((Annotation) e, annotationBinding);
+ if (a != null) {
+ return a;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
public BaseMessagerImpl() {
super();
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.java
index 34863af..66c519b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchAnnotationProcessorManager.java
@@ -10,25 +10,24 @@
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.apt.dispatch;
-import org.aspectj.org.eclipse.jdt.internal.compiler.batch.Main;
-import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
import javax.annotation.processing.Processor;
import javax.tools.StandardLocation;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.*;
+import org.aspectj.org.eclipse.jdt.internal.compiler.batch.Main;
+import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
/**
* Java 6 annotation processor manager used when compiling from the command line
* or via the javax.tools.JavaCompiler interface.
- *
* @see org.aspectj.org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager
*/
-public class BatchAnnotationProcessorManager extends BaseAnnotationProcessorManager {
+public class BatchAnnotationProcessorManager extends BaseAnnotationProcessorManager
+{
/**
* Processors that have been set by calling CompilationTask.setProcessors().
@@ -56,7 +55,8 @@
* A BatchAnnotationProcessorManager cannot be used until its
* {@link #configure(Object, String[])} method has been called.
*/
- public BatchAnnotationProcessorManager() {
+ public BatchAnnotationProcessorManager()
+ {
}
@Override
@@ -75,7 +75,6 @@
/**
* If a -processor option was specified in command line arguments,
* parse it into a list of qualified classnames.
- *
* @param commandLineArguments contains one string for every space-delimited token on the command line
*/
private void parseCommandLine(String[] commandLineArguments) {
@@ -85,9 +84,11 @@
if ("-XprintProcessorInfo".equals(option)) { //$NON-NLS-1$
_printProcessorInfo = true;
_printProcessorDiscovery = VERBOSE_PROCESSOR_DISCOVERY;
- } else if ("-XprintRounds".equals(option)) { //$NON-NLS-1$
+ }
+ else if ("-XprintRounds".equals(option)) { //$NON-NLS-1$
_printRounds = true;
- } else if ("-processor".equals(option)) { //$NON-NLS-1$
+ }
+ else if ("-processor".equals(option)) { //$NON-NLS-1$
commandLineProcessors = new ArrayList<String>();
String procs = commandLineArguments[++i];
for (String proc : procs.split(",")) { //$NON-NLS-1$
@@ -104,7 +105,6 @@
@Override
public ProcessorInfo discoverNextProcessor() {
- try {
if (null != _setProcessors) {
// If setProcessors() was called, use that list until it's empty and then stop.
if (_setProcessorIter.hasNext()) {
@@ -145,14 +145,6 @@
}
// if no processors were explicitly specified with setProcessors()
// or the command line, search the processor path with ServiceLoader.
- String resPath = "META-INF/services/" + Processor.class.getName();
- Enumeration<URL> resources = _procLoader.getResources(resPath);
- if (resources != null) {
- while (resources.hasMoreElements()) {
- URL url = resources.nextElement();
- parse(url);
- }
- }
if (null == _serviceLoader) {
_serviceLoader = ServiceLoader.load(Processor.class, _procLoader);
_serviceLoaderIter = _serviceLoader.iterator();
@@ -179,66 +171,12 @@
// TODO: better error handling
throw new AbortCompilation(null, e);
}
- } catch (Throwable e) {
- throw new IllegalStateException(e);
- }
return null;
}
- private Iterator<String> parse(URL u)
- throws ServiceConfigurationError, IOException {
- InputStream in = null;
- BufferedReader r = null;
- ArrayList<String> names = new ArrayList<String>();
- try {
- in = u.openStream();
- r = new BufferedReader(new InputStreamReader(in, "utf-8"));
- int lc = 1;
- while ((lc = parseLine(r, lc, names)) >= 0) ;
- } catch (IOException x) {
- throw new IllegalStateException("Error reading configuration file", x);
- } finally {
- try {
- if (r != null) r.close();
- if (in != null) in.close();
- } catch (IOException y) {
- throw new IllegalStateException("Error closing configuration file", y);
- }
- }
- return names.iterator();
- }
-
- private int parseLine(BufferedReader r, int lc, List<String> names)
- throws IOException, ServiceConfigurationError {
- String ln = r.readLine();
- if (ln == null) {
- return -1;
- }
- int ci = ln.indexOf('#');
- if (ci >= 0) ln = ln.substring(0, ci);
- ln = ln.trim();
- int n = ln.length();
- if (n != 0) {
- if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0))
- throw new IllegalStateException("Illegal configuration-file syntax");
- int cp = ln.codePointAt(0);
- if (!Character.isJavaIdentifierStart(cp))
- throw new IllegalStateException("Illegal provider-class name: " + ln);
- for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
- cp = ln.codePointAt(i);
- if (!Character.isJavaIdentifierPart(cp) && (cp != '.'))
- throw new IllegalStateException("Illegal provider-class name: " + ln);
- }
- if (!names.contains(ln))
- names.add(ln);
- }
- return lc + 1;
- }
-
/**
* Used only for debugging purposes. Generates output like "file:jar:D:/temp/jarfiles/myJar.jar!/".
* Surely this code already exists in several hundred other places?
- *
* @return the location whence a processor class was loaded.
*/
private String getProcessorLocation(Processor p) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.java
index 1afedb4..d37e622 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/BatchFilerImpl.java
@@ -17,12 +17,14 @@
import java.io.IOException;
import java.net.URI;
import java.util.HashSet;
-import java.util.Iterator;
import javax.annotation.processing.Filer;
import javax.annotation.processing.FilerException;
import javax.lang.model.element.Element;
-import javax.tools.*;
+import javax.tools.FileObject;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardLocation;
import javax.tools.JavaFileManager.Location;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
@@ -85,13 +87,7 @@
location, pkg.toString(), relativeName.toString(), null);
URI uri = fo.toUri();
if (_createdFiles.contains(uri)) {
- Iterator<URI> it = _createdFiles.iterator();
- StringBuilder sb = new StringBuilder("\n----\n");
- while (it.hasNext()) {
- URI next = it.next();
- sb.append(next).append("\n");
- }
- throw new FilerException("createResource. Resource already created : " + location + '/' + pkg + '/' + relativeName + " --- uri = " + uri + sb.toString()); //$NON-NLS-1$
+ throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$
}
_createdFiles.add(uri);
@@ -163,7 +159,7 @@
}
URI uri = fo.toUri();
if (_createdFiles.contains(uri)) {
- throw new FilerException("getResource. Resource already created : " + location + '/' + pkg + '/' + relativeName + " --- uri = " + uri); //$NON-NLS-1$
+ throw new FilerException("Resource already created : " + location + '/' + pkg + '/' + relativeName); //$NON-NLS-1$
}
_createdFiles.add(uri);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java
index 2a88065..69ca56a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2014 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* IBM Corporation - Fix for bug 328575
+ * het@google.com - Bug 415274 - Annotation processing throws a NPE in getElementsAnnotatedWith()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.apt.dispatch;
@@ -194,6 +195,9 @@
throw new IllegalArgumentException("Argument must represent an annotation type"); //$NON-NLS-1$
}
TypeElement annoType = _processingEnv.getElementUtils().getTypeElement(canonicalName);
+ if (annoType == null) {
+ return Collections.emptySet();
+ }
return getElementsAnnotatedWith(annoType);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.java
index 91e0f28..8d38ebb 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationMirrorImpl.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * het@google.com - Bug 441790
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.apt.model;
@@ -21,6 +22,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
@@ -97,6 +99,7 @@
return true;
}
+ @Override
public DeclaredType getAnnotationType() {
return (DeclaredType) _env.getFactory().newTypeMirror(_binding.getAnnotationType());
}
@@ -105,6 +108,7 @@
* @return all the members of this annotation mirror that have explicit values.
* Default values are not included.
*/
+ @Override
public Map<? extends ExecutableElement, ? extends AnnotationValue> getElementValues() {
if (this._binding == null) {
return Collections.emptyMap();
@@ -164,6 +168,7 @@
return Collections.unmodifiableMap(valueMap);
}
+ @Override
public int hashCode() {
if (this._binding == null) return this._env.hashCode();
return this._binding.hashCode();
@@ -222,24 +227,35 @@
}
if (!foundMethod) {
// couldn't find explicit value; see if there's a default
- actualValue = methodBinding.getDefaultValue();
+ actualValue = methodBinding.getDefaultValue();
}
Class<?> expectedType = method.getReturnType();
TypeBinding actualType = methodBinding.returnType;
return getReflectionValue(actualValue, actualType, expectedType);
}
- /*
- * (non-Javadoc)
- * Sun implementation shows the values. We avoid that here,
- * because getting the values is not idempotent.
- */
@Override
- public String toString() {
- if (this._binding == null) {
- return "@any()"; //$NON-NLS-1$
+ public String toString() {
+ TypeMirror decl = getAnnotationType();
+ StringBuilder sb = new StringBuilder();
+ sb.append('@');
+ sb.append(decl.toString());
+ Map<? extends ExecutableElement, ? extends AnnotationValue> values = getElementValues();
+ if (!values.isEmpty()) {
+ sb.append('(');
+ boolean first = true;
+ for (Entry<? extends ExecutableElement, ? extends AnnotationValue> e : values.entrySet()) {
+ if (!first) {
+ sb.append(", "); //$NON-NLS-1$
+ }
+ first = false;
+ sb.append(e.getKey().getSimpleName());
+ sb.append(" = "); //$NON-NLS-1$
+ sb.append(e.getValue().toString());
+ }
+ sb.append(')');
}
- return "@" + _binding.getAnnotationType().debugName(); //$NON-NLS-1$
+ return sb.toString();
}
/**
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java
index 74b0291..96279b5 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,10 +7,12 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * het@google.com - Bug 441790
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.apt.model;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -33,6 +35,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ShouldNotImplement;
+import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
public class AnnotationValueImpl implements AnnotationValue, TypeIds {
@@ -183,7 +186,7 @@
} else if (type.isEnum()) {
if (value instanceof FieldBinding) {
kind[0] = T_EnumConstant;
- return (VariableElement) _env.getFactory().newElement((FieldBinding) value);
+ return _env.getFactory().newElement((FieldBinding) value);
} else {
kind[0] = TypeIds.T_JavaLangString;
return "<error>"; //$NON-NLS-1$
@@ -257,9 +260,46 @@
@Override
public String toString() {
- if (null == _value) {
+ if (_value == null) {
return "null"; //$NON-NLS-1$
+ } else if (_value instanceof String) {
+ String value = (String) _value;
+ StringBuffer sb = new StringBuffer();
+ sb.append('"');
+ for (int i = 0; i < value.length(); i++) {
+ Util.appendEscapedChar(sb, value.charAt(i), true);
}
+ sb.append('"');
+ return sb.toString();
+ } else if (_value instanceof Character) {
+ StringBuffer sb = new StringBuffer();
+ sb.append('\'');
+ Util.appendEscapedChar(sb, ((Character) _value).charValue(), false);
+ sb.append('\'');
+ return sb.toString();
+ } else if (_value instanceof VariableElement) {
+ VariableElement enumDecl = (VariableElement) _value;
+ return enumDecl.asType().toString() + "." + enumDecl.getSimpleName(); //$NON-NLS-1$
+ } else if (_value instanceof Collection) {
+ // It must be Collection<AnnotationValue>
+ @SuppressWarnings("unchecked")
+ Collection<AnnotationValue> values = (Collection<AnnotationValue>) _value;
+ StringBuilder sb = new StringBuilder();
+ sb.append('{');
+ boolean first = true;
+ for (AnnotationValue annoValue : values) {
+ if (!first) {
+ sb.append(", "); //$NON-NLS-1$
+ }
+ first = false;
+ sb.append(annoValue.toString());
+ }
+ sb.append('}');
+ return sb.toString();
+ } else if (_value instanceof TypeMirror) {
+ return _value.toString() + ".class"; //$NON-NLS-1$
+ } else {
return _value.toString();
}
}
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java
index 4b7a9b4..fe70420 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java
@@ -598,6 +598,8 @@
case TYPE_PARAMETER :
case LOCAL_VARIABLE :
return null;
+ default:
+ break;
}
// unreachable
return null;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java
index 6b3b128..5733bd2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/NoTypeImpl.java
@@ -23,7 +23,7 @@
import javax.lang.model.type.TypeVisitor;
/**
- * An implementation of NoType, which is used to represent certain psuedo-types.
+ * An implementation of NoType, which is used to represent certain pseudo-types.
* @see NoType
*/
public class NoTypeImpl implements NoType, NullType
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java
index 68b348b..dfac3fd 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/model/TypesImpl.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 BEA Systems, Inc. and others
+ * Copyright (c) 2007 - 2012 BEA Systems, Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * wharley@bea.com - initial API and implementation
+ * Walter Harley - initial API and implementation
* IBM Corporation - fix for 342598
*******************************************************************************/
@@ -37,6 +37,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
@@ -72,9 +73,6 @@
return null;
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#asMemberOf(javax.lang.model.type.DeclaredType, javax.lang.model.element.Element)
- */
@Override
public TypeMirror asMemberOf(DeclaredType containing, Element element) {
// throw new UnsupportedOperationException("NYI: TypesImpl.asMemberOf(" + containing + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -85,51 +83,54 @@
case CONSTRUCTOR :
case METHOD :
MethodBinding methodBinding = (MethodBinding) elementImpl._binding;
- if (TypeBinding.notEquals(methodBinding.declaringClass, referenceBinding)) {
- throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
- }
+ while (referenceBinding != null) {
for (MethodBinding method : referenceBinding.methods()) {
if (CharOperation.equals(method.selector, methodBinding.selector)
&& method.areParameterErasuresEqual(methodBinding)) {
return this._env.getFactory().newTypeMirror(method);
}
}
+ referenceBinding = referenceBinding.superclass();
+ }
break;
case FIELD :
case ENUM_CONSTANT:
FieldBinding fieldBinding = (FieldBinding) elementImpl._binding;
- if (TypeBinding.notEquals(fieldBinding.declaringClass, referenceBinding)) {
- throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
- }
+ while (referenceBinding != null) {
for (FieldBinding field : referenceBinding.fields()) {
if (CharOperation.equals(field.name, fieldBinding.name)) {
return this._env.getFactory().newTypeMirror(field);
}
}
+ referenceBinding = referenceBinding.superclass();
+ }
break;
case ENUM :
case ANNOTATION_TYPE :
case INTERFACE :
case CLASS :
- ReferenceBinding referenceBinding2 = (ReferenceBinding) elementImpl._binding;
- if (TypeBinding.notEquals(referenceBinding2.enclosingType(), referenceBinding)) {
- throw new IllegalArgumentException("element is not valid for the containing declared type"); //$NON-NLS-1$
+ ReferenceBinding elementBinding = (ReferenceBinding) elementImpl._binding;
+ while (referenceBinding != null) {
+ // If referenceBinding is a ParameterizedTypeBinding, this will return only ParameterizedTypeBindings
+ // for member types, even if the member happens to be a static nested class. That's probably a bug;
+ // static nested classes are not parameterized by their outer class.
+ for (ReferenceBinding memberReferenceBinding : referenceBinding.memberTypes()) {
+ if (CharOperation.equals(elementBinding.compoundName, memberReferenceBinding.compoundName)) {
+ return this._env.getFactory().newTypeMirror(memberReferenceBinding);
}
- for (ReferenceBinding referenceBinding3 : referenceBinding.memberTypes()) {
- if (CharOperation.equals(referenceBinding3.compoundName, referenceBinding3.compoundName)) {
- return this._env.getFactory().newTypeMirror(referenceBinding3);
}
+ referenceBinding = referenceBinding.superclass();
}
break;
default:
- break;
+ throw new IllegalArgumentException("element " + element + //$NON-NLS-1$
+ " has unrecognized element kind " + element.getKind()); //$NON-NLS-1$
}
- throw new IllegalArgumentException("element is not valid for the containing declared type: element kind " + element.getKind()); //$NON-NLS-1$
+ throw new IllegalArgumentException("element " + element + //$NON-NLS-1$
+ " is not a member of the containing type " + containing + //$NON-NLS-1$
+ " nor any of its superclasses"); //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#boxedClass(javax.lang.model.type.PrimitiveType)
- */
@Override
public TypeElement boxedClass(PrimitiveType p) {
PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p;
@@ -138,17 +139,11 @@
return (TypeElement) _env.getFactory().newElement(boxed);
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#capture(javax.lang.model.type.TypeMirror)
- */
@Override
public TypeMirror capture(TypeMirror t) {
throw new UnsupportedOperationException("NYI: TypesImpl.capture(...)"); //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#contains(javax.lang.model.type.TypeMirror, javax.lang.model.type.TypeMirror)
- */
@Override
public boolean contains(TypeMirror t1, TypeMirror t2) {
switch(t1.getKind()) {
@@ -168,9 +163,6 @@
throw new UnsupportedOperationException("NYI: TypesImpl.contains(" + t1 + ", " + t2 + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#directSupertypes(javax.lang.model.type.TypeMirror)
- */
@Override
public List<? extends TypeMirror> directSupertypes(TypeMirror t) {
switch(t.getKind()) {
@@ -197,9 +189,6 @@
return Collections.emptyList();
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#erasure(javax.lang.model.type.TypeMirror)
- */
@Override
public TypeMirror erasure(TypeMirror t) {
TypeMirrorImpl typeMirrorImpl = (TypeMirrorImpl) t;
@@ -217,9 +206,6 @@
return t;
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#getArrayType(javax.lang.model.type.TypeMirror)
- */
@Override
public ArrayType getArrayType(TypeMirror componentType) {
TypeMirrorImpl typeMirrorImpl = (TypeMirrorImpl) componentType;
@@ -230,20 +216,25 @@
typeBinding.dimensions() + 1));
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#getDeclaredType(javax.lang.model.element.TypeElement, javax.lang.model.type.TypeMirror[])
+ /*
+ * (non-Javadoc)
+ * Create a type instance by parameterizing a type element. If the element is a member type,
+ * its container must not be generic (if it were, you would need to use the form of
+ * getDeclaredType that takes a container TypeMirror). If typeArgs is empty, and typeElem
+ * is not generic, then you should use TypeElem.asType(). If typeArgs is empty and typeElem
+ * is generic, this method will create the raw type.
*/
@Override
public DeclaredType getDeclaredType(TypeElement typeElem, TypeMirror... typeArgs) {
int typeArgsLength = typeArgs.length;
TypeElementImpl typeElementImpl = (TypeElementImpl) typeElem;
- ReferenceBinding referenceBinding = (ReferenceBinding) typeElementImpl._binding;
- TypeVariableBinding[] typeVariables = referenceBinding.typeVariables();
+ ReferenceBinding elementBinding = (ReferenceBinding) typeElementImpl._binding;
+ TypeVariableBinding[] typeVariables = elementBinding.typeVariables();
int typeVariablesLength = typeVariables.length;
if (typeArgsLength == 0) {
- if (referenceBinding.isGenericType()) {
- // must return a raw type
- return (DeclaredType) _env.getFactory().newTypeMirror(this._env.getLookupEnvironment().createRawType(referenceBinding, null));
+ if (elementBinding.isGenericType()) {
+ // per javadoc,
+ return (DeclaredType) _env.getFactory().newTypeMirror(this._env.getLookupEnvironment().createRawType(elementBinding, null));
}
return (DeclaredType)typeElem.asType();
} else if (typeArgsLength != typeVariablesLength) {
@@ -259,29 +250,38 @@
typeArguments[i] = (TypeBinding) binding;
}
return (DeclaredType) _env.getFactory().newTypeMirror(
- this._env.getLookupEnvironment().createParameterizedType(referenceBinding, typeArguments, null));
+ this._env.getLookupEnvironment().createParameterizedType(elementBinding, typeArguments, null));
}
/* (non-Javadoc)
- * @see javax.lang.model.util.Types#getDeclaredType(javax.lang.model.type.DeclaredType, javax.lang.model.element.TypeElement, javax.lang.model.type.TypeMirror[])
+ * Create a specific type from a member element. The containing type can be parameterized,
+ * e.g. Outer<String>.Inner, but it cannot be generic, i.e., Outer<T>.Inner. It only makes
+ * sense to use this method when the member element is parameterized by its container; so,
+ * for example, it makes sense for an inner class but not for a static member class.
+ * Otherwise you should just use getDeclaredType(TypeElement, TypeMirror ...), if you need
+ * to specify type arguments, or TypeElement.asType() directly, if not.
*/
@Override
public DeclaredType getDeclaredType(DeclaredType containing, TypeElement typeElem,
TypeMirror... typeArgs) {
int typeArgsLength = typeArgs.length;
TypeElementImpl typeElementImpl = (TypeElementImpl) typeElem;
- ReferenceBinding referenceBinding = (ReferenceBinding) typeElementImpl._binding;
- TypeVariableBinding[] typeVariables = referenceBinding.typeVariables();
+ ReferenceBinding elementBinding = (ReferenceBinding) typeElementImpl._binding;
+ TypeVariableBinding[] typeVariables = elementBinding.typeVariables();
int typeVariablesLength = typeVariables.length;
DeclaredTypeImpl declaredTypeImpl = (DeclaredTypeImpl) containing;
ReferenceBinding enclosingType = (ReferenceBinding) declaredTypeImpl._binding;
if (typeArgsLength == 0) {
- if (referenceBinding.isGenericType()) {
- // must return a raw type
- return (DeclaredType) _env.getFactory().newTypeMirror(this._env.getLookupEnvironment().createRawType(referenceBinding, enclosingType));
+ if (elementBinding.isGenericType()) {
+ // e.g., Outer.Inner<T> but T is not specified
+ // Per javadoc on interface, must return the raw type Outer.Inner
+ return (DeclaredType) _env.getFactory().newTypeMirror(
+ _env.getLookupEnvironment().createRawType(elementBinding, enclosingType));
+ } else {
+ // e.g., Outer<Long>.Inner
+ ParameterizedTypeBinding ptb = _env.getLookupEnvironment().createParameterizedType(elementBinding, null, enclosingType);
+ return (DeclaredType) _env.getFactory().newTypeMirror(ptb);
}
- // TODO (see how to create a member type binding
- throw new UnsupportedOperationException("NYI: TypesImpl.getDeclaredType(...) for member types"); //$NON-NLS-1$
} else if (typeArgsLength != typeVariablesLength) {
throw new IllegalArgumentException("Number of typeArguments doesn't match the number of formal parameters of typeElem"); //$NON-NLS-1$
}
@@ -295,7 +295,7 @@
typeArguments[i] = (TypeBinding) binding;
}
return (DeclaredType) _env.getFactory().newTypeMirror(
- this._env.getLookupEnvironment().createParameterizedType(referenceBinding, typeArguments, enclosingType));
+ this._env.getLookupEnvironment().createParameterizedType(elementBinding, typeArguments, enclosingType));
}
@Override
@@ -303,25 +303,16 @@
return _env.getFactory().getNoType(kind);
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#getNullType()
- */
@Override
public NullType getNullType() {
return _env.getFactory().getNullType();
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#getPrimitiveType(javax.lang.model.type.TypeKind)
- */
@Override
public PrimitiveType getPrimitiveType(TypeKind kind) {
return _env.getFactory().getPrimitiveType(kind);
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#getWildcardType(javax.lang.model.type.TypeMirror, javax.lang.model.type.TypeMirror)
- */
@Override
public WildcardType getWildcardType(TypeMirror extendsBound, TypeMirror superBound) {
if (extendsBound != null && superBound != null) {
@@ -356,7 +347,7 @@
Wildcard.UNBOUND));
}
- /**
+ /* (non-Javadoc)
* @return true if a value of type t1 can be assigned to a variable of type t2, i.e., t2 = t1.
*/
@Override
@@ -378,9 +369,6 @@
return null != convertedType && convertedType.isCompatibleWith((TypeBinding)b2);
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#isSameType(javax.lang.model.type.TypeMirror, javax.lang.model.type.TypeMirror)
- */
@Override
public boolean isSameType(TypeMirror t1, TypeMirror t2) {
if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) {
@@ -409,9 +397,6 @@
return CharOperation.equals(type1.computeUniqueKey(), type2.computeUniqueKey());
}
- /* (non-Javadoc)
- * @see javax.lang.model.util.Types#isSubsignature(javax.lang.model.type.ExecutableType, javax.lang.model.type.ExecutableType)
- */
@Override
public boolean isSubsignature(ExecutableType m1, ExecutableType m2) {
MethodBinding methodBinding1 = (MethodBinding) ((ExecutableTypeImpl) m1)._binding;
@@ -421,7 +406,7 @@
return methodBinding1.areParameterErasuresEqual(methodBinding2) && methodBinding1.areTypeVariableErasuresEqual(methodBinding2);
}
- /**
+ /* (non-Javadoc)
* @return true if t1 is a subtype of t2, or if t1 == t2.
*/
@Override
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.java
index fdd7f04..5c21b1b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Archive.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,8 +14,10 @@
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
@@ -30,20 +32,22 @@
ZipFile zipFile;
File file;
+
protected Hashtable<String, ArrayList<String>> packagesCache;
private Archive() {
+ // used to construct UNKNOWN_ARCHIVE
}
public Archive(File file) throws ZipException, IOException {
this.file = file;
this.zipFile = new ZipFile(file);
- initialize();
+ initialize();
}
private void initialize() {
// initialize packages
- this.packagesCache = new Hashtable<String, ArrayList<String>>();
+ this.packagesCache = new Hashtable<>();
nextEntry : for (Enumeration<? extends ZipEntry> e = this.zipFile.entries(); e.hasMoreElements(); ) {
String fileName = ((ZipEntry) e.nextElement()).getName();
@@ -58,7 +62,7 @@
if (typeName.length() == 0) {
continue nextEntry;
}
- types = new ArrayList<String>();
+ types = new ArrayList<>();
types.add(typeName);
this.packagesCache.put(packageName, types);
} else {
@@ -68,7 +72,7 @@
}
public ArchiveFileObject getArchiveFileObject(String entryName, Charset charset) {
- return new ArchiveFileObject(this.file, this.zipFile, entryName, charset);
+ return new ArchiveFileObject(this.file, entryName, charset);
}
public boolean contains(String entryName) {
@@ -82,8 +86,16 @@
return this.packagesCache.keySet();
}
- public ArrayList<String> getTypes(String packageName) {
+ public List<String> getTypes(String packageName) {
// package name is expected to ends with '/'
+ if (this.packagesCache == null) {
+ try {
+ this.zipFile = new ZipFile(this.file);
+ } catch(IOException e) {
+ return Collections.<String>emptyList();
+ }
+ this.initialize();
+ }
return this.packagesCache.get(packageName);
}
@@ -93,10 +105,17 @@
public void close() {
try {
- if (this.zipFile != null) this.zipFile.close();
+ if (this.zipFile != null) {
+ this.zipFile.close();
+ }
this.packagesCache = null;
} catch (IOException e) {
// ignore
}
}
+
+ @Override
+ public String toString() {
+ return "Archive: " + (this.file == null ? "UNKNOWN_ARCHIVE" : this.file.getAbsolutePath()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.java
index 488c709..053e4bf 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/ArchiveFileObject.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,23 +34,33 @@
* Implementation of a Java file object that corresponds to an entry in a zip/jar file
*/
public class ArchiveFileObject implements JavaFileObject {
- private ZipEntry zipEntry;
- private ZipFile zipFile;
private String entryName;
private File file;
+ private ZipFile zipFile;
private Charset charset;
-
- public ArchiveFileObject(File file, ZipFile zipFile, String entryName, Charset charset) {
- this.zipFile = zipFile;
- this.zipEntry = zipFile.getEntry(entryName);
+
+ public ArchiveFileObject(File file, String entryName, Charset charset) {
this.entryName = entryName;
this.file = file;
this.charset = charset;
}
+ @Override
+ protected void finalize() throws Throwable {
+ if (this.zipFile != null) {
+ try {
+ this.zipFile.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ super.finalize();
+ }
+
/* (non-Javadoc)
* @see javax.tools.JavaFileObject#getAccessLevel()
*/
+ @Override
public Modifier getAccessLevel() {
// cannot express multiple modifier
if (getKind() != Kind.CLASS) {
@@ -58,12 +68,15 @@
}
ClassFileReader reader = null;
try {
- reader = ClassFileReader.read(this.zipFile, this.entryName);
+ try (ZipFile zip = new ZipFile(this.file)) {
+ reader = ClassFileReader.read(zip, this.entryName);
+ }
} catch (ClassFormatException e) {
// ignore
} catch (IOException e) {
// ignore
}
+
if (reader == null) {
return null;
}
@@ -83,6 +96,7 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileObject#getKind()
*/
+ @Override
public Kind getKind() {
String name = this.entryName.toLowerCase();
if (name.endsWith(Kind.CLASS.extension)) {
@@ -98,51 +112,57 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileObject#getNestingKind()
*/
+ @Override
public NestingKind getNestingKind() {
switch(getKind()) {
- case SOURCE :
- return NestingKind.TOP_LEVEL;
- case CLASS :
- ClassFileReader reader = null;
- try {
- reader = ClassFileReader.read(this.zipFile, this.entryName);
- } catch (ClassFormatException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
- if (reader == null) {
- return null;
- }
- if (reader.isAnonymous()) {
- return NestingKind.ANONYMOUS;
- }
- if (reader.isLocal()) {
- return NestingKind.LOCAL;
- }
- if (reader.isMember()) {
- return NestingKind.MEMBER;
- }
- return NestingKind.TOP_LEVEL;
- default:
- return null;
+ case SOURCE :
+ return NestingKind.TOP_LEVEL;
+ case CLASS :
+ ClassFileReader reader = null;
+ try {
+ try (ZipFile zip = new ZipFile(this.file)) {
+ reader = ClassFileReader.read(zip, this.entryName);
+ }
+ } catch (ClassFormatException e) {
+ // ignore
+ } catch (IOException e) {
+ // ignore
+ }
+ if (reader == null) {
+ return null;
+ }
+ if (reader.isAnonymous()) {
+ return NestingKind.ANONYMOUS;
+ }
+ if (reader.isLocal()) {
+ return NestingKind.LOCAL;
+ }
+ if (reader.isMember()) {
+ return NestingKind.MEMBER;
+ }
+ return NestingKind.TOP_LEVEL;
+ default:
+ return null;
}
}
/* (non-Javadoc)
* @see javax.tools.JavaFileObject#isNameCompatible(java.lang.String, javax.tools.JavaFileObject.Kind)
*/
+ @Override
public boolean isNameCompatible(String simpleName, Kind kind) {
- return this.zipEntry.getName().endsWith(simpleName + kind.extension);
+ return this.entryName.endsWith(simpleName + kind.extension);
}
/* (non-Javadoc)
* @see javax.tools.FileObject#delete()
*/
+ @Override
public boolean delete() {
throw new UnsupportedOperationException();
}
+ @Override
public boolean equals(Object o) {
if (!(o instanceof ArchiveFileObject)) {
return false;
@@ -151,12 +171,21 @@
return archiveFileObject.toUri().equals(this.toUri());
}
+ @Override
+ public int hashCode() {
+ return this.toUri().hashCode();
+ }
+
/* (non-Javadoc)
* @see javax.tools.FileObject#getCharContent(boolean)
*/
+ @Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
if (getKind() == Kind.SOURCE) {
- return Util.getCharContents(this, ignoreEncodingErrors, org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(this.zipEntry, this.zipFile), this.charset.name());
+ try (ZipFile zipFile2 = new ZipFile(this.file)) {
+ ZipEntry zipEntry = zipFile2.getEntry(this.entryName);
+ return Util.getCharContents(this, ignoreEncodingErrors, org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zipEntry, zipFile2), this.charset.name());
+ }
}
return null;
}
@@ -164,27 +193,41 @@
/* (non-Javadoc)
* @see javax.tools.FileObject#getLastModified()
*/
+ @Override
public long getLastModified() {
- return this.zipEntry.getTime(); // looks the closest from the last modification
+ try (ZipFile zip = new ZipFile(this.file)) {
+ ZipEntry zipEntry = zip.getEntry(this.entryName);
+ return zipEntry.getTime(); // looks the closest from the last modification
+ } catch(IOException e) {
+ // ignore
+ }
+ return 0;
}
/* (non-Javadoc)
* @see javax.tools.FileObject#getName()
*/
+ @Override
public String getName() {
- return this.zipEntry.getName();
+ return this.entryName;
}
/* (non-Javadoc)
* @see javax.tools.FileObject#openInputStream()
*/
+ @Override
public InputStream openInputStream() throws IOException {
- return this.zipFile.getInputStream(this.zipEntry);
+ if (this.zipFile == null) {
+ this.zipFile = new ZipFile(this.file);
+ }
+ ZipEntry zipEntry = this.zipFile.getEntry(this.entryName);
+ return this.zipFile.getInputStream(zipEntry);
}
/* (non-Javadoc)
* @see javax.tools.FileObject#openOutputStream()
*/
+ @Override
public OutputStream openOutputStream() throws IOException {
throw new UnsupportedOperationException();
}
@@ -192,6 +235,7 @@
/* (non-Javadoc)
* @see javax.tools.FileObject#openReader(boolean)
*/
+ @Override
public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
throw new UnsupportedOperationException();
}
@@ -199,6 +243,7 @@
/* (non-Javadoc)
* @see javax.tools.FileObject#openWriter()
*/
+ @Override
public Writer openWriter() throws IOException {
throw new UnsupportedOperationException();
}
@@ -206,17 +251,18 @@
/* (non-Javadoc)
* @see javax.tools.FileObject#toUri()
*/
+ @Override
public URI toUri() {
try {
- return new URI("jar:" + this.file.toURI().getPath() + "!" + this.zipEntry.getName()); //$NON-NLS-1$//$NON-NLS-2$
+ return new URI("jar:" + this.file.toURI().getPath() + "!" + this.entryName); //$NON-NLS-1$//$NON-NLS-2$
} catch (URISyntaxException e) {
return null;
}
}
-
- @Override
- public String toString() {
- return this.file.getAbsolutePath() + "[" + this.zipEntry.getName() + "]";//$NON-NLS-1$//$NON-NLS-2$
- }
+
+ @Override
+ public String toString() {
+ return this.file.getAbsolutePath() + "[" + this.entryName + "]";//$NON-NLS-1$//$NON-NLS-2$
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java
index cc8c787..b802f36 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2014 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
@@ -33,9 +34,9 @@
import javax.tools.FileObject;
import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
-import javax.tools.JavaFileObject.Kind;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem;
@@ -67,8 +68,8 @@
public EclipseFileManager(Locale locale, Charset charset) {
this.locale = locale == null ? Locale.getDefault() : locale;
this.charset = charset == null ? Charset.defaultCharset() : charset;
- this.locations = new HashMap<String, Iterable<? extends File>>();
- this.archivesCache = new HashMap<File, Archive>();
+ this.locations = new HashMap<>();
+ this.archivesCache = new HashMap<>();
try {
this.setLocation(StandardLocation.PLATFORM_CLASS_PATH, getDefaultBootclasspath());
Iterable<? extends File> defaultClasspath = getDefaultClasspath();
@@ -84,55 +85,16 @@
}
}
- private void addFiles(File[][] jars, ArrayList<File> files) {
- if (jars != null) {
- for (File[] currentJars : jars) {
- if (currentJars != null) {
- for (File currentJar : currentJars) {
- if (currentJar.exists()) {
- files.add(currentJar);
- }
- }
- }
- }
- }
- }
-
-
- private void addFilesFrom(File javaHome, String propertyName, String defaultPath, ArrayList<File> files) {
- String extdirsStr = System.getProperty(propertyName);
- File[] directoriesToCheck = null;
- if (extdirsStr == null) {
- if (javaHome != null) {
- directoriesToCheck = new File[] { new File(javaHome, defaultPath) };
- }
- } else {
- StringTokenizer tokenizer = new StringTokenizer(extdirsStr, File.pathSeparator);
- ArrayList<String> paths = new ArrayList<String>();
- while (tokenizer.hasMoreTokens()) {
- paths.add(tokenizer.nextToken());
- }
- if (paths.size() != 0) {
- directoriesToCheck = new File[paths.size()];
- for (int i = 0; i < directoriesToCheck.length; i++) {
- directoriesToCheck[i] = new File(paths.get(i));
- }
- }
- }
- if (directoriesToCheck != null) {
- addFiles(Main.getLibrariesFiles(directoriesToCheck), files);
- }
-
- }
-
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#close()
*/
+ @Override
public void close() throws IOException {
- this.locations = null;
+ if (this.locations != null) this.locations.clear();
for (Archive archive : this.archivesCache.values()) {
archive.close();
}
+ this.archivesCache.clear();
}
private void collectAllMatchingFiles(File file, String normalizedPackageName, Set<Kind> kinds, boolean recurse, ArrayList<JavaFileObject> collector) {
@@ -165,6 +127,7 @@
}
} else {
Archive archive = this.getArchive(file);
+ if (archive == Archive.UNKNOWN_ARCHIVE) return;
String key = normalizedPackageName;
if (!normalizedPackageName.endsWith("/")) {//$NON-NLS-1$
key += '/';
@@ -173,7 +136,7 @@
if (recurse) {
for (String packageName : archive.allPackages()) {
if (packageName.startsWith(key)) {
- ArrayList<String> types = archive.getTypes(packageName);
+ List<String> types = archive.getTypes(packageName);
if (types != null) {
for (String typeName : types) {
final Kind kind = getKind(getExtension(typeName));
@@ -185,12 +148,12 @@
}
}
} else {
- ArrayList<String> types = archive.getTypes(key);
+ List<String> types = archive.getTypes(key);
if (types != null) {
for (String typeName : types) {
- final Kind kind = getKind(typeName);
+ final Kind kind = getKind(getExtension(typeName));
if (kinds.contains(kind)) {
- collector.add(archive.getArchiveFileObject(normalizedPackageName + typeName, this.charset));
+ collector.add(archive.getArchiveFileObject(key + typeName, this.charset));
}
}
}
@@ -199,7 +162,7 @@
}
private Iterable<? extends File> concatFiles(Iterable<? extends File> iterable, Iterable<? extends File> iterable2) {
- ArrayList<File> list = new ArrayList<File>();
+ ArrayList<File> list = new ArrayList<>();
if (iterable2 == null) return iterable;
for (Iterator<? extends File> iterator = iterable.iterator(); iterator.hasNext(); ) {
list.add(iterator.next());
@@ -213,6 +176,7 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#flush()
*/
+ @Override
public void flush() throws IOException {
for (Archive archive : this.archivesCache.values()) {
archive.flush();
@@ -223,23 +187,21 @@
// check the archive (jar/zip) cache
Archive archive = this.archivesCache.get(f);
if (archive == null) {
+ archive = Archive.UNKNOWN_ARCHIVE;
// create a new archive
if (f.exists()) {
- try {
- archive = new Archive(f);
- } catch (ZipException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
- if (archive != null) {
- this.archivesCache.put(f, archive);
- } else {
- this.archivesCache.put(f, Archive.UNKNOWN_ARCHIVE);
- }
- } else {
- this.archivesCache.put(f, Archive.UNKNOWN_ARCHIVE);
+ try {
+ archive = new Archive(f);
+ } catch (ZipException e) {
+ // ignore
+ } catch (IOException e) {
+ // ignore
+ }
+ if (archive != null) {
+ this.archivesCache.put(f, archive);
+ }
}
+ this.archivesCache.put(f, archive);
}
return archive;
}
@@ -247,13 +209,14 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#getClassLoader(javax.tools.JavaFileManager.Location)
*/
+ @Override
public ClassLoader getClassLoader(Location location) {
Iterable<? extends File> files = getLocation(location);
if (files == null) {
// location is unknown
return null;
}
- ArrayList<URL> allURLs = new ArrayList<URL>();
+ ArrayList<URL> allURLs = new ArrayList<>();
for (File f : files) {
try {
allURLs.add(f.toURI().toURL());
@@ -267,8 +230,8 @@
}
private Iterable<? extends File> getPathsFrom(String path) {
- ArrayList<FileSystem.Classpath> paths = new ArrayList<FileSystem.Classpath>();
- ArrayList<File> files = new ArrayList<File>();
+ ArrayList<FileSystem.Classpath> paths = new ArrayList<>();
+ ArrayList<File> files = new ArrayList<>();
try {
this.processPathEntries(Main.DEFAULT_SIZE_CLASSPATH, paths, path, this.charset.name(), false, false);
} catch (IllegalArgumentException e) {
@@ -281,7 +244,7 @@
}
Iterable<? extends File> getDefaultBootclasspath() {
- ArrayList<File> files = new ArrayList<File>();
+ List<File> files = new ArrayList<>();
String javaversion = System.getProperty("java.version");//$NON-NLS-1$
if(javaversion.length() > 3)
javaversion = javaversion.substring(0, 3);
@@ -291,37 +254,15 @@
return null;
}
- /*
- * Handle >= JDK 1.6
- */
- String javaHome = System.getProperty("java.home"); //$NON-NLS-1$
- File javaHomeFile = null;
- if (javaHome != null) {
- javaHomeFile = new File(javaHome);
- if (!javaHomeFile.exists())
- javaHomeFile = null;
+ for (String fileName : org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.collectFilesNames()) {
+ files.add(new File(fileName));
}
-
- addFilesFrom(javaHomeFile, "java.endorsed.dirs", "/lib/endorsed", files);//$NON-NLS-1$//$NON-NLS-2$
- if (javaHomeFile != null) {
- File[] directoriesToCheck = null;
- if (System.getProperty("os.name").startsWith("Mac")) {//$NON-NLS-1$//$NON-NLS-2$
- directoriesToCheck = new File[] { new File(javaHomeFile, "../Classes"), //$NON-NLS-1$
- };
- } else {
- directoriesToCheck = new File[] { new File(javaHomeFile, "lib") //$NON-NLS-1$
- };
- }
- File[][] jars = Main.getLibrariesFiles(directoriesToCheck);
- addFiles(jars, files);
- }
- addFilesFrom(javaHomeFile, "java.ext.dirs", "/lib/ext", files);//$NON-NLS-1$//$NON-NLS-2$
return files;
}
Iterable<? extends File> getDefaultClasspath() {
// default classpath
- ArrayList<File> files = new ArrayList<File>();
+ ArrayList<File> files = new ArrayList<>();
String classProp = System.getProperty("java.class.path"); //$NON-NLS-1$
if ((classProp == null) || (classProp.length() == 0)) {
return null;
@@ -340,8 +281,8 @@
}
private Iterable<? extends File> getEndorsedDirsFrom(String path) {
- ArrayList<FileSystem.Classpath> paths = new ArrayList<FileSystem.Classpath>();
- ArrayList<File> files = new ArrayList<File>();
+ ArrayList<FileSystem.Classpath> paths = new ArrayList<>();
+ ArrayList<File> files = new ArrayList<>();
try {
this.processPathEntries(Main.DEFAULT_SIZE_CLASSPATH, paths, path, this.charset.name(), false, false);
} catch (IllegalArgumentException e) {
@@ -354,8 +295,8 @@
}
private Iterable<? extends File> getExtdirsFrom(String path) {
- ArrayList<FileSystem.Classpath> paths = new ArrayList<FileSystem.Classpath>();
- ArrayList<File> files = new ArrayList<File>();
+ ArrayList<FileSystem.Classpath> paths = new ArrayList<>();
+ ArrayList<File> files = new ArrayList<>();
try {
this.processPathEntries(Main.DEFAULT_SIZE_CLASSPATH, paths, path, this.charset.name(), false, false);
} catch (IllegalArgumentException e) {
@@ -382,12 +323,13 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#getFileForInput(javax.tools.JavaFileManager.Location, java.lang.String, java.lang.String)
*/
+ @Override
public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException {
Iterable<? extends File> files = getLocation(location);
if (files == null) {
throw new IllegalArgumentException("Unknown location : " + location);//$NON-NLS-1$
}
- String normalizedFileName = normalized(packageName) + '/' + relativeName.replace('\\', '/');
+ String normalizedFileName = normalizedFileName(packageName, relativeName);
for (File file : files) {
if (file.isDirectory()) {
// handle directory
@@ -409,10 +351,21 @@
}
return null;
}
-
+
+ private String normalizedFileName(String packageName, String relativeName) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(normalized(packageName));
+ if (sb.length() > 0) {
+ sb.append('/');
+ }
+ sb.append(relativeName.replace('\\', '/'));
+ return sb.toString();
+ }
+
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#getFileForOutput(javax.tools.JavaFileManager.Location, java.lang.String, java.lang.String, javax.tools.FileObject)
*/
+ @Override
public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling)
throws IOException {
Iterable<? extends File> files = getLocation(location);
@@ -433,6 +386,7 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#getJavaFileForInput(javax.tools.JavaFileManager.Location, java.lang.String, javax.tools.JavaFileObject.Kind)
*/
+ @Override
public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException {
if (kind != Kind.CLASS && kind != Kind.SOURCE) {
throw new IllegalArgumentException("Invalid kind : " + kind);//$NON-NLS-1$
@@ -468,6 +422,7 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#getJavaFileForOutput(javax.tools.JavaFileManager.Location, java.lang.String, javax.tools.JavaFileObject.Kind, javax.tools.FileObject)
*/
+ @Override
public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling)
throws IOException {
if (kind != Kind.CLASS && kind != Kind.SOURCE) {
@@ -522,6 +477,7 @@
/* (non-Javadoc)
* @see javax.tools.StandardJavaFileManager#getJavaFileObjects(java.io.File[])
*/
+ @Override
public Iterable<? extends JavaFileObject> getJavaFileObjects(File... files) {
return getJavaFileObjectsFromFiles(Arrays.asList(files));
}
@@ -529,6 +485,7 @@
/* (non-Javadoc)
* @see javax.tools.StandardJavaFileManager#getJavaFileObjects(java.lang.String[])
*/
+ @Override
public Iterable<? extends JavaFileObject> getJavaFileObjects(String... names) {
return getJavaFileObjectsFromStrings(Arrays.asList(names));
}
@@ -536,8 +493,9 @@
/* (non-Javadoc)
* @see javax.tools.StandardJavaFileManager#getJavaFileObjectsFromFiles(java.lang.Iterable)
*/
+ @Override
public Iterable<? extends JavaFileObject> getJavaFileObjectsFromFiles(Iterable<? extends File> files) {
- ArrayList<JavaFileObject> javaFileArrayList = new ArrayList<JavaFileObject>();
+ ArrayList<JavaFileObject> javaFileArrayList = new ArrayList<>();
for (File f : files) {
if (f.isDirectory()) {
throw new IllegalArgumentException("file : " + f.getAbsolutePath() + " is a directory"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -550,8 +508,9 @@
/* (non-Javadoc)
* @see javax.tools.StandardJavaFileManager#getJavaFileObjectsFromStrings(java.lang.Iterable)
*/
+ @Override
public Iterable<? extends JavaFileObject> getJavaFileObjectsFromStrings(Iterable<String> names) {
- ArrayList<File> files = new ArrayList<File>();
+ ArrayList<File> files = new ArrayList<>();
for (String name : names) {
files.add(new File(name));
}
@@ -576,6 +535,7 @@
/* (non-Javadoc)
* @see javax.tools.StandardJavaFileManager#getLocation(javax.tools.JavaFileManager.Location)
*/
+ @Override
public Iterable<? extends File> getLocation(Location location) {
if (this.locations == null) return null;
return this.locations.get(location.getName());
@@ -589,7 +549,7 @@
if (file.exists() && !file.isDirectory()) {
throw new IllegalArgumentException("file : " + file.getAbsolutePath() + " is not a directory");//$NON-NLS-1$//$NON-NLS-2$
}
- ArrayList<File> list = new ArrayList<File>(1);
+ ArrayList<File> list = new ArrayList<>(1);
list.add(file);
return list;
}
@@ -597,19 +557,19 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#handleOption(java.lang.String, java.util.Iterator)
*/
+ @Override
public boolean handleOption(String current, Iterator<String> remaining) {
try {
if ("-bootclasspath".equals(current)) {//$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> bootclasspaths = getPathsFrom(remaining.next());
if (bootclasspaths != null) {
Iterable<? extends File> iterable = getLocation(StandardLocation.PLATFORM_CLASS_PATH);
- if ((this.flags & HAS_ENDORSED_DIRS) == 0
- && (this.flags & HAS_EXT_DIRS) == 0) {
+ if ((this.flags & EclipseFileManager.HAS_ENDORSED_DIRS) == 0
+ && (this.flags & EclipseFileManager.HAS_EXT_DIRS) == 0) {
// override default bootclasspath
setLocation(StandardLocation.PLATFORM_CLASS_PATH, bootclasspaths);
- } else if ((this.flags & HAS_ENDORSED_DIRS) != 0) {
+ } else if ((this.flags & EclipseFileManager.HAS_ENDORSED_DIRS) != 0) {
// endorseddirs have been processed first
setLocation(StandardLocation.PLATFORM_CLASS_PATH,
concatFiles(iterable, bootclasspaths));
@@ -619,15 +579,13 @@
prependFiles(iterable, bootclasspaths));
}
}
- remaining.remove();
- this.flags |= HAS_BOOTCLASSPATH;
+ this.flags |= EclipseFileManager.HAS_BOOTCLASSPATH;
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-classpath".equals(current) || "-cp".equals(current)) {//$NON-NLS-1$//$NON-NLS-2$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> classpaths = getPathsFrom(remaining.next());
if (classpaths != null) {
@@ -638,98 +596,83 @@
} else {
setLocation(StandardLocation.CLASS_PATH, classpaths);
}
- if ((this.flags & HAS_PROCESSORPATH) == 0) {
+ if ((this.flags & EclipseFileManager.HAS_PROCESSORPATH) == 0) {
setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths);
}
}
- remaining.remove();
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-encoding".equals(current)) {//$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
this.charset = Charset.forName(remaining.next());
- remaining.remove();
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-sourcepath".equals(current)) {//$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> sourcepaths = getPathsFrom(remaining.next());
if (sourcepaths != null) setLocation(StandardLocation.SOURCE_PATH, sourcepaths);
- remaining.remove();
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-extdirs".equals(current)) {//$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
Iterable<? extends File> iterable = getLocation(StandardLocation.PLATFORM_CLASS_PATH);
setLocation(StandardLocation.PLATFORM_CLASS_PATH,
concatFiles(iterable, getExtdirsFrom(remaining.next())));
- remaining.remove();
- this.flags |= HAS_EXT_DIRS;
+ this.flags |= EclipseFileManager.HAS_EXT_DIRS;
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-endorseddirs".equals(current)) {//$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
Iterable<? extends File> iterable = getLocation(StandardLocation.PLATFORM_CLASS_PATH);
setLocation(StandardLocation.PLATFORM_CLASS_PATH,
prependFiles(iterable, getEndorsedDirsFrom(remaining.next())));
- remaining.remove();
- this.flags |= HAS_ENDORSED_DIRS;
+ this.flags |= EclipseFileManager.HAS_ENDORSED_DIRS;
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-d".equals(current)) { //$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> outputDir = getOutputDir(remaining.next());
if (outputDir != null) {
setLocation(StandardLocation.CLASS_OUTPUT, outputDir);
}
- remaining.remove();
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-s".equals(current)) { //$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> outputDir = getOutputDir(remaining.next());
if (outputDir != null) {
setLocation(StandardLocation.SOURCE_OUTPUT, outputDir);
}
- remaining.remove();
return true;
} else {
throw new IllegalArgumentException();
}
}
if ("-processorpath".equals(current)) {//$NON-NLS-1$
- remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> processorpaths = getPathsFrom(remaining.next());
if (processorpaths != null) {
setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, processorpaths);
}
- remaining.remove();
- this.flags |= HAS_PROCESSORPATH;
+ this.flags |= EclipseFileManager.HAS_PROCESSORPATH;
return true;
} else {
throw new IllegalArgumentException();
@@ -744,6 +687,7 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#hasLocation(javax.tools.JavaFileManager.Location)
*/
+ @Override
public boolean hasLocation(Location location) {
return this.locations != null && this.locations.containsKey(location.getName());
}
@@ -751,6 +695,7 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#inferBinaryName(javax.tools.JavaFileManager.Location, javax.tools.JavaFileObject)
*/
+ @Override
public String inferBinaryName(Location location, JavaFileObject file) {
String name = file.getName();
JavaFileObject javaFileObject = null;
@@ -768,7 +713,7 @@
if (javaFileObject == null) {
return null;
}
- return normalized(name);
+ return name.replace('/', '.');
}
private boolean isArchive(File f) {
@@ -779,6 +724,7 @@
/* (non-Javadoc)
* @see javax.tools.StandardJavaFileManager#isSameFile(javax.tools.FileObject, javax.tools.FileObject)
*/
+ @Override
public boolean isSameFile(FileObject fileObject1, FileObject fileObject2) {
// EclipseFileManager creates only EcliseFileObject
if (!(fileObject1 instanceof EclipseFileObject)) throw new IllegalArgumentException("Unsupported file object class : " + fileObject1.getClass());//$NON-NLS-1$
@@ -788,6 +734,7 @@
/* (non-Javadoc)
* @see javax.tools.OptionChecker#isSupportedOption(java.lang.String)
*/
+ @Override
public int isSupportedOption(String option) {
return Options.processOptionsFileManager(option);
}
@@ -795,6 +742,7 @@
/* (non-Javadoc)
* @see javax.tools.JavaFileManager#list(javax.tools.JavaFileManager.Location, java.lang.String, java.util.Set, boolean)
*/
+ @Override
public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse)
throws IOException {
@@ -803,7 +751,7 @@
throw new IllegalArgumentException("Unknown location : " + location);//$NON-NLS-1$
}
- ArrayList<JavaFileObject> collector = new ArrayList<JavaFileObject>();
+ ArrayList<JavaFileObject> collector = new ArrayList<>();
String normalizedPackageName = normalized(packageName);
for (File file : allFilesInLocations) {
collectAllMatchingFiles(file, normalizedPackageName, kinds, recurse, collector);
@@ -828,7 +776,7 @@
private Iterable<? extends File> prependFiles(Iterable<? extends File> iterable,
Iterable<? extends File> iterable2) {
if (iterable2 == null) return iterable;
- ArrayList<File> list = new ArrayList<File>();
+ ArrayList<File> list = new ArrayList<>();
for (Iterator<? extends File> iterator = iterable2.iterator(); iterator.hasNext(); ) {
list.add(iterator.next());
}
@@ -841,6 +789,7 @@
/* (non-Javadoc)
* @see javax.tools.StandardJavaFileManager#setLocation(javax.tools.JavaFileManager.Location, java.lang.Iterable)
*/
+ @Override
public void setLocation(Location location, Iterable<? extends File> path) throws IOException {
if (path != null) {
if (location.isOutputLocation()) {
@@ -868,7 +817,7 @@
}
}
- @SuppressWarnings({"rawtypes", "unchecked"})
+ @SuppressWarnings({"unchecked", "rawtypes"})
public void processPathEntries(final int defaultSize, final ArrayList paths,
final String currentPath, String customEncoding, boolean isSourceOnly,
boolean rejectDestinationPathOnJars) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.java
index 677c360..337e8e0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Options.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,69 +22,79 @@
private static final Set<String> ONE_ARGUMENT_OPTIONS;
private static final Set<String> FILE_MANAGER_OPTIONS;
static {
- ZERO_ARGUMENT_OPTIONS = new HashSet<String>();
- ZERO_ARGUMENT_OPTIONS.add("-progress");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-proceedOnError");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-time");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-v");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-version");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-showversion");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-deprecation");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-help");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-?");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-help:warn");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-?:warn");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-noExit");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-verbose");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-referenceInfo");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-inlineJSR");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-g");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-g:none");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-nowarn");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-warn:none");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-preserveAllLocals");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-enableJavadoc");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-Xemacs");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-X");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-O");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-1.3");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-1.4");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-1.5");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-5");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-5.0");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-1.6");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-6");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-6.0");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-proc:only");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-proc:none");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-XprintProcessorInfo");//$NON-NLS-1$
- ZERO_ARGUMENT_OPTIONS.add("-XprintRounds");//$NON-NLS-1$
+ ZERO_ARGUMENT_OPTIONS = new HashSet<>();
+ Options.ZERO_ARGUMENT_OPTIONS.add("-progress");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-proceedOnError");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-proceedOnError:Fatal");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-time");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-v");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-version");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-showversion");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-deprecation");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-help");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-?");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-help:warn");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-?:warn");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-noExit");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-verbose");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-referenceInfo");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-inlineJSR");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-g");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-g:none");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-warn:none");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-preserveAllLocals");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-enableJavadoc");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-Xemacs");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-X");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-O");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-1.3");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-1.4");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-1.5");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-5");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-5.0");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-1.6");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-6");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-6.0");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-1.7");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-7");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-7.0");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-1.8");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-8");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-8.0");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-proc:only");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-proc:none");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-XprintProcessorInfo");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-XprintRounds");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-parameters");//$NON-NLS-1$
+ Options.ZERO_ARGUMENT_OPTIONS.add("-genericsignature");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS = new HashSet<String>();
- FILE_MANAGER_OPTIONS.add("-bootclasspath");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-encoding");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-d");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-classpath");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-cp");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-sourcepath");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-extdirs");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-endorseddirs");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-s");//$NON-NLS-1$
- FILE_MANAGER_OPTIONS.add("-processorpath");//$NON-NLS-1$
+ FILE_MANAGER_OPTIONS = new HashSet<>();
+ Options.FILE_MANAGER_OPTIONS.add("-bootclasspath");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-encoding");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-d");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-classpath");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-cp");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-sourcepath");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-extdirs");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-endorseddirs");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-s");//$NON-NLS-1$
+ Options.FILE_MANAGER_OPTIONS.add("-processorpath");//$NON-NLS-1$
- ONE_ARGUMENT_OPTIONS = new HashSet<String>();
- ONE_ARGUMENT_OPTIONS.addAll(FILE_MANAGER_OPTIONS);
- ONE_ARGUMENT_OPTIONS.add("-log");//$NON-NLS-1$
- ONE_ARGUMENT_OPTIONS.add("-repeat");//$NON-NLS-1$
- ONE_ARGUMENT_OPTIONS.add("-maxProblems");//$NON-NLS-1$
- ONE_ARGUMENT_OPTIONS.add("-source");//$NON-NLS-1$
- ONE_ARGUMENT_OPTIONS.add("-target");//$NON-NLS-1$
- ONE_ARGUMENT_OPTIONS.add("-processor");//$NON-NLS-1$
- ONE_ARGUMENT_OPTIONS.add("-classNames");//$NON-NLS-1$
+ ONE_ARGUMENT_OPTIONS = new HashSet<>();
+ Options.ONE_ARGUMENT_OPTIONS.addAll(Options.FILE_MANAGER_OPTIONS);
+ Options.ONE_ARGUMENT_OPTIONS.add("-log");//$NON-NLS-1$
+ Options.ONE_ARGUMENT_OPTIONS.add("-repeat");//$NON-NLS-1$
+ Options.ONE_ARGUMENT_OPTIONS.add("-maxProblems");//$NON-NLS-1$
+ Options.ONE_ARGUMENT_OPTIONS.add("-source");//$NON-NLS-1$
+ Options.ONE_ARGUMENT_OPTIONS.add("-target");//$NON-NLS-1$
+ Options.ONE_ARGUMENT_OPTIONS.add("-processor");//$NON-NLS-1$
+ Options.ONE_ARGUMENT_OPTIONS.add("-classNames");//$NON-NLS-1$
+ Options.ONE_ARGUMENT_OPTIONS.add("-properties");//$NON-NLS-1$
+
}
public static int processOptionsFileManager(String option) {
if (option == null) return -1;
- if (FILE_MANAGER_OPTIONS.contains(option)) {
+ if (Options.FILE_MANAGER_OPTIONS.contains(option)) {
return 1;
}
return -1;
@@ -92,10 +102,10 @@
public static int processOptions(String option) {
if (option == null) return -1;
- if (ZERO_ARGUMENT_OPTIONS.contains(option)) {
+ if (Options.ZERO_ARGUMENT_OPTIONS.contains(option)) {
return 0;
}
- if (ONE_ARGUMENT_OPTIONS.contains(option)) {
+ if (Options.ONE_ARGUMENT_OPTIONS.contains(option)) {
return 1;
}
if (option.startsWith("-g")) { //$NON-NLS-1$
@@ -138,86 +148,98 @@
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
tokenCounter++;
- if ("constructorName".equals(token)//$NON-NLS-1$
- || token.equals("pkgDefaultMethod")//$NON-NLS-1$
- || token.equals("packageDefaultMethod")//$NON-NLS-1$
+ if (token.equals("allDeadCode")//$NON-NLS-1$
+ || token.equals("allDeprecation")//$NON-NLS-1$
+ || token.equals("allJavadoc")//$NON-NLS-1$
+ || token.equals("allOver-ann")//$NON-NLS-1$
+ || token.equals("assertIdentifier")//$NON-NLS-1$
+ || token.equals("boxing")//$NON-NLS-1$
+ || token.equals("charConcat")//$NON-NLS-1$
+ || token.equals("compareIdentical")//$NON-NLS-1$
+ || token.equals("conditionAssign")//$NON-NLS-1$
+ || token.equals("constructorName")//$NON-NLS-1$
+ || token.equals("deadCode")//$NON-NLS-1$
+ || token.equals("dep-ann")//$NON-NLS-1$
+ || token.equals("deprecation")//$NON-NLS-1$
+ || token.equals("discouraged")//$NON-NLS-1$
+ || token.equals("emptyBlock")//$NON-NLS-1$
+ || token.equals("enumIdentifier")//$NON-NLS-1$
+ || token.equals("enumSwitch")//$NON-NLS-1$
+ || token.equals("fallthrough")//$NON-NLS-1$
+ || token.equals("fieldHiding")//$NON-NLS-1$
+ || token.equals("finalBound")//$NON-NLS-1$
+ || token.equals("finally")//$NON-NLS-1$
+ || token.equals("forbidden")//$NON-NLS-1$
+ || token.equals("hashCode")//$NON-NLS-1$
+ || token.equals("hiding")//$NON-NLS-1$
+ || token.equals("includeAssertNull")//$NON-NLS-1$
+ || token.equals("incomplete-switch")//$NON-NLS-1$
+ || token.equals("indirectStatic")//$NON-NLS-1$
+ || token.equals("interfaceNonInherited")//$NON-NLS-1$
+ || token.equals("intfAnnotation")//$NON-NLS-1$
+ || token.equals("intfNonInherited")//$NON-NLS-1$
+ || token.equals("intfRedundant")//$NON-NLS-1$
+ || token.equals("javadoc")//$NON-NLS-1$
+ || token.equals("localHiding")//$NON-NLS-1$
|| token.equals("maskedCatchBlock")//$NON-NLS-1$
|| token.equals("maskedCatchBlocks")//$NON-NLS-1$
- || token.equals("deprecation")//$NON-NLS-1$
- || token.equals("allDeprecation")//$NON-NLS-1$
- || token.equals("unusedLocal")//$NON-NLS-1$
- || token.equals("unusedLocals")//$NON-NLS-1$
+ || token.equals("nls")//$NON-NLS-1$
+ || token.equals("noEffectAssign")//$NON-NLS-1$
+ || token.equals("noImplicitStringConversion")//$NON-NLS-1$
+ || token.equals("null")//$NON-NLS-1$
+ || token.equals("nullDereference")//$NON-NLS-1$
+ || token.equals("over-ann")//$NON-NLS-1$
+ || token.equals("packageDefaultMethod")//$NON-NLS-1$
+ || token.equals("paramAssign")//$NON-NLS-1$
+ || token.equals("pkgDefaultMethod")//$NON-NLS-1$
+ || token.equals("raw")//$NON-NLS-1$
+ || token.equals("semicolon")//$NON-NLS-1$
+ || token.equals("serial")//$NON-NLS-1$
+ || token.equals("specialParamHiding")//$NON-NLS-1$
+ || token.equals("static-access")//$NON-NLS-1$
+ || token.equals("staticReceiver")//$NON-NLS-1$
+ || token.equals("super")//$NON-NLS-1$
+ || token.equals("suppress")//$NON-NLS-1$
+ || token.equals("syncOverride")//$NON-NLS-1$
+ || token.equals("synthetic-access")//$NON-NLS-1$
+ || token.equals("syntheticAccess")//$NON-NLS-1$
+ || token.equals("typeHiding")//$NON-NLS-1$
+ || token.equals("unchecked")//$NON-NLS-1$
+ || token.equals("unnecessaryElse")//$NON-NLS-1$
+ || token.equals("unnecessaryOperator")//$NON-NLS-1$
+ || token.equals("unqualified-field-access")//$NON-NLS-1$
+ || token.equals("unqualifiedField")//$NON-NLS-1$
+ || token.equals("unsafe")//$NON-NLS-1$
+ || token.equals("unused")//$NON-NLS-1$
|| token.equals("unusedArgument")//$NON-NLS-1$
|| token.equals("unusedArguments")//$NON-NLS-1$
|| token.equals("unusedImport")//$NON-NLS-1$
|| token.equals("unusedImports")//$NON-NLS-1$
- || token.equals("unusedPrivate")//$NON-NLS-1$
|| token.equals("unusedLabel")//$NON-NLS-1$
- || token.equals("localHiding")//$NON-NLS-1$
- || token.equals("fieldHiding")//$NON-NLS-1$
- || token.equals("specialParamHiding")//$NON-NLS-1$
- || token.equals("conditionAssign")//$NON-NLS-1$
- || token.equals("syntheticAccess")//$NON-NLS-1$
- || token.equals("synthetic-access")//$NON-NLS-1$
- || token.equals("nls")//$NON-NLS-1$
- || token.equals("staticReceiver")//$NON-NLS-1$
- || token.equals("indirectStatic")//$NON-NLS-1$
- || token.equals("noEffectAssign")//$NON-NLS-1$
- || token.equals("intfNonInherited")//$NON-NLS-1$
- || token.equals("interfaceNonInherited")//$NON-NLS-1$
- || token.equals("charConcat")//$NON-NLS-1$
- || token.equals("noImplicitStringConversion")//$NON-NLS-1$
- || token.equals("semicolon")//$NON-NLS-1$
- || token.equals("serial")//$NON-NLS-1$
- || token.equals("emptyBlock")//$NON-NLS-1$
- || token.equals("uselessTypeCheck")//$NON-NLS-1$
- || token.equals("unchecked")//$NON-NLS-1$
- || token.equals("unsafe")//$NON-NLS-1$
- || token.equals("raw")//$NON-NLS-1$
- || token.equals("finalBound")//$NON-NLS-1$
- || token.equals("suppress")//$NON-NLS-1$
- || token.equals("warningToken")//$NON-NLS-1$
- || token.equals("unnecessaryElse")//$NON-NLS-1$
- || token.equals("javadoc")//$NON-NLS-1$
- || token.equals("allJavadoc")//$NON-NLS-1$
- || token.equals("assertIdentifier")//$NON-NLS-1$
- || token.equals("enumIdentifier")//$NON-NLS-1$
- || token.equals("finally")//$NON-NLS-1$
+ || token.equals("unusedLocal")//$NON-NLS-1$
+ || token.equals("unusedLocals")//$NON-NLS-1$
+ || token.equals("unusedPrivate")//$NON-NLS-1$
|| token.equals("unusedThrown")//$NON-NLS-1$
- || token.equals("unqualifiedField")//$NON-NLS-1$
- || token.equals("unqualified-field-access")//$NON-NLS-1$
- || token.equals("typeHiding")//$NON-NLS-1$
+ || token.equals("unusedTypeArgs")//$NON-NLS-1$
+ || token.equals("uselessTypeCheck")//$NON-NLS-1$
|| token.equals("varargsCast")//$NON-NLS-1$
- || token.equals("null")//$NON-NLS-1$
- || token.equals("boxing")//$NON-NLS-1$
- || token.equals("over-ann")//$NON-NLS-1$
- || token.equals("dep-ann")//$NON-NLS-1$
- || token.equals("intfAnnotation")//$NON-NLS-1$
- || token.equals("enumSwitch")//$NON-NLS-1$
- || token.equals("incomplete-switch")//$NON-NLS-1$
- || token.equals("hiding")//$NON-NLS-1$
- || token.equals("static-access")//$NON-NLS-1$
- || token.equals("unused")//$NON-NLS-1$
- || token.equals("paramAssign")//$NON-NLS-1$
- || token.equals("discouraged")//$NON-NLS-1$
- || token.equals("forbidden")//$NON-NLS-1$
- || token.equals("fallthrough")) {//$NON-NLS-1$
+ || token.equals("warningToken")) {//$NON-NLS-1$
continue;
- } else if (token.equals("tasks")) {//$NON-NLS-1$
- String taskTags = "";//$NON-NLS-1$
- int start = token.indexOf('(');
- int end = token.indexOf(')');
- if (start >= 0 && end >= 0 && start < end){
- taskTags = token.substring(start+1, end).trim();
- taskTags = taskTags.replace('|',',');
- }
- if (taskTags.length() == 0){
- return -1;
- }
- continue;
- } else {
- return -1;
- }
+ } else if (token.equals("tasks")) {//$NON-NLS-1$
+ String taskTags = "";//$NON-NLS-1$
+ int start = token.indexOf('(');
+ int end = token.indexOf(')');
+ if (start >= 0 && end >= 0 && start < end){
+ taskTags = token.substring(start+1, end).trim();
+ taskTags = taskTags.replace('|',',');
+ }
+ if (taskTags.length() == 0){
+ return -1;
+ }
+ continue;
+ } else {
+ return -1;
+ }
}
if (tokenCounter == 0) {
return -1;
@@ -225,6 +247,28 @@
return 0;
}
}
+ if (option.startsWith("-nowarn")) {//$NON-NLS-1$
+ switch (option.length()) {
+ case 7:
+ return 0;
+ case 8:
+ return -1;
+ default:
+ int foldersStart = option.indexOf('[') + 1;
+ int foldersEnd = option.lastIndexOf(']');
+ if (foldersStart <= 8 || foldersEnd == -1
+ || foldersStart > foldersEnd
+ || foldersEnd < option.length() - 1) {
+ return -1;
+ }
+ String folders = option.substring(foldersStart, foldersEnd);
+ if (folders.length() > 0) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ }
if (option.startsWith("-J")//$NON-NLS-1$
|| option.startsWith("-X")//$NON-NLS-1$
|| option.startsWith("-A")) {//$NON-NLS-1$
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.java
index 98a0994..efc9354 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/apt/util/Util.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,7 +38,7 @@
this.position = position;
this.length = length;
}
-
+
public String getSource(char[] unitSource) {
//extra from the source the innacurate token
//and "highlight" it using some underneath ^^^^^
@@ -49,7 +49,7 @@
//sanity .....
int startPosition = this.position;
int endPosition = this.position + this.length - 1;
-
+
if ((startPosition > endPosition)
|| ((startPosition < 0) && (endPosition < 0))
|| unitSource.length == 0)
@@ -57,29 +57,29 @@
StringBuffer errorBuffer = new StringBuffer();
errorBuffer.append('\t');
-
+
char c;
final char SPACE = ' ';
final char MARK = '^';
final char TAB = '\t';
//the next code tries to underline the token.....
//it assumes (for a good display) that token source does not
- //contain any \r \n. This is false on statements !
+ //contain any \r \n. This is false on statements !
//(the code still works but the display is not optimal !)
// expand to line limits
- int length = unitSource.length, begin, end;
- for (begin = startPosition >= length ? length - 1 : startPosition; begin > 0; begin--) {
+ int sourceLength = unitSource.length, begin, end;
+ for (begin = startPosition >= sourceLength ? sourceLength - 1 : startPosition; begin > 0; begin--) {
if ((c = unitSource[begin - 1]) == '\n' || c == '\r') break;
}
- for (end = endPosition >= length ? length - 1 : endPosition ; end+1 < length; end++) {
+ for (end = endPosition >= sourceLength ? sourceLength - 1 : endPosition ; end+1 < sourceLength; end++) {
if ((c = unitSource[end + 1]) == '\r' || c == '\n') break;
}
-
+
// trim left and right spaces/tabs
while ((c = unitSource[begin]) == ' ' || c == '\t') begin++;
//while ((c = unitSource[end]) == ' ' || c == '\t') end--; TODO (philippe) should also trim right, but all tests are to be updated
-
+
// copy source
errorBuffer.append(unitSource, begin, end-begin+1);
errorBuffer.append(Util.LINE_SEPARATOR).append("\t"); //$NON-NLS-1$
@@ -88,17 +88,17 @@
for (int i = begin; i <startPosition; i++) {
errorBuffer.append((unitSource[i] == TAB) ? TAB : SPACE);
}
- for (int i = startPosition; i <= (endPosition >= length ? length - 1 : endPosition); i++) {
+ for (int i = startPosition; i <= (endPosition >= sourceLength ? sourceLength - 1 : endPosition); i++) {
errorBuffer.append(MARK);
}
return errorBuffer.toString();
}
}
public static class EncodingErrorCollector {
- ArrayList<EncodingError> encodingErrors = new ArrayList<EncodingError>();
+ ArrayList<EncodingError> encodingErrors = new ArrayList<>();
FileObject fileObject;
String encoding;
-
+
public EncodingErrorCollector(FileObject fileObject, String encoding) {
this.fileObject = fileObject;
this.encoding = encoding;
@@ -135,7 +135,7 @@
byteBuffer.flip();
return charsetDecoder.decode(byteBuffer).array();
}
-
+
public static CharSequence getCharContents(FileObject fileObject, boolean ignoreEncodingErrors, byte[] contents, String encoding) throws IOException {
if (contents == null) return null;
Charset charset = null;
@@ -199,7 +199,7 @@
return out;
}
}
-
+
private static void reportEncodingError(EncodingErrorCollector collector, int position, int length) {
collector.collect(position, -length);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index 7a88ab2..69fda03 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,6 +30,10 @@
* Bug 427163 - [1.8][null] bogus error "Contradictory null specification" on varags
* Bug 432348 - [1.8] Internal compiler error (NPE) after upgrade to 1.8
* Bug 440143 - [1.8][null] one more case of contradictory null annotations regarding type variables
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
+ * Bug 434483 - [1.8][compiler][inference] Type inference not picked up with method reference
+ * Bug 446442 - [1.8] merge null annotations from super methods
+ * Bug 437072 - [compiler][null] Null analysis emits possibly incorrect warning for new int[][] despite @NonNullByDefault
* Jesper S Moller - Contributions for
* bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
* bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -58,10 +62,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
@@ -345,9 +346,6 @@
}
public static boolean checkInvocationArguments(BlockScope scope, Expression receiver, TypeBinding receiverType, MethodBinding method, Expression[] arguments, TypeBinding[] argumentTypes, boolean argsContainCast, InvocationSite invocationSite) {
boolean is1_7 = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_7;
- if (is1_7 && method.isPolymorphic()) {
- return false;
- }
TypeBinding[] params = method.parameters;
int paramLength = params.length;
boolean isRawMemberInvocation = !method.isStatic()
@@ -541,6 +539,11 @@
return false;
}
+ public boolean isQualifiedSuper() {
+
+ return false;
+ }
+
public boolean isThis() {
return false;
@@ -649,123 +652,48 @@
* After method lookup has produced 'methodBinding' but when poly expressions have been seen as arguments,
* inspect the arguments to trigger another round of resolving with improved target types from the methods parameters.
* If this resolving produces better types for any arguments, update the 'argumentTypes' array in-place as an
- * intended side effect that will feed better type information in checkInvocationArguments() and others.
+ * intended side effect that will feed better type information in checkInvocationArguments() and others.
* @param invocation the outer invocation which is being resolved
- * @param methodBinding the method produced by lookup (possibly involving type inference).
- * @param argumentTypes the argument types as collected from first resolving the invocation arguments and as used for
- * the method lookup.
- * @param scope scope for error reporting
+ * @param method the method produced by lookup (possibly involving type inference).
+ * @param argumentTypes the argument types as collected from first resolving the invocation arguments and as used for the method lookup.
+ * @param scope scope for resolution.
*/
- public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding methodBinding, TypeBinding[] argumentTypes, Scope scope) {
- if (!invocation.innersNeedUpdate())
+ public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding method, TypeBinding[] argumentTypes, BlockScope scope) {
+ MethodBinding candidateMethod = method.isValidBinding() ? method : method instanceof ProblemMethodBinding ? ((ProblemMethodBinding) method).closestMatch : null;
+ if (candidateMethod == null)
return;
- int problemReason = 0;
- MethodBinding candidateMethod;
- if (methodBinding.isValidBinding()) {
- candidateMethod = methodBinding;
- } else if (methodBinding instanceof ProblemMethodBinding) {
- problemReason = methodBinding.problemId();
- candidateMethod = ((ProblemMethodBinding) methodBinding).closestMatch;
- } else {
- candidateMethod = null;
- }
- if (candidateMethod != null) {
- boolean variableArity = candidateMethod.isVarargs();
- InferenceContext18 infCtx = null;
- if (candidateMethod instanceof ParameterizedMethodBinding) {
- infCtx = invocation.getInferenceContext((ParameterizedMethodBinding) candidateMethod);
- if (infCtx != null) {
- if (infCtx.stepCompleted != InferenceContext18.TYPE_INFERRED) {
- // only work in the exact state of TYPE_INFERRED
- // - below we're not yet ready
- // - above we're already done-done
- return;
- }
- variableArity &= infCtx.isVarArgs(); // TODO: if no infCtx is available, do we have to re-check if this is a varargs invocation?
- }
- } else if (invocation instanceof AllocationExpression) {
- if (((AllocationExpression)invocation).suspendedResolutionState != null)
- return; // not yet ready
- }
-
- final TypeBinding[] parameters = candidateMethod.parameters;
- Expression[] innerArguments = invocation.arguments();
- Expression [] arguments = innerArguments;
- if (infCtx == null && variableArity && parameters.length == arguments.length) { // re-check
- TypeBinding lastParam = parameters[parameters.length-1];
- Expression lastArg = arguments[arguments.length-1];
- if (lastArg.isCompatibleWith(lastParam, null)) {
- variableArity = false;
- }
- }
- for (int i = 0, length = arguments == null ? 0 : arguments.length; i < length; i++) {
- Expression argument = arguments[i];
- TypeBinding updatedArgumentType = null;
- TypeBinding parameterType = InferenceContext18.getParameter(parameters, i, variableArity);
- if (parameterType == null && problemReason != ProblemReasons.NoError)
- continue; // not much we can do without a target type, assume it only happens after some resolve error
-
- if (argument instanceof LambdaExpression && ((LambdaExpression) argument).hasErrors())
- continue; // don't update if inner poly has errors
-
- if (argument instanceof Invocation) {
- Invocation innerInvocation = (Invocation)argument;
- MethodBinding binding = innerInvocation.binding(parameterType, true, scope);
- if (binding instanceof ParameterizedGenericMethodBinding) {
- ParameterizedGenericMethodBinding parameterizedMethod = (ParameterizedGenericMethodBinding) binding;
- InferenceContext18 innerContext = innerInvocation.getInferenceContext(parameterizedMethod);
- if (innerContext != null) {
- if (!innerContext.hasResultFor(parameterType)) {
- argument.setExpectedType(parameterType);
- MethodBinding improvedBinding = innerContext.inferInvocationType(innerInvocation, parameterizedMethod);
- if (!improvedBinding.isValidBinding()) {
- innerContext.reportInvalidInvocation(innerInvocation, improvedBinding);
- }
- if (innerInvocation.updateBindings(improvedBinding, parameterType)) {
- resolvePolyExpressionArguments(innerInvocation, improvedBinding, scope);
- }
- } else if (innerContext.stepCompleted < InferenceContext18.BINDINGS_UPDATED) {
- innerContext.rebindInnerPolies(parameterizedMethod, innerInvocation);
- }
- }
- continue; // otherwise these have been dealt with during inner method lookup
- }
- }
-
- if (argument.isPolyExpression()) {
- // poly expressions in an invocation context may need to be resolved now:
- if (infCtx != null && infCtx.stepCompleted == InferenceContext18.BINDINGS_UPDATED)
- updatedArgumentType = argument.resolvedType; // in this case argument was already resolved via InferenceContext18.acceptPendingPolyArguments()
- else
- updatedArgumentType = argument.checkAgainstFinalTargetType(parameterType, scope);
-
- if (problemReason == ProblemReasons.NoError // preserve errors
- && updatedArgumentType != null // do we have a relevant update? ...
- && !(updatedArgumentType instanceof PolyTypeBinding))
- {
- // update the argumentTypes array (supposed to be owned by the calling method)
- // in order to give better information for subsequent checks
- argumentTypes[i] = updatedArgumentType;
- }
- }
+ boolean variableArity = candidateMethod.isVarargs();
+ final TypeBinding[] parameters = candidateMethod.parameters;
+ Expression[] arguments = invocation.arguments();
+ if (variableArity && arguments != null && parameters.length == arguments.length) {
+ if (arguments[arguments.length-1].isCompatibleWith(parameters[parameters.length-1], scope)) {
+ variableArity = false;
}
}
- invocation.innerUpdateDone();
- }
-
- public static void resolvePolyExpressionArguments(Invocation invocation, MethodBinding methodBinding, Scope scope) {
- TypeBinding[] argumentTypes = null;
- Expression[] innerArguments = invocation.arguments();
- if (innerArguments != null) {
- argumentTypes = new TypeBinding[innerArguments.length];
- for (int i = 0; i < innerArguments.length; i++)
- argumentTypes[i] = innerArguments[i].resolvedType;
+ for (int i = 0, length = arguments == null ? 0 : arguments.length; i < length; i++) {
+ Expression argument = arguments[i];
+ TypeBinding parameterType = InferenceContext18.getParameter(parameters, i, variableArity);
+ if (parameterType == null)
+ continue; // not much we can do without a target type, assume it only happens after some resolve error
+ if (argumentTypes[i] != null && argumentTypes[i].isPolyType()) {
+ argument.setExpectedType(parameterType);
+ TypeBinding updatedArgumentType = argument.resolveType(scope);
+ if (argument instanceof LambdaExpression) {
+ // LE.resolveType may return a valid binding because resolve does not detect structural errors at this point.
+ LambdaExpression lambda = (LambdaExpression) argument;
+ if (!lambda.isCompatibleWith(parameterType, scope) || lambda.hasErrors())
+ continue;
+ }
+ if (updatedArgumentType != null && updatedArgumentType.kind() != Binding.POLY_TYPE)
+ argumentTypes[i] = updatedArgumentType;
+ }
}
- resolvePolyExpressionArguments(invocation, methodBinding, argumentTypes, scope);
}
public static void resolveAnnotations(BlockScope scope, Annotation[] sourceAnnotations, Binding recipient) {
resolveAnnotations(scope, sourceAnnotations, recipient, false);
+ if (recipient instanceof SourceTypeBinding)
+ ((SourceTypeBinding) recipient).evaluateNullAnnotations();
}
/**
@@ -835,7 +763,7 @@
Annotation annotation = sourceAnnotations[i];
final Binding annotationRecipient = annotation.recipient;
if (annotationRecipient != null && recipient != null) {
- // only local and field can share annnotations and their types.
+ // only local and field can share annotations and their types.
switch (recipient.kind()) {
case Binding.TYPE_USE:
if (annotations != null) {
@@ -1028,7 +956,7 @@
AnnotationBinding [] se8Annotations = null;
int se8count = 0;
long se8nullBits = 0;
- Annotation se8NullAnnotation = null;
+ Annotation se8NullAnnotation = null; // just any involved annotation so we have a location for error reporting
int firstSE8 = -1;
for (int i = 0, length = annotations.length; i < length; i++) {
AnnotationBinding annotation = annotations[i].getCompilerAnnotation();
@@ -1051,10 +979,10 @@
se8Annotations[se8count++] = annotation;
}
if (annotationType.id == TypeIds.T_ConfiguredAnnotationNonNull) {
- se8nullBits = TagBits.AnnotationNonNull;
+ se8nullBits |= TagBits.AnnotationNonNull;
se8NullAnnotation = annotations[i];
} else if (annotationType.id == TypeIds.T_ConfiguredAnnotationNullable) {
- se8nullBits = TagBits.AnnotationNullable;
+ se8nullBits |= TagBits.AnnotationNullable;
se8NullAnnotation = annotations[i];
}
}
@@ -1119,15 +1047,21 @@
// for arrays: @T X[] SE7 associates @T to the type, but in SE8 it affects the leaf component type
long prevNullBits = existingType.leafComponentType().tagBits & TagBits.AnnotationNullMASK;
- if (se8nullBits != 0 && prevNullBits != se8nullBits && ((prevNullBits | se8nullBits) == TagBits.AnnotationNullMASK)) {
- if (existingType instanceof TypeVariableBinding) {
- // let type-use annotations override annotations on the type parameter declaration
- existingType = existingType.unannotated(true);
- } else {
- scope.problemReporter().contradictoryNullAnnotations(se8NullAnnotation);
+ if ((prevNullBits | se8nullBits) == TagBits.AnnotationNullMASK) { // contradiction after merge?
+ if (!(existingType instanceof TypeVariableBinding)) { // let type-use annotations override annotations on the type parameter declaration
+ if (prevNullBits != TagBits.AnnotationNullMASK && se8nullBits != TagBits.AnnotationNullMASK) { // conflict caused by the merge?
+ scope.problemReporter().contradictoryNullAnnotations(se8NullAnnotation);
+ }
+ se8Annotations = Binding.NO_ANNOTATIONS;
+ se8nullBits = 0;
}
+ existingType = existingType.withoutToplevelNullAnnotation();
}
TypeBinding oldLeafType = (unionRef == null) ? existingType.leafComponentType() : unionRef.resolvedType;
+ if (se8nullBits != 0 && oldLeafType.isBaseType()) {
+ scope.problemReporter().illegalAnnotationForBaseType(typeRef, new Annotation[] { se8NullAnnotation }, se8nullBits);
+ return existingType;
+ }
AnnotationBinding [][] goodies = new AnnotationBinding[typeRef.getAnnotatableLevels()][];
goodies[0] = se8Annotations; // @T X.Y.Z local; ==> @T should annotate X
TypeBinding newLeafType = scope.environment().createAnnotatedType(oldLeafType, goodies);
@@ -1240,6 +1174,16 @@
}
}
+ // ---- "default methods" for InvocationSite. Can we move to 1.8 and spare ourselves this ugliness please ?
+ public boolean checkingPotentialCompatibility() {
+ return false;
+ }
+
+ public void acceptPotentiallyCompatibleMethods(MethodBinding [] methods) {
+ // Discard. Interested subclasses should override and grab these goodies.
+ }
+ // --- "default methods" for InvocationSite
+
public int sourceStart() {
return this.sourceStart;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 1a1b47c..22c26ff 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,8 @@
* Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
* Bug 392238 - [1.8][compiler][null] Detect semantically invalid null type annotations
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -30,6 +32,7 @@
import org.aspectj.org.eclipse.jdt.core.compiler.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.*;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -42,6 +45,7 @@
/**
* AspectJ Extension - added several extension points for subclasses
*/
+@SuppressWarnings({"rawtypes"})
public abstract class AbstractMethodDeclaration
extends ASTNode
implements ProblemSeverities, ReferenceContext {
@@ -100,7 +104,7 @@
}
// version for invocation from LambdaExpression:
static void createArgumentBindings(Argument[] arguments, MethodBinding binding, MethodScope scope) {
- boolean useTypeAnnotations = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean useTypeAnnotations = scope.environment().usesNullTypeAnnotations();
if (arguments != null && binding != null) {
for (int i = 0, length = arguments.length; i < length; i++) {
Argument argument = arguments[i];
@@ -359,15 +363,6 @@
classFile.completeCodeAttribute(codeAttributeOffset);
} catch(NegativeArraySizeException e) {
throw new AbortMethod(this.scope.referenceCompilationUnit().compilationResult, null);
- } catch (IllegalArgumentException iae) {
- // TODO debug for 458660
- String debugString = "";
- try {
- debugString = new String(this.binding.declaringClass.sourceName)+"."+new String(this.binding.selector);
- } catch (Exception e) {
- new RuntimeException("Unable to produce debug string...").printStackTrace();
- }
- throw new IllegalArgumentException("Unable to complete code attribute for "+debugString,iae);
}
attributeNumber++;
} else {
@@ -554,7 +549,8 @@
resolveAnnotations(this.scope, this.annotations, this.binding);
long sourceLevel = this.scope.compilerOptions().sourceLevel;
- validateNullAnnotations(sourceLevel);
+ if (sourceLevel < ClassFileConstants.JDK1_8) // otherwise already checked via Argument.createBinding
+ validateNullAnnotations(this.scope.environment().usesNullTypeAnnotations());
resolveStatements();
// check @Deprecated annotation presence
@@ -615,7 +611,7 @@
this.scope.problemReporter().illegalTypeForExplicitThis(this.receiver, enclosingReceiver);
}
- if (this.receiver.type.hasNullTypeAnnotation()) {
+ if (this.receiver.type.hasNullTypeAnnotation(AnnotationPosition.ANY)) {
this.scope.problemReporter().nullAnnotationUnsupportedLocation(this.receiver.type);
}
}
@@ -673,10 +669,10 @@
return null;
}
- void validateNullAnnotations(long sourceLevel) {
+ void validateNullAnnotations(boolean useTypeAnnotations) {
if (this.binding == null) return;
// null annotations on parameters?
- if (sourceLevel < ClassFileConstants.JDK1_8) {
+ if (!useTypeAnnotations) {
if (this.binding.parameterNonNullness != null) {
int length = this.binding.parameters.length;
for (int i=0; i<length; i++) {
@@ -694,7 +690,7 @@
this.scope.validateNullAnnotation(this.binding.parameters[i].tagBits, this.arguments[i].type, this.arguments[i].annotations);
// TODO(stephan) remove once we're sure:
// this.binding.parameters[i] = this.binding.parameters[i].unannotated();
- }
+ }
}
}
//*********************************************************************
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
index cebbf82..836a83a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,6 +37,8 @@
* Bug 429203 - [1.8][compiler] NPE in AllocationExpression.binding
* Bug 429430 - [1.8] Lambdas and method reference infer wrong exception type with generics (RuntimeException instead of IOException)
* Bug 434297 - [1.8] NPE in LamdaExpression.analyseCode with lamda expression nested in a conditional expression
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ * Bug 448709 - [1.8][null] ensure we don't infer types that violate null constraints on a type parameter's bound
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* bug 378674 - "The method can be declared as static" is wrong
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
@@ -49,6 +51,8 @@
import static org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExpressionContext.*;
+import java.util.HashMap;
+
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -60,7 +64,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
-public class AllocationExpression extends Expression implements Invocation {
+public class AllocationExpression extends Expression implements IPolyExpression, Invocation {
public TypeReference type;
public Expression[] arguments;
@@ -73,34 +77,16 @@
public boolean inferredReturnType;
public FakedTrackingVariable closeTracker; // when allocation a Closeable store a pre-liminary tracking variable here
- private ExpressionContext expressionContext = VANILLA_CONTEXT;
+ public ExpressionContext expressionContext = VANILLA_CONTEXT;
// hold on to this context from invocation applicability inference until invocation type inference (per method candidate):
private SimpleLookupTable/*<PMB,IC18>*/ inferenceContexts;
- protected InnerInferenceHelper innerInferenceHelper;
-
- /** Record to keep state between different parts of resolution. */
- ResolutionState suspendedResolutionState;
- class ResolutionState {
- BlockScope scope;
- boolean isDiamond;
- boolean diamondNeedsDeferring;
- boolean argsContainCast;
- boolean cannotInferDiamond; // request the an error be reported in due time
- TypeBinding[] argumentTypes;
- boolean hasReportedError;
-
- ResolutionState(BlockScope scope, boolean isDiamond, boolean diamonNeedsDeferring,
- boolean argsContainCast, TypeBinding[] argumentTypes)
- {
- this.scope = scope;
- this.isDiamond = isDiamond;
- this.diamondNeedsDeferring = diamonNeedsDeferring;
- this.argsContainCast = argsContainCast;
- this.argumentTypes = argumentTypes;
- }
- }
-
+ public HashMap<TypeBinding, MethodBinding> solutionsPerTargetType;
+ private InferenceContext18 outerInferenceContext; // resolving within the context of an outer (lambda) inference?
+ public boolean argsContainCast;
+ public TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
+ public boolean argumentsHaveErrors = false;
+
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
// check captured variables are initialized in current context (26134)
checkCapturedLocalInitializationIfNecessary((ReferenceBinding)this.binding.declaringClass.erasure(), currentScope, flowInfo);
@@ -359,7 +345,6 @@
// Propagate the type checking to the arguments, and check if the constructor is defined.
final boolean isDiamond = this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0;
final CompilerOptions compilerOptions = scope.compilerOptions();
- boolean diamondNeedsDeferring = false;
long sourceLevel = compilerOptions.sourceLevel;
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
@@ -368,211 +353,174 @@
this.resolvedType = scope.enclosingReceiverType();
} else {
this.resolvedType = this.type.resolveType(scope, true /* check bounds*/);
- if (isDiamond && this.typeExpected == null && this.expressionContext == INVOCATION_CONTEXT && sourceLevel >= ClassFileConstants.JDK1_8) {
- if (this.resolvedType != null && this.resolvedType.isValidBinding())
- diamondNeedsDeferring = true;
- }
}
- } else {
- this.resolvedType = this.type.resolvedType;
- }
-
- if (this.type != null) {
- checkIllegalNullAnnotation(scope, this.resolvedType);
- checkParameterizedAllocation: {
- if (this.type instanceof ParameterizedQualifiedTypeReference) { // disallow new X<String>.Y<Integer>()
- ReferenceBinding currentType = (ReferenceBinding)this.resolvedType;
- if (currentType == null) return currentType;
- do {
- // isStatic() is answering true for toplevel types
- if ((currentType.modifiers & ClassFileConstants.AccStatic) != 0) break checkParameterizedAllocation;
- if (currentType.isRawType()) break checkParameterizedAllocation;
- } while ((currentType = currentType.enclosingType())!= null);
- ParameterizedQualifiedTypeReference qRef = (ParameterizedQualifiedTypeReference) this.type;
- for (int i = qRef.typeArguments.length - 2; i >= 0; i--) {
- if (qRef.typeArguments[i] != null) {
- scope.problemReporter().illegalQualifiedParameterizedTypeAllocation(this.type, this.resolvedType);
- break;
+ if (this.type != null) {
+ checkIllegalNullAnnotation(scope, this.resolvedType);
+ checkParameterizedAllocation: {
+ if (this.type instanceof ParameterizedQualifiedTypeReference) { // disallow new X<String>.Y<Integer>()
+ ReferenceBinding currentType = (ReferenceBinding)this.resolvedType;
+ if (currentType == null) return currentType;
+ do {
+ // isStatic() is answering true for toplevel types
+ if ((currentType.modifiers & ClassFileConstants.AccStatic) != 0) break checkParameterizedAllocation;
+ if (currentType.isRawType()) break checkParameterizedAllocation;
+ } while ((currentType = currentType.enclosingType())!= null);
+ ParameterizedQualifiedTypeReference qRef = (ParameterizedQualifiedTypeReference) this.type;
+ for (int i = qRef.typeArguments.length - 2; i >= 0; i--) {
+ if (qRef.typeArguments[i] != null) {
+ scope.problemReporter().illegalQualifiedParameterizedTypeAllocation(this.type, this.resolvedType);
+ break;
+ }
}
}
}
}
- }
- // will check for null after args are resolved
+ // will check for null after args are resolved
- // resolve type arguments (for generic constructor call)
- if (this.typeArguments != null) {
- int length = this.typeArguments.length;
- boolean argHasError = sourceLevel < ClassFileConstants.JDK1_5;
- this.genericTypeArguments = new TypeBinding[length];
- for (int i = 0; i < length; i++) {
- TypeReference typeReference = this.typeArguments[i];
- if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
- argHasError = true;
- }
- if (argHasError && typeReference instanceof Wildcard) {
- scope.problemReporter().illegalUsageOfWildcard(typeReference);
- }
- }
- if (isDiamond) {
- scope.problemReporter().diamondNotWithExplicitTypeArguments(this.typeArguments);
- return null;
- }
- if (argHasError) {
- if (this.arguments != null) { // still attempt to resolve arguments
- for (int i = 0, max = this.arguments.length; i < max; i++) {
- this.arguments[i].resolveType(scope);
+ // resolve type arguments (for generic constructor call)
+ if (this.typeArguments != null) {
+ int length = this.typeArguments.length;
+ this.argumentsHaveErrors = sourceLevel < ClassFileConstants.JDK1_5;
+ this.genericTypeArguments = new TypeBinding[length];
+ for (int i = 0; i < length; i++) {
+ TypeReference typeReference = this.typeArguments[i];
+ if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
+ this.argumentsHaveErrors = true;
+ }
+ if (this.argumentsHaveErrors && typeReference instanceof Wildcard) {
+ scope.problemReporter().illegalUsageOfWildcard(typeReference);
}
}
- return null;
+ if (isDiamond) {
+ scope.problemReporter().diamondNotWithExplicitTypeArguments(this.typeArguments);
+ return null;
+ }
+ if (this.argumentsHaveErrors) {
+ if (this.arguments != null) { // still attempt to resolve arguments
+ for (int i = 0, max = this.arguments.length; i < max; i++) {
+ this.arguments[i].resolveType(scope);
+ }
+ }
+ return null;
+ }
}
- }
- // buffering the arguments' types
- boolean argsContainCast = false;
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
- if (this.arguments != null) {
- boolean argHasError = false;
- int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
- for (int i = 0; i < length; i++) {
- Expression argument = this.arguments[i];
- if (argument instanceof CastExpression) {
- argument.bits |= DisableUnnecessaryCastCheck; // will check later on
- argsContainCast = true;
+ // buffering the arguments' types
+ if (this.arguments != null) {
+ this.argumentsHaveErrors = false;
+ int length = this.arguments.length;
+ this.argumentTypes = new TypeBinding[length];
+ for (int i = 0; i < length; i++) {
+ Expression argument = this.arguments[i];
+ if (argument instanceof CastExpression) {
+ argument.bits |= DisableUnnecessaryCastCheck; // will check later on
+ this.argsContainCast = true;
+ }
+ argument.setExpressionContext(INVOCATION_CONTEXT);
+ if (this.arguments[i].resolvedType != null)
+ scope.problemReporter().genericInferenceError("Argument was unexpectedly found resolved", this); //$NON-NLS-1$
+ if ((this.argumentTypes[i] = argument.resolveType(scope)) == null) {
+ this.argumentsHaveErrors = true;
+ }
}
- argument.setExpressionContext(INVOCATION_CONTEXT);
- if (this.arguments[i].resolvedType != null)
- scope.problemReporter().genericInferenceError("Argument was unexpectedly found resolved", this); //$NON-NLS-1$
- if ((argumentTypes[i] = argument.resolveType(scope)) == null) {
- argHasError = true;
- }
- if (sourceLevel >= ClassFileConstants.JDK1_8 && argument.isPolyExpression()) {
- if (this.innerInferenceHelper == null)
- this.innerInferenceHelper = new InnerInferenceHelper();
- }
- }
- if (argHasError) {
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=345359, if arguments have errors, completely bail out in the <> case.
+ if (this.argumentsHaveErrors) {
+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=345359, if arguments have errors, completely bail out in the <> case.
No meaningful type resolution is possible since inference of the elided types is fully tied to argument types. Do
not return the partially resolved type.
- */
- if (isDiamond) {
- return null; // not the partially cooked this.resolvedType
- }
- if (this.resolvedType instanceof ReferenceBinding) {
- // record a best guess, for clients who need hint about possible constructor match
- TypeBinding[] pseudoArgs = new TypeBinding[length];
- for (int i = length; --i >= 0;) {
- pseudoArgs[i] = argumentTypes[i] == null ? TypeBinding.NULL : argumentTypes[i]; // replace args with errors with null type
+ */
+ if (isDiamond) {
+ return null; // not the partially cooked this.resolvedType
}
- this.binding = scope.findMethod((ReferenceBinding) this.resolvedType, TypeConstants.INIT, pseudoArgs, this, false);
- if (this.binding != null && !this.binding.isValidBinding()) {
- MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch;
- // record the closest match, for clients who may still need hint about possible method match
- if (closestMatch != null) {
- if (closestMatch.original().typeVariables != Binding.NO_TYPE_VARIABLES) { // generic method
- // shouldn't return generic method outside its context, rather convert it to raw method (175409)
- closestMatch = scope.environment().createParameterizedGenericMethod(closestMatch.original(), (RawTypeBinding)null);
- }
- this.binding = closestMatch;
- MethodBinding closestMatchOriginal = closestMatch.original();
- if (closestMatchOriginal.isOrEnclosedByPrivateType() && !scope.isDefinedInMethod(closestMatchOriginal)) {
- // ignore cases where method is used from within inside itself (e.g. direct recursions)
- closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ if (this.resolvedType instanceof ReferenceBinding) {
+ // record a best guess, for clients who need hint about possible constructor match
+ TypeBinding[] pseudoArgs = new TypeBinding[length];
+ for (int i = length; --i >= 0;) {
+ pseudoArgs[i] = this.argumentTypes[i] == null ? TypeBinding.NULL : this.argumentTypes[i]; // replace args with errors with null type
+ }
+ this.binding = scope.findMethod((ReferenceBinding) this.resolvedType, TypeConstants.INIT, pseudoArgs, this, false);
+ if (this.binding != null && !this.binding.isValidBinding()) {
+ MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch;
+ // record the closest match, for clients who may still need hint about possible method match
+ if (closestMatch != null) {
+ if (closestMatch.original().typeVariables != Binding.NO_TYPE_VARIABLES) { // generic method
+ // shouldn't return generic method outside its context, rather convert it to raw method (175409)
+ closestMatch = scope.environment().createParameterizedGenericMethod(closestMatch.original(), (RawTypeBinding)null);
+ }
+ this.binding = closestMatch;
+ MethodBinding closestMatchOriginal = closestMatch.original();
+ if (closestMatchOriginal.isOrEnclosedByPrivateType() && !scope.isDefinedInMethod(closestMatchOriginal)) {
+ // ignore cases where method is used from within inside itself (e.g. direct recursions)
+ closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ }
}
}
}
+ return this.resolvedType;
}
+ }
+ if (this.resolvedType == null || !this.resolvedType.isValidBinding()) {
+ return null;
+ }
+
+ // null type denotes fake allocation for enum constant inits
+ if (this.type != null && !this.resolvedType.canBeInstantiated()) {
+ scope.problemReporter().cannotInstantiate(this.type, this.resolvedType);
return this.resolvedType;
}
- }
- if (this.resolvedType == null || !this.resolvedType.isValidBinding()) {
- return null;
- }
-
- // null type denotes fake allocation for enum constant inits
- if (this.type != null && !this.resolvedType.canBeInstantiated()) {
- scope.problemReporter().cannotInstantiate(this.type, this.resolvedType);
- return this.resolvedType;
- }
- ResolutionState state = new ResolutionState(scope, isDiamond, diamondNeedsDeferring, argsContainCast, argumentTypes);
- if (diamondNeedsDeferring) {
- this.suspendedResolutionState = state; // resolving to be continued later (via binding(TypeBinding targetType)).
- return new PolyTypeBinding(this);
- }
-
- if (!resolvePart2(state))
- return null;
- return resolvePart3(state);
-}
-
-/** Second part of resolving that may happen multiple times during overload resolution. */
-boolean resolvePart2(ResolutionState state) {
- // TODO: all information persisted during this method may need to be stored per targetType?
- if (state.isDiamond) {
- ReferenceBinding genericType = ((ParameterizedTypeBinding) this.resolvedType).genericType();
- TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, this.resolvedType.enclosingType(), state.argumentTypes, state.scope);
- if (inferredTypes == null) {
- if (!state.diamondNeedsDeferring) {
- state.scope.problemReporter().cannotInferElidedTypes(this);
- state.hasReportedError = true;
- this.resolvedType = null;
- } else {
- state.cannotInferDiamond = true; // defer reporting
- }
- return false;
+ }
+ if (isDiamond) {
+ this.binding = inferConstructorOfElidedParameterizedType(scope);
+ if (this.binding == null || !this.binding.isValidBinding()) {
+ scope.problemReporter().cannotInferElidedTypes(this);
+ return this.resolvedType = null;
}
- this.resolvedType = this.type.resolvedType = state.scope.environment().createParameterizedType(genericType, inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType());
- state.cannotInferDiamond = false;
- }
- ReferenceBinding receiverType = (ReferenceBinding) this.resolvedType;
- this.binding = findConstructorBinding(state.scope, this, receiverType, state.argumentTypes);
- return true;
-}
-
-/** Final part of resolving (once): check and report various error conditions. */
-TypeBinding resolvePart3(ResolutionState state) {
- if (this.suspendedResolutionState != null && this.suspendedResolutionState.hasReportedError)
- return this.resolvedType;
- this.suspendedResolutionState = null;
- if (state.cannotInferDiamond) {
- state.scope.problemReporter().cannotInferElidedTypes(this);
- return this.resolvedType = null;
+ if (this.typeExpected == null && compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8 && this.expressionContext.definesTargetType()) {
+ return new PolyTypeBinding(this);
+ }
+ this.resolvedType = this.type.resolvedType = this.binding.declaringClass;
+ resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
+ } else {
+ this.binding = findConstructorBinding(scope, this, (ReferenceBinding) this.resolvedType, this.argumentTypes);
}
- ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType;
if (!this.binding.isValidBinding()) {
if (this.binding.declaringClass == null) {
- this.binding.declaringClass = allocationType;
+ this.binding.declaringClass = (ReferenceBinding) this.resolvedType;
}
if (this.type != null && !this.type.resolvedType.isValidBinding()) {
return null;
}
- state.scope.problemReporter().invalidConstructor(this, this.binding);
+ scope.problemReporter().invalidConstructor(this, this.binding);
return this.resolvedType;
}
if ((this.binding.tagBits & TagBits.HasMissingType) != 0) {
- state.scope.problemReporter().missingTypeInConstructor(this, this.binding);
+ scope.problemReporter().missingTypeInConstructor(this, this.binding);
}
- if (isMethodUseDeprecated(this.binding, state.scope, true)) {
- state.scope.problemReporter().deprecatedMethod(this.binding, this);
+ if (isMethodUseDeprecated(this.binding, scope, true)) {
+ scope.problemReporter().deprecatedMethod(this.binding, this);
}
- if (checkInvocationArguments(state.scope, null, allocationType, this.binding, this.arguments, state.argumentTypes, state.argsContainCast, this)) {
+ if (checkInvocationArguments(scope, null, this.resolvedType, this.binding, this.arguments, this.argumentTypes, this.argsContainCast, this)) {
this.bits |= ASTNode.Unchecked;
}
if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
- state.scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments);
+ scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments);
}
- if (!state.isDiamond && this.resolvedType.isParameterizedTypeWithActualArguments()) {
- checkTypeArgumentRedundancy((ParameterizedTypeBinding) this.resolvedType, this.resolvedType.enclosingType(), state.argumentTypes, state.scope);
+ if (!isDiamond && this.resolvedType.isParameterizedTypeWithActualArguments()) {
+ checkTypeArgumentRedundancy((ParameterizedTypeBinding) this.resolvedType, scope);
}
- CompilerOptions compilerOptions = state.scope.compilerOptions();
- if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && (this.binding.tagBits & TagBits.IsNullnessKnown) == 0) {
- new ImplicitNullAnnotationVerifier(state.scope.environment(), compilerOptions.inheritNullAnnotations)
- .checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, state.scope);
+ if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) {
+ if ((this.binding.tagBits & TagBits.IsNullnessKnown) == 0) {
+ new ImplicitNullAnnotationVerifier(scope.environment(), compilerOptions.inheritNullAnnotations)
+ .checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, scope);
+ }
+ if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8) {
+ if (this.binding instanceof ParameterizedGenericMethodBinding && this.typeArguments != null) {
+ TypeVariableBinding[] typeVariables = this.binding.original().typeVariables();
+ for (int i = 0; i < this.typeArguments.length; i++)
+ this.typeArguments[i].checkNullConstraints(scope, typeVariables, i);
+ }
+ }
}
- recordExceptionsForEnclosingLambda(state.scope, this.binding.thrownExceptions);
- return allocationType;
+ return this.resolvedType;
}
/**
@@ -590,38 +538,93 @@
}
}
-public TypeBinding[] inferElidedTypes(ParameterizedTypeBinding allocationType, ReferenceBinding enclosingType, TypeBinding[] argumentTypes, final BlockScope scope) {
+// For allocation expressions, boxing compatibility is same as vanilla compatibility, since java.lang's wrapper types are not generic.
+public boolean isBoxingCompatibleWith(TypeBinding targetType, Scope scope) {
+ return isPolyExpression() ? false : isCompatibleWith(scope.boxing(targetType), scope);
+}
+
+public boolean isCompatibleWith(TypeBinding targetType, final Scope scope) {
+ if (this.argumentsHaveErrors || this.binding == null || !this.binding.isValidBinding() || targetType == null || scope == null)
+ return false;
+ TypeBinding allocationType = this.resolvedType;
+ if (isPolyExpression()) {
+ TypeBinding originalExpectedType = this.typeExpected;
+ try {
+ MethodBinding method = this.solutionsPerTargetType != null ? this.solutionsPerTargetType.get(targetType) : null;
+ if (method == null) {
+ this.typeExpected = targetType;
+ method = inferConstructorOfElidedParameterizedType(scope); // caches result already.
+ if (method == null || !method.isValidBinding())
+ return false;
+ }
+ allocationType = method.declaringClass;
+ } finally {
+ this.typeExpected = originalExpectedType;
+ }
+ }
+ return allocationType != null && allocationType.isCompatibleWith(targetType, scope);
+}
+
+public MethodBinding inferConstructorOfElidedParameterizedType(final Scope scope) {
+ if (this.typeExpected != null && this.binding != null) {
+ MethodBinding cached = this.solutionsPerTargetType != null ? this.solutionsPerTargetType.get(this.typeExpected) : null;
+ if (cached != null)
+ return cached;
+ }
+ ReferenceBinding genericType = ((ParameterizedTypeBinding) this.resolvedType).genericType();
+ ReferenceBinding enclosingType = this.resolvedType.enclosingType();
+ ParameterizedTypeBinding allocationType = scope.environment().createParameterizedType(genericType, genericType.typeVariables(), enclosingType);
+
+ // Given the allocation type and the arguments to the constructor, see if we can infer the constructor of the elided parameterized type.
+ MethodBinding factory = scope.getStaticFactory(allocationType, enclosingType, this.argumentTypes, this);
+ if (factory instanceof ParameterizedGenericMethodBinding && factory.isValidBinding()) {
+ ParameterizedGenericMethodBinding genericFactory = (ParameterizedGenericMethodBinding) factory;
+ this.inferredReturnType = genericFactory.inferredReturnType;
+ SyntheticFactoryMethodBinding sfmb = (SyntheticFactoryMethodBinding) factory.original();
+ TypeVariableBinding[] constructorTypeVariables = sfmb.getConstructor().typeVariables();
+ TypeBinding [] constructorTypeArguments = constructorTypeVariables != null ? new TypeBinding[constructorTypeVariables.length] : Binding.NO_TYPES;
+ if (constructorTypeArguments.length > 0)
+ System.arraycopy(((ParameterizedGenericMethodBinding)factory).typeArguments, sfmb.typeVariables().length - constructorTypeArguments.length ,
+ constructorTypeArguments, 0, constructorTypeArguments.length);
+ MethodBinding constructor = sfmb.applyTypeArgumentsOnConstructor(((ParameterizedTypeBinding)factory.returnType).arguments, constructorTypeArguments);
+ if (constructor instanceof ParameterizedGenericMethodBinding && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8) {
+ // force an inference context to be established for nested poly allocations (to be able to transfer b2), but avoid tunneling through overload resolution. We know this is the MSMB.
+ if (this.expressionContext == INVOCATION_CONTEXT && this.typeExpected == null)
+ constructor = ParameterizedGenericMethodBinding.computeCompatibleMethod18(constructor.shallowOriginal(), this.argumentTypes, scope, this);
+ }
+ if (this.typeExpected != null)
+ registerResult(this.typeExpected, constructor);
+ return constructor;
+ }
+ return null;
+}
+
+public TypeBinding[] inferElidedTypes(final Scope scope) {
+
+ ReferenceBinding genericType = ((ParameterizedTypeBinding) this.resolvedType).genericType();
+ ReferenceBinding enclosingType = this.resolvedType.enclosingType();
+ ParameterizedTypeBinding allocationType = scope.environment().createParameterizedType(genericType, genericType.typeVariables(), enclosingType);
+
/* Given the allocation type and the arguments to the constructor, see if we can synthesize a generic static factory
method that would, given the argument types and the invocation site, manufacture a parameterized object of type allocationType.
If we are successful then by design and construction, the parameterization of the return type of the factory method is identical
to the types elided in the <>.
- */
- MethodBinding factory = scope.getStaticFactory(allocationType, enclosingType, argumentTypes, this);
+ */
+ MethodBinding factory = scope.getStaticFactory(allocationType, enclosingType, this.argumentTypes, this);
if (factory instanceof ParameterizedGenericMethodBinding && factory.isValidBinding()) {
ParameterizedGenericMethodBinding genericFactory = (ParameterizedGenericMethodBinding) factory;
this.inferredReturnType = genericFactory.inferredReturnType;
- // this is our last chance to inspect the result of the inference that is connected to the throw-away factory binding
- InferenceContext18 infCtx18 = getInferenceContext(genericFactory);
- if (infCtx18 != null && infCtx18.stepCompleted == InferenceContext18.BINDINGS_UPDATED) {
- // refresh argumentTypes from updated bindings in arguments:
- // (this shouldn't be strictly necessary, as FunctionExpression.isCompatibleWith() should give the same result,
- // but it's probably be a good idea to avoid the necessity to call isCompatibleWith() in the first place).
- for (int i = 0; i < argumentTypes.length; i++) {
- if (argumentTypes[i] instanceof PolyTypeBinding)
- argumentTypes[i] = this.arguments[i].resolvedType;
- }
- }
return ((ParameterizedTypeBinding)factory.returnType).arguments;
}
return null;
}
-public void checkTypeArgumentRedundancy(ParameterizedTypeBinding allocationType, ReferenceBinding enclosingType, TypeBinding[] argumentTypes, final BlockScope scope) {
+public void checkTypeArgumentRedundancy(ParameterizedTypeBinding allocationType, final BlockScope scope) {
if ((scope.problemReporter().computeSeverity(IProblem.RedundantSpecificationOfTypeArguments) == ProblemSeverities.Ignore) || scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_7) return;
if (allocationType.arguments == null) return; // raw binding
if (this.genericTypeArguments != null) return; // diamond can't occur with explicit type args for constructor
if (this.type == null) return;
- if (argumentTypes == Binding.NO_PARAMETERS && this.typeExpected instanceof ParameterizedTypeBinding) {
+ if (this.argumentTypes == Binding.NO_PARAMETERS && this.typeExpected instanceof ParameterizedTypeBinding) {
ParameterizedTypeBinding expected = (ParameterizedTypeBinding) this.typeExpected;
if (expected.arguments != null && allocationType.arguments.length == expected.arguments.length) {
// check the case when no ctor takes no params and inference uses the expected type directly
@@ -643,7 +646,7 @@
// checking for redundant type parameters must fake a diamond,
// so we infer the same results as we would get with a diamond in source code:
this.type.bits |= IsDiamond;
- inferredTypes = inferElidedTypes(allocationType, enclosingType, argumentTypes, scope);
+ inferredTypes = inferElidedTypes(scope);
} finally {
// reset effects of inference
this.type.bits = previousBits;
@@ -714,111 +717,42 @@
}
public boolean statementExpression() {
- return true;
+ return ((this.bits & ASTNode.ParenthesizedMASK) == 0);
}
//-- interface Invocation: --
-public MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope) {
- if (this.suspendedResolutionState != null && targetType != null) {
- setExpectedType(targetType);
- if (!resolvePart2(this.suspendedResolutionState)) {
- if (reportErrors && !this.suspendedResolutionState.hasReportedError) {
- if (this.suspendedResolutionState.cannotInferDiamond)
- scope.problemReporter().cannotInferElidedTypes(this);
- else
- scope.problemReporter().genericInferenceError("constructor is unexpectedly unresolved", this); //$NON-NLS-1$
- this.suspendedResolutionState.hasReportedError = true;
- }
- return null;
- }
- }
- if (reportErrors && this.binding != null && !this.binding.isValidBinding()) {
- if (this.binding.declaringClass == null)
- this.binding.declaringClass = (ReferenceBinding) this.resolvedType;
- if (this.suspendedResolutionState != null) {
- scope.problemReporter().invalidConstructor(this, this.binding);
- this.suspendedResolutionState.hasReportedError = true;
- }
- }
+public MethodBinding binding() {
return this.binding;
}
-public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
- this.typeExpected = targetType;
- boolean needsUpdate = this.binding == null || // not yet resolved
- (this.resolvedType != null && targetType != null && !this.resolvedType.isCompatibleWith(targetType)); // previous attempt was wrong
- if (needsUpdate && this.suspendedResolutionState != null && !this.suspendedResolutionState.hasReportedError) {
- // Attempt to resolve half resolved diamond
- resolvePart2(this.suspendedResolutionState);
- }
- // confer MessageSend.checkAgainstFinalTargetType(,,):
- if (this.binding instanceof ParameterizedGenericMethodBinding) {
- InferenceContext18 ctx = getInferenceContext((ParameterizedMethodBinding) this.binding);
- if (ctx != null && ctx.stepCompleted < InferenceContext18.TYPE_INFERRED) {
- this.typeExpected = targetType;
- MethodBinding updatedBinding = ctx.inferInvocationType(this, (ParameterizedGenericMethodBinding) this.binding);
- if (updateBindings(updatedBinding, targetType)) {
- ASTNode.resolvePolyExpressionArguments(this, updatedBinding, scope);
- }
- }
- }
- if (this.suspendedResolutionState != null) {
- return resolvePart3(this.suspendedResolutionState);
- }
- return this.resolvedType;
-}
public Expression[] arguments() {
return this.arguments;
}
-public boolean updateBindings(MethodBinding updatedBinding, TypeBinding targetType) {
- boolean hasUpdate = this.binding != updatedBinding;
- if (this.inferenceContexts != null && this.binding.original() == updatedBinding.original()) {
- InferenceContext18 ctx = (InferenceContext18)this.inferenceContexts.get(this.binding);
- if (ctx != null && updatedBinding instanceof ParameterizedGenericMethodBinding) {
- this.inferenceContexts.put(updatedBinding, ctx);
- // solution may have come from an outer inference, mark now that this (inner) is done (but not deep inners):
- hasUpdate |= ctx.registerSolution(targetType, updatedBinding);
- }
- }
- this.binding = updatedBinding;
- this.resolvedType = updatedBinding.declaringClass;
- return hasUpdate;
-}
public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 infCtx18) {
if (this.inferenceContexts == null)
this.inferenceContexts = new SimpleLookupTable();
this.inferenceContexts.put(method, infCtx18);
- MethodBinding original = method.original();
- if (original instanceof SyntheticFactoryMethodBinding) {
- SyntheticFactoryMethodBinding synthOriginal = (SyntheticFactoryMethodBinding)original;
- ParameterizedMethodBinding parameterizedCtor = synthOriginal.applyTypeArgumentsOnConstructor(method.typeArguments);
- this.inferenceContexts.put(parameterizedCtor, infCtx18);
+}
+
+@Override
+public void registerResult(TypeBinding targetType, MethodBinding method) {
+ if (method != null && method.isConstructor()) { // ignore the factory.
+ if (this.solutionsPerTargetType == null)
+ this.solutionsPerTargetType = new HashMap<TypeBinding, MethodBinding>();
+ this.solutionsPerTargetType.put(targetType, method);
}
}
-public boolean usesInference() {
- return (this.binding instanceof ParameterizedGenericMethodBinding)
- && getInferenceContext((ParameterizedGenericMethodBinding) this.binding) != null;
-}
+
public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
if (this.inferenceContexts == null)
return null;
return (InferenceContext18) this.inferenceContexts.get(method);
}
-public boolean innersNeedUpdate() {
- return this.innerInferenceHelper != null;
-}
-public void innerUpdateDone() {
- this.innerInferenceHelper = null;
-}
-public InnerInferenceHelper innerInferenceHelper() {
- return this.innerInferenceHelper;
-}
-
//-- interface InvocationSite: --
public ExpressionContext getExpressionContext() {
return this.expressionContext;
}
public InferenceContext18 freshInferenceContext(Scope scope) {
- return new InferenceContext18(scope, this.arguments, this);
+ return new InferenceContext18(scope, this.arguments, this, this.outerInferenceContext);
}
-}
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.java
index 93d3278..92b1cb1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Annotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,8 @@
* Bug 424728 - [1.8][null] Unexpected error: The nullness annotation 'XXXX' is not applicable at this location
* Bug 392245 - [1.8][compiler][null] Define whether / how @NonNullByDefault applies to TYPE_USE locations
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 457210 - [1.8][compiler][null] Wrong Nullness errors given on full build build but not on incremental build?
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
* Bug 409517 - [1.8][compiler] Type annotation problems on more elaborate array references
@@ -38,6 +40,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.EnumConstantSignature;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.BooleanConstant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IrritantSet;
@@ -396,26 +399,21 @@
// seeing this id implies that null annotation analysis is enabled
Object value = null;
if (valueAttribute != null) {
- if (valueAttribute.value instanceof FalseLiteral) {
- // parameter 'false' means: this annotation cancels any defaults
- tagBits |= TagBits.AnnotationNullUnspecifiedByDefault;
- break;
- } else if (valueAttribute.compilerElementPair != null) {
+ if (valueAttribute.compilerElementPair != null)
value = valueAttribute.compilerElementPair.value;
- }
- } else if (scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8) { // fetch default value - TODO: cache it?
+ } else { // fetch default value - TODO: cache it?
MethodBinding[] methods = annotationType.methods();
- if (methods != null && methods.length == 1) {
- Object defaultValue = methods[0].getDefaultValue();
- if (defaultValue instanceof Object[])
- value = defaultValue;
- }
+ if (methods != null && methods.length == 1)
+ value = methods[0].getDefaultValue();
+ else
+ tagBits |= TagBits.AnnotationNonNullByDefault; // custom unconfigurable NNBD
}
- if (value != null) {
- tagBits |= nullTagBitsFromAnnotationValue(value);
- } else {
- // neither explicit value, nor default value from DefaultLocation (1.8)
- tagBits |= TagBits.AnnotationNonNullByDefault;
+ if (value instanceof BooleanConstant) {
+ // boolean value is used for declaration annotations, signal using the annotation tag bit:
+ tagBits |= ((BooleanConstant)value).booleanValue() ? TagBits.AnnotationNonNullByDefault : TagBits.AnnotationNullUnspecifiedByDefault;
+ } else if (value != null) {
+ // non-boolean value signals type annotations, evaluate from DefaultLocation[] to bitvector a la Binding#NullnessDefaultMASK:
+ tagBits |= nullLocationBitsFromAnnotationValue(value);
}
break;
}
@@ -428,17 +426,17 @@
*
* <b>pre:</b> null annotation analysis is enabled
*/
- public static int nullTagBitsFromAnnotationValue(Object value) {
+ public static int nullLocationBitsFromAnnotationValue(Object value) {
if (value instanceof Object[]) {
- if (((Object[]) value).length == 0) {
+ if (((Object[]) value).length == 0) { // ({})
return Binding.NULL_UNSPECIFIED_BY_DEFAULT;
- } else {
+ } else { // ({vals...})
int bits = 0;
for (Object single : (Object[])value)
bits |= evaluateDefaultNullnessLocation(single);
return bits;
}
- } else {
+ } else { // (val)
return evaluateDefaultNullnessLocation(value);
}
}
@@ -451,6 +449,8 @@
name = ((EnumConstantSignature) value).getEnumConstantName();
} else if (value instanceof ElementValuePair.UnresolvedEnumConstant) {
name = ((ElementValuePair.UnresolvedEnumConstant) value).getEnumConstantName();
+ } else if (value instanceof BooleanConstant) {
+ return ((BooleanConstant)value).booleanValue() ? Binding.NONNULL_BY_DEFAULT : Binding.NULL_UNSPECIFIED_BY_DEFAULT;
}
if (name != null) {
switch (name.length) {
@@ -782,7 +782,7 @@
}
}
if (isSuppressingWarnings && suppressWarningIrritants != null) {
- scope.referenceCompilationUnit().recordSuppressWarnings(suppressWarningIrritants, this, startSuppresss, endSuppress);
+ scope.referenceCompilationUnit().recordSuppressWarnings(suppressWarningIrritants, this, startSuppresss, endSuppress, scope.referenceContext());
}
}
@@ -876,7 +876,7 @@
tagBits &= ~Binding.NullnessDefaultMASK;
// record annotation positions in the compilation result
- scope.referenceCompilationUnit().recordSuppressWarnings(IrritantSet.NLS, null, this.sourceStart, this.declarationSourceEnd);
+ scope.referenceCompilationUnit().recordSuppressWarnings(IrritantSet.NLS, null, this.sourceStart, this.declarationSourceEnd, scope.referenceContext());
if (this.recipient != null) {
int kind = this.recipient.kind();
if (tagBits != 0 || defaultNullness != 0) {
@@ -951,41 +951,27 @@
}
break;
}
+ }
+ if (kind == Binding.TYPE) {
+ SourceTypeBinding sourceType = (SourceTypeBinding) this.recipient;
+ if (CharOperation.equals(sourceType.sourceName, TypeConstants.PACKAGE_INFO_NAME))
+ kind = Binding.PACKAGE;
}
- checkAnnotationTarget(this, scope, annotationType, kind);
+ checkAnnotationTarget(this, scope, annotationType, kind, this.recipient, tagBits & TagBits.AnnotationNullMASK);
}
return this.resolvedType;
}
- static boolean isAnnotationTargetAllowed(Annotation annotation, BlockScope scope, TypeBinding annotationType, int kind) {
- long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
- if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {
- // does not specify any target restriction - all locations supported in Java 7 and before are possible
- if (kind == Binding.TYPE_PARAMETER || kind == Binding.TYPE_USE) {
- scope.problemReporter().explitAnnotationTargetRequired(annotation);
- }
- return true;
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=391201
- if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) == 0
- && (metaTagBits & (TagBits.AnnotationForTypeUse | TagBits.AnnotationForTypeParameter)) != 0) {
- if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8) {
- switch (kind) {
- case Binding.PACKAGE :
- case Binding.TYPE :
- case Binding.GENERIC_TYPE :
- case Binding.METHOD :
- case Binding.FIELD :
- case Binding.LOCAL :
- scope.problemReporter().invalidUsageOfTypeAnnotations(annotation);
- }
- }
- }
+ private static boolean isAnnotationTargetAllowed(Binding recipient, BlockScope scope, TypeBinding annotationType, int kind, long metaTagBits) {
switch (kind) {
case Binding.PACKAGE :
if ((metaTagBits & TagBits.AnnotationForPackage) != 0)
return true;
+ else if (scope.compilerOptions().sourceLevel <= ClassFileConstants.JDK1_6) {
+ SourceTypeBinding sourceType = (SourceTypeBinding) recipient;
+ if (CharOperation.equals(sourceType.sourceName, TypeConstants.PACKAGE_INFO_NAME))
+ return true;
+ }
break;
case Binding.TYPE_USE :
if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
@@ -999,18 +985,18 @@
break;
case Binding.TYPE :
case Binding.GENERIC_TYPE :
- if (((ReferenceBinding)annotation.recipient).isAnnotationType()) {
+ if (((ReferenceBinding)recipient).isAnnotationType()) {
if ((metaTagBits & (TagBits.AnnotationForAnnotationType | TagBits.AnnotationForType | TagBits.AnnotationForTypeUse)) != 0)
return true;
} else if ((metaTagBits & (TagBits.AnnotationForType | TagBits.AnnotationForTypeUse)) != 0) {
return true;
} else if ((metaTagBits & TagBits.AnnotationForPackage) != 0) {
- if (CharOperation.equals(((ReferenceBinding) annotation.recipient).sourceName, TypeConstants.PACKAGE_INFO_NAME))
+ if (CharOperation.equals(((ReferenceBinding) recipient).sourceName, TypeConstants.PACKAGE_INFO_NAME))
return true;
}
break;
case Binding.METHOD :
- MethodBinding methodBinding = (MethodBinding) annotation.recipient;
+ MethodBinding methodBinding = (MethodBinding) recipient;
if (methodBinding.isConstructor()) {
if ((metaTagBits & (TagBits.AnnotationForConstructor | TagBits.AnnotationForTypeUse)) != 0)
return true;
@@ -1028,7 +1014,7 @@
if ((metaTagBits & TagBits.AnnotationForField) != 0) {
return true;
} else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
- FieldBinding sourceField = (FieldBinding) annotation.recipient;
+ FieldBinding sourceField = (FieldBinding) recipient;
SourceTypeBinding sourceType = (SourceTypeBinding) sourceField.declaringClass;
FieldDeclaration fieldDeclaration = sourceType.scope.referenceContext.declarationOf(sourceField);
if (isTypeUseCompatible(fieldDeclaration.type, scope)) {
@@ -1037,7 +1023,7 @@
}
break;
case Binding.LOCAL :
- LocalVariableBinding localVariableBinding = (LocalVariableBinding) annotation.recipient;
+ LocalVariableBinding localVariableBinding = (LocalVariableBinding) recipient;
if ((localVariableBinding.tagBits & TagBits.IsArgument) != 0) {
if ((metaTagBits & TagBits.AnnotationForParameter) != 0) {
return true;
@@ -1063,7 +1049,44 @@
return false;
}
- static void checkAnnotationTarget(Annotation annotation, BlockScope scope, ReferenceBinding annotationType, int kind) {
+ public static boolean isAnnotationTargetAllowed(BlockScope scope, TypeBinding annotationType, Binding recipient) {
+ long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
+ if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {
+ return true;
+ }
+ return isAnnotationTargetAllowed(recipient, scope, annotationType, recipient.kind(), metaTagBits);
+ }
+
+ static boolean isAnnotationTargetAllowed(Annotation annotation, BlockScope scope, TypeBinding annotationType, int kind) {
+
+ long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
+ if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {
+ // does not specify any target restriction - all locations supported in Java 7 and before are possible
+ if (kind == Binding.TYPE_PARAMETER || kind == Binding.TYPE_USE) {
+ scope.problemReporter().explitAnnotationTargetRequired(annotation);
+ }
+ return true;
+ }
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=391201
+ if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) == 0
+ && (metaTagBits & (TagBits.AnnotationForTypeUse | TagBits.AnnotationForTypeParameter)) != 0) {
+ if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8) {
+ switch (kind) {
+ case Binding.PACKAGE :
+ case Binding.TYPE :
+ case Binding.GENERIC_TYPE :
+ case Binding.METHOD :
+ case Binding.FIELD :
+ case Binding.LOCAL :
+ scope.problemReporter().invalidUsageOfTypeAnnotations(annotation);
+ }
+ }
+ }
+ return isAnnotationTargetAllowed(annotation.recipient, scope, annotationType, kind, metaTagBits);
+ }
+
+ static void checkAnnotationTarget(Annotation annotation, BlockScope scope, ReferenceBinding annotationType, int kind, Binding recipient, long tagBitsToRevert) {
// check (meta)target compatibility
if (!annotationType.isValidBinding()) {
// no need to check annotation usage if missing
@@ -1071,6 +1094,8 @@
}
if (! isAnnotationTargetAllowed(annotation, scope, annotationType, kind)) {
scope.problemReporter().disallowedTargetForAnnotation(annotation);
+ if (recipient instanceof TypeBinding)
+ ((TypeBinding)recipient).tagBits &= ~tagBitsToRevert;
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
index 9d135f4..a33775a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -138,7 +138,8 @@
if (this.defaultValue != null) {
MemberValuePair pair = new MemberValuePair(this.selector, this.sourceStart, this.sourceEnd, this.defaultValue);
pair.binding = this.binding;
- pair.resolveTypeExpecting(this.scope, returnTypeBinding);
+ if (pair.value.resolvedType == null)
+ pair.resolveTypeExpecting(this.scope, returnTypeBinding);
this.binding.setDefaultValue(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ElementValuePair.getValue(this.defaultValue));
} else { // let it know it does not have a default value so it won't try to find it
this.binding.setDefaultValue(null);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.java
index f9b47b6..f4048ae 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Argument.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
* Bug 392238 - [1.8][compiler][null] Detect semantically invalid null type annotations
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
* Bug 438012 - [1.8][null] Bogus Warning: The nullness annotation is redundant with a default that applies to this location
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 409246 - [1.8][compiler] Type annotations on catch parameters not handled properly
*******************************************************************************/
@@ -21,6 +22,7 @@
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.*;
@@ -53,6 +55,11 @@
}
this.bits |= (IsLocalDeclarationReachable | IsArgument | IsTypeElided);
}
+
+ @Override
+ public boolean isRecoveredFromLoneIdentifier() {
+ return false;
+ }
public TypeBinding createBinding(MethodScope scope, TypeBinding typeBinding) {
if (this.binding == null) {
@@ -85,10 +92,12 @@
Binding existingVariable = scope.getBinding(this.name, Binding.VARIABLE, this, false /*do not resolve hidden field*/);
if (existingVariable != null && existingVariable.isValidBinding()){
final boolean localExists = existingVariable instanceof LocalVariableBinding;
- if (localExists && (this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope()) {
- scope.problemReporter().lambdaRedeclaresArgument(this);
- } else if (localExists && this.hiddenVariableDepth == 0) {
- scope.problemReporter().redefineArgument(this);
+ if (localExists && this.hiddenVariableDepth == 0) {
+ if ((this.bits & ASTNode.ShadowsOuterLocal) != 0 && scope.isLambdaSubscope()) {
+ scope.problemReporter().lambdaRedeclaresArgument(this);
+ } else {
+ scope.problemReporter().redefineArgument(this);
+ }
} else {
boolean isSpecialArgument = false;
if (existingVariable instanceof FieldBinding) {
@@ -128,10 +137,10 @@
return (this.bits & IsTypeElided) != 0;
}
- public boolean hasNullTypeAnnotation() {
+ public boolean hasNullTypeAnnotation(AnnotationPosition position) {
// parser associates SE8 annotations to the declaration
return TypeReference.containsNullAnnotation(this.annotations) ||
- (this.type != null && this.type.hasNullTypeAnnotation()); // just in case
+ (this.type != null && this.type.hasNullTypeAnnotation(position)); // just in case
}
public StringBuffer print(int indent, StringBuffer output) {
@@ -205,7 +214,7 @@
resolveAnnotations(scope, this.annotations, this.binding, true);
Annotation.isTypeUseCompatible(this.type, scope, this.annotations);
if (scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled &&
- (this.type.hasNullTypeAnnotation() || TypeReference.containsNullAnnotation(this.annotations)))
+ (this.type.hasNullTypeAnnotation(AnnotationPosition.ANY) || TypeReference.containsNullAnnotation(this.annotations)))
{
scope.problemReporter().nullAnnotationUnsupportedLocation(this.type);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
index 1637f89..304bacc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
@@ -13,6 +13,7 @@
* bug 388996 - [compiler][resource] Incorrect 'potential resource leak'
* Bug 417758 - [1.8][null] Null safety compromise during array creation.
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
*******************************************************************************/
@@ -21,7 +22,6 @@
import static org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExpressionContext.ASSIGNMENT_CONTEXT;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@@ -46,8 +46,7 @@
if (this.expressions != null) {
CompilerOptions compilerOptions = currentScope.compilerOptions();
boolean analyseResources = compilerOptions.analyseResourceLeaks;
- boolean evalNullTypeAnnotations = compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8
- && compilerOptions.isAnnotationBasedNullAnalysisEnabled;
+ boolean evalNullTypeAnnotations = currentScope.environment().usesNullTypeAnnotations();
for (int i = 0, max = this.expressions.length; i < max; i++) {
flowInfo = this.expressions[i].analyseCode(currentScope, flowContext, flowInfo).unconditionalInits();
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java
index 8ffbec5..ecfaf14 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java
@@ -204,7 +204,7 @@
this.receiver.computeConversion(scope, arrayType, arrayType);
if (arrayType.isArrayType()) {
TypeBinding elementType = ((ArrayBinding) arrayType).elementsType();
- this.resolvedType = ((this.bits & ASTNode.IsStrictlyAssigned) == 0) ? elementType.capture(scope, this.sourceEnd) : elementType;
+ this.resolvedType = ((this.bits & ASTNode.IsStrictlyAssigned) == 0) ? elementType.capture(scope, this.sourceStart, this.sourceEnd) : elementType;
} else {
scope.problemReporter().referenceMustBeArrayTypeAt(arrayType, this);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
index 9a35544..2cf0c4c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
* Stephan Herrmann - Contribution for
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -182,18 +183,31 @@
}
@Override
- public boolean hasNullTypeAnnotation() {
- if (super.hasNullTypeAnnotation())
- return true;
- if (this.resolvedType != null && !this.resolvedType.hasNullTypeAnnotations())
- return false; // shortcut
- if (this.annotationsOnDimensions != null) {
- for (int i = 0; i < this.annotationsOnDimensions.length; i++) {
- Annotation[] innerAnnotations = this.annotationsOnDimensions[i];
- if (containsNullAnnotation(innerAnnotations))
+ public boolean hasNullTypeAnnotation(AnnotationPosition position) {
+ switch (position) {
+ case LEAF_TYPE:
+ // ignore annotationsOnDimensions:
+ return super.hasNullTypeAnnotation(position);
+ case MAIN_TYPE:
+ // outermost dimension only:
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions.length > 0) {
+ Annotation[] innerAnnotations = this.annotationsOnDimensions[0];
+ return containsNullAnnotation(innerAnnotations);
+ }
+ break;
+ case ANY:
+ if (super.hasNullTypeAnnotation(position))
return true;
- }
- }
+ if (this.resolvedType != null && !this.resolvedType.hasNullTypeAnnotations())
+ return false; // shortcut
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0; i < this.annotationsOnDimensions.length; i++) {
+ Annotation[] innerAnnotations = this.annotationsOnDimensions[i];
+ if (containsNullAnnotation(innerAnnotations))
+ return true;
+ }
+ }
+ }
return false;
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.java
index 0ed7fcb..e22294e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Assignment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,6 +27,8 @@
* bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -94,7 +96,7 @@
if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) {
VariableBinding var = this.lhs.nullAnnotatedVariableBinding(compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8);
if (var != null) {
- nullStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, var, nullStatus, this.expression, this.expression.resolvedType);
+ nullStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, var, flowInfo, nullStatus, this.expression, this.expression.resolvedType);
if (nullStatus == FlowInfo.NON_NULL
&& var instanceof FieldBinding
&& this.lhs instanceof Reference
@@ -158,6 +160,8 @@
}
public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) {
+ if ((this.implicitConversion & TypeIds.BOXING) != 0)
+ return FlowInfo.NON_NULL;
return this.expression.nullStatus(flowInfo, flowContext);
}
@@ -193,7 +197,7 @@
this.expression.setExpressionContext(ASSIGNMENT_CONTEXT);
this.expression.setExpectedType(lhsType); // needed in case of generic method invocation
if (lhsType != null) {
- this.resolvedType = lhsType.capture(scope, this.sourceEnd);
+ this.resolvedType = lhsType.capture(scope, this.lhs.sourceStart, this.lhs.sourceEnd); // make it unique, `this' shares source end with 'this.expression'.
}
LocalVariableBinding localVariableBinding = this.lhs.localVariableBinding();
if (localVariableBinding != null && (localVariableBinding.isCatchParameter() || localVariableBinding.isParameter())) {
@@ -265,6 +269,6 @@
return this.lhs.localVariableBinding();
}
public boolean statementExpression() {
- return true;
+ return ((this.bits & ASTNode.ParenthesizedMASK) == 0);
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.java
index bc806df..50d14b3 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Block.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 383368 - [compiler][null] syntactic null analysis for field references
* bug 402993 - [null] Follow up of bug 401088: Missing warning about redundant null check
+ * Bug 440282 - [resource] Resource leak detection false negative with empty finally block
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -27,12 +28,7 @@
public int explicitDeclarations;
// the number of explicit declaration , used to create scope
public BlockScope scope;
- public boolean lambdaBody;
-public Block(int explicitDeclarations, boolean lambdaBody) {
- this.explicitDeclarations = explicitDeclarations;
- this.lambdaBody = lambdaBody;
-}
public Block(int explicitDeclarations) {
this.explicitDeclarations = explicitDeclarations;
}
@@ -53,9 +49,11 @@
flowContext.expireNullCheckedFieldInfo();
}
}
- if (this.explicitDeclarations > 0) {
- // if block has its own scope analyze tracking vars now:
+ if (this.scope != currentScope) {
+ // if block is tracking any resources other than the enclosing 'currentScope', analyse them now:
this.scope.checkUnclosedCloseables(flowInfo, flowContext, null, null);
+ }
+ if (this.explicitDeclarations > 0) {
// cleanup assignment info for locals that are scoped to this block:
LocalVariableBinding[] locals = this.scope.locals;
if (locals != null) {
@@ -152,4 +150,17 @@
this.statements[this.statements.length - 1].branchChainTo(label);
}
}
+
+// A block does not complete normally if the last statement which we presume is reachable does not complete normally.
+@Override
+public boolean doesNotCompleteNormally() {
+ int length = this.statements == null ? 0 : this.statements.length;
+ return length > 0 && this.statements[length - 1].doesNotCompleteNormally();
+}
+
+@Override
+public boolean completesByContinue() {
+ int length = this.statements == null ? 0 : this.statements.length;
+ return length > 0 && this.statements[length - 1].completesByContinue();
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java
index a0cb282..d3f4633 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java
@@ -95,4 +95,8 @@
visitor.visit(this, blockscope);
visitor.endVisit(this, blockscope);
}
+@Override
+public boolean doesNotCompleteNormally() {
+ return true;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
index ffaa51e..d598a7f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,8 @@
* Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
* Bug 430150 - [1.8][null] stricter checking against type variables
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 415541 - [1.8][compiler] Type annotations in the body of static initializer get dropped
*******************************************************************************/
@@ -89,7 +91,7 @@
if (castedExpressionType == null || rhs.resolvedType.isBaseType()) return;
//if (castedExpressionType.id == T_null) return; // tolerate null expression cast
if (castedExpressionType.isCompatibleWith(expectedType, scope)) {
- if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8) {
+ if (scope.environment().usesNullTypeAnnotations()) {
// are null annotations compatible, too?
if (NullAnnotationMatching.analyse(expectedType, castedExpressionType, -1).isAnyMismatch())
return; // already reported unchecked cast (nullness), say no more.
@@ -281,8 +283,11 @@
public int sourceEnd() { return 0; }
public TypeBinding invocationTargetType() { return invocationSite.invocationTargetType(); }
public boolean receiverIsImplicitThis() { return invocationSite.receiverIsImplicitThis();}
- public InferenceContext18 freshInferenceContext(Scope someScope) { return null; /* suppress inference */ }
+ public InferenceContext18 freshInferenceContext(Scope someScope) { return invocationSite.freshInferenceContext(someScope); }
public ExpressionContext getExpressionContext() { return invocationSite.getExpressionContext(); }
+ public boolean isQualifiedSuper() { return invocationSite.isQualifiedSuper(); }
+ public boolean checkingPotentialCompatibility() { return false; }
+ public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) {/* ignore */}
};
MethodBinding bindingIfNoCast;
if (binding.isConstructor()) {
@@ -322,7 +327,8 @@
public boolean checkUnsafeCast(Scope scope, TypeBinding castType, TypeBinding expressionType, TypeBinding match, boolean isNarrowing) {
if (TypeBinding.equalsEquals(match, castType)) {
- if (!isNarrowing && TypeBinding.equalsEquals(match, this.resolvedType.leafComponentType())) { // do not tag as unnecessary when recursing through upper bounds
+ if (!isNarrowing && TypeBinding.equalsEquals(match, this.resolvedType.leafComponentType()) // do not tag as unnecessary when recursing through upper bounds
+ && !(expressionType.isParameterizedType() && expressionType.isProvablyDistinct(castType))) {
tagAsUnnecessaryCast(scope, castType);
}
return true;
@@ -457,9 +463,8 @@
}
if (valueRequired) {
codeStream.generateImplicitConversion(this.implicitConversion);
- } else if (needRuntimeCheckcast) {
- boolean isUnboxing = (this.implicitConversion & TypeIds.UNBOXING) != 0;
- switch (isUnboxing ? postConversionType(currentScope).id : this.resolvedType.id) {
+ } else if (annotatedCast || needRuntimeCheckcast) {
+ switch (this.resolvedType.id) {
case T_long :
case T_double :
codeStream.pop2();
@@ -488,6 +493,8 @@
}
public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) {
+ if ((this.implicitConversion & TypeIds.BOXING) != 0)
+ return FlowInfo.NON_NULL;
return this.expression.nullStatus(flowInfo, flowContext);
}
@@ -580,7 +587,7 @@
this.bits |= ASTNode.DisableUnnecessaryCastCheck; // disable further secondary diagnosis
}
}
- this.resolvedType = castType.capture(scope, this.sourceEnd);
+ this.resolvedType = castType.capture(scope, this.type.sourceStart, this.type.sourceEnd); // make it unique, a cast expression shares source end with the expression.
if (exprContainCast) {
checkNeedForCastCast(scope, this);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
index 4de8a57..4783bee 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
@@ -500,7 +500,10 @@
this.stringLiterals[this.stringLiteralsPtr++] = literal;
}
-public void recordSuppressWarnings(IrritantSet irritants, Annotation annotation, int scopeStart, int scopeEnd) {
+public void recordSuppressWarnings(IrritantSet irritants, Annotation annotation, int scopeStart, int scopeEnd, ReferenceContext context) {
+ if (context instanceof LambdaExpression && context != ((LambdaExpression) context).original())
+ return; // Do not record from copies. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=441929
+
if (this.suppressWarningIrritants == null) {
this.suppressWarningIrritants = new IrritantSet[3];
this.suppressWarningAnnotations = new Annotation[3];
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
index 6122965..c5d1736 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
* Bug 418537 - [1.8][null] Fix null type annotation analysis for poly conditional expressions
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
+ * Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -36,7 +37,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.*;
-public class ConditionalExpression extends OperatorExpression {
+public class ConditionalExpression extends OperatorExpression implements IPolyExpression {
public Expression condition, valueIfTrue, valueIfFalse;
public Constant optimizedBooleanConstant;
@@ -57,12 +58,9 @@
private boolean isPolyExpression = false;
private TypeBinding originalValueIfTrueType;
private TypeBinding originalValueIfFalseType;
- private BlockScope polyExpressionScope;
private boolean use18specifics;
- public ConditionalExpression(
- Expression condition,
- Expression valueIfTrue,
- Expression valueIfFalse) {
+
+ public ConditionalExpression(Expression condition, Expression valueIfTrue, Expression valueIfFalse) {
this.condition = condition;
this.valueIfTrue = valueIfTrue;
this.valueIfFalse = valueIfFalse;
@@ -421,6 +419,8 @@
}
public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) {
+ if ((this.implicitConversion & TypeIds.BOXING) != 0)
+ return FlowInfo.NON_NULL;
return this.nullStatus;
}
@@ -464,32 +464,26 @@
if (this.valueIfFalse instanceof CastExpression) this.valueIfFalse.bits |= DisableUnnecessaryCastCheck; // will check later on
this.originalValueIfFalseType = this.valueIfFalse.resolveType(scope);
- if (isPolyExpression()) {
- if (this.expectedType == null) {
- this.polyExpressionScope = scope; // preserve for eventual resolution/error reporting.
- }
- }
-
if (conditionType == null || this.originalValueIfTrueType == null || this.originalValueIfFalseType == null)
return null;
} else {
- /* Not reached as of now as we don't evaluate conditional expressions multiple times, left in for now.
- If in future, we change things so control reaches here, a precondition is that this.expectedType is
- the final target type.
- */
if (this.originalValueIfTrueType.kind() == Binding.POLY_TYPE)
this.originalValueIfTrueType = this.valueIfTrue.resolveType(scope);
if (this.originalValueIfFalseType.kind() == Binding.POLY_TYPE)
this.originalValueIfFalseType = this.valueIfFalse.resolveType(scope);
+
+ if (this.originalValueIfTrueType == null || !this.originalValueIfTrueType.isValidBinding())
+ return this.resolvedType = null;
+ if (this.originalValueIfFalseType == null || !this.originalValueIfFalseType.isValidBinding())
+ return this.resolvedType = null;
}
if (isPolyExpression()) {
if (this.expectedType == null) {
- this.polyExpressionScope = scope; // preserve for eventual resolution/error reporting.
return new PolyTypeBinding(this);
}
- computeConversions(scope, this.expectedType);
- return this.resolvedType = this.expectedType;
+ return this.resolvedType = computeConversions(scope, this.expectedType) ? this.expectedType : null;
}
+
TypeBinding valueIfTrueType = this.originalValueIfTrueType;
TypeBinding valueIfFalseType = this.originalValueIfFalseType;
if (use15specifics && TypeBinding.notEquals(valueIfTrueType, valueIfFalseType)) {
@@ -640,7 +634,7 @@
if (commonType != null) {
this.valueIfTrue.computeConversion(scope, commonType, this.originalValueIfTrueType);
this.valueIfFalse.computeConversion(scope, commonType, this.originalValueIfFalseType);
- return this.resolvedType = commonType.capture(scope, this.sourceEnd);
+ return this.resolvedType = commonType.capture(scope, this.sourceStart, this.sourceEnd);
}
} else {
// < 1.5 : one operand must be convertible to the other
@@ -661,7 +655,8 @@
return null;
}
- protected void computeConversions(BlockScope scope, TypeBinding targetType) {
+ protected boolean computeConversions(BlockScope scope, TypeBinding targetType) {
+ boolean ok = true;
if (this.originalValueIfTrueType != null && this.originalValueIfTrueType.isValidBinding()) {
if (this.valueIfTrue.isConstantValueOfTypeAssignableToType(this.originalValueIfTrueType, targetType)
|| this.originalValueIfTrueType.isCompatibleWith(targetType)) {
@@ -682,6 +677,7 @@
}
} else {
scope.problemReporter().typeMismatchError(this.originalValueIfTrueType, targetType, this.valueIfTrue, null);
+ ok = false;
}
}
if (this.originalValueIfFalseType != null && this.originalValueIfFalseType.isValidBinding()) {
@@ -704,8 +700,10 @@
}
} else {
scope.problemReporter().typeMismatchError(this.originalValueIfFalseType, targetType, this.valueIfFalse, null);
+ ok = false;
}
}
+ return ok;
}
public void setExpectedType(TypeBinding expectedType) {
@@ -720,23 +718,36 @@
return this.expressionContext;
}
- public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
- // in 1.8 if treated as a poly expression:
- if (isPolyExpression()) {
- targetType = targetType.uncapture(this.polyExpressionScope);
- this.originalValueIfTrueType = this.valueIfTrue.checkAgainstFinalTargetType(targetType, scope);
- this.originalValueIfFalseType = this.valueIfFalse.checkAgainstFinalTargetType(targetType, scope);
- computeConversions(this.polyExpressionScope, targetType);
- this.resolvedType = targetType;
- }
- return this.resolvedType;
+ @Override
+ public Expression[] getPolyExpressions() {
+ Expression [] truePolys = this.valueIfTrue.getPolyExpressions();
+ Expression [] falsePolys = this.valueIfFalse.getPolyExpressions();
+ if (truePolys.length == 0)
+ return falsePolys;
+ if (falsePolys.length == 0)
+ return truePolys;
+ Expression [] allPolys = new Expression [truePolys.length + falsePolys.length];
+ System.arraycopy(truePolys, 0, allPolys, 0, truePolys.length);
+ System.arraycopy(falsePolys, 0, allPolys, truePolys.length, falsePolys.length);
+ return allPolys;
}
-
+
public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method) {
return this.valueIfTrue.isPertinentToApplicability(targetType, method)
&& this.valueIfFalse.isPertinentToApplicability(targetType, method);
}
+ @Override
+ public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope) {
+ return this.valueIfTrue.isPotentiallyCompatibleWith(targetType, scope)
+ && this.valueIfFalse.isPotentiallyCompatibleWith(targetType, scope);
+ }
+
+ @Override
+ public boolean isFunctionalType() {
+ return this.valueIfTrue.isFunctionalType() || this.valueIfFalse.isFunctionalType(); // Even if only one arm is functional type, this will require a functional interface target
+ }
+
public boolean isPolyExpression() throws UnsupportedOperationException {
if (!this.use18specifics)
@@ -786,11 +797,6 @@
this.valueIfTrue.sIsMoreSpecific(s, t, scope) && this.valueIfFalse.sIsMoreSpecific(s, t, scope):
false;
}
-
- public void tagAsEllipsisArgument() {
- this.valueIfTrue.tagAsEllipsisArgument();
- this.valueIfFalse.tagAsEllipsisArgument();
- }
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
index 1136ab1..c3f819c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,8 +19,11 @@
* bug 400421 - [compiler] Null analysis for fields does not take @com.google.inject.Inject into account
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
* Bug 416176 - [1.8][compiler][null] null type annotations cause grief on type variables
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 415399 - [1.8][compiler] Type annotations on constructor results dropped by the code generator
+ * Ulrich Grave <ulrich.grave@gmx.de> - Contributions for
+ * bug 386692 - Missing "unused" warning on "autowired" fields
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -142,10 +145,10 @@
}
// nullity and mark as assigned
- if (classScope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8)
- analyseArguments(flowInfo, this.arguments, this.binding);
- else
+ if (classScope.environment().usesNullTypeAnnotations())
analyseArguments18(flowInfo, this.arguments, this.binding);
+ else
+ analyseArguments(flowInfo, this.arguments, this.binding);
// propagate to constructor call
if (this.constructorCall != null) {
@@ -243,6 +246,14 @@
if (CharOperation.equals(memberValuePairs[j].name, TypeConstants.OPTIONAL))
return memberValuePairs[j].value instanceof FalseLiteral;
}
+ } else if (annotation.resolvedType.id == TypeIds.T_OrgSpringframeworkBeansFactoryAnnotationAutowired) {
+ MemberValuePair[] memberValuePairs = annotation.memberValuePairs();
+ if (memberValuePairs == Annotation.NoValuePairs)
+ return true;
+ for (int j = 0; j < memberValuePairs.length; j++) {
+ if (CharOperation.equals(memberValuePairs[j].name, TypeConstants.REQUIRED))
+ return memberValuePairs[j].value instanceof TrueLiteral;
+ }
}
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java
index 2cd4afb..b271f41 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java
@@ -98,4 +98,12 @@
visitor.visit(this, blockScope);
visitor.endVisit(this, blockScope);
}
+@Override
+public boolean doesNotCompleteNormally() {
+ return true;
+}
+@Override
+public boolean completesByContinue() {
+ return true;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
index 74f24e0..2390898 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
* bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
+ * Bug 415790 - [compiler][resource]Incorrect potential resource leak warning in for loop with close in try/catch
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -119,7 +120,8 @@
}
if (loopingContext.hasEscapingExceptions()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=321926
FlowInfo loopbackFlowInfo = flowInfo.copy();
- loopbackFlowInfo.mergedWith(condInfo.initsWhenTrue().unconditionalCopy());
+ // loopback | (loopback + action + condition):
+ loopbackFlowInfo = loopbackFlowInfo.mergedWith(loopbackFlowInfo.unconditionalCopy().addNullInfoFrom(condInfo.initsWhenTrue()).unconditionalInits());
loopingContext.simulateThrowAfterLoopBack(loopbackFlowInfo);
}
// end of loop
@@ -226,4 +228,23 @@
}
visitor.endVisit(this, scope);
}
+
+@Override
+public boolean doesNotCompleteNormally() {
+ Constant cst = this.condition.constant;
+ boolean isConditionTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
+ cst = this.condition.optimizedBooleanConstant();
+ boolean isConditionOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
+
+ if (isConditionTrue || isConditionOptimizedTrue)
+ return this.action == null || !this.action.breaksOut(null);
+ if (this.action == null || this.action.breaksOut(null))
+ return false;
+ return this.action.doesNotCompleteNormally() && !this.action.completesByContinue();
+}
+
+@Override
+public boolean completesByContinue() {
+ return this.action.continuesAtOuterLabel();
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
index 10d93d8..3c20a3b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
@@ -26,6 +26,7 @@
* Bug 427483 - [Java 8] Variables in lambdas sometimes can't be resolved
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 409245 - [1.8][compiler] Type annotations dropped when call is routed through a synthetic bridge method
*******************************************************************************/
@@ -59,7 +60,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.VariableBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
public class ExplicitConstructorCall extends Statement implements Invocation {
@@ -80,10 +80,6 @@
// TODO Remove once DOMParser is activated
public int typeArgumentsSourceStart;
- // hold on to this context from invocation applicability inference until invocation type inference (per method candidate):
- private SimpleLookupTable/*<PGMB,InferenceContext18>*/ inferenceContexts;
- private InnerInferenceHelper innerInferenceHelper;
-
public ExplicitConstructorCall(int accessMode) {
this.accessMode = accessMode;
}
@@ -411,10 +407,6 @@
if ((argumentTypes[i] = argument.resolveType(scope)) == null) {
argHasError = true;
}
- if (sourceLevel >= ClassFileConstants.JDK1_8 && argument.isPolyExpression()) {
- if (this.innerInferenceHelper == null)
- this.innerInferenceHelper = new InnerInferenceHelper();
- }
}
if (argHasError) {
if (receiverType == null) {
@@ -515,58 +507,29 @@
visitor.endVisit(this, scope);
}
- // -- interface Invocation: --
- public MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope) {
- if (reportErrors) {
- if (this.binding == null)
- scope.problemReporter().genericInferenceError("constructor is unexpectedly unresolved", this); //$NON-NLS-1$
- else if (!this.binding.isValidBinding())
- scope.problemReporter().invalidConstructor(this, this.binding);
- }
+ // -- interface Invocation
+ public MethodBinding binding() {
return this.binding;
}
+
+ public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 infCtx18) {
+ // Nothing to do.
+ }
+
+ @Override
+ public void registerResult(TypeBinding targetType, MethodBinding method) {
+ // Nothing to do.
+ }
+
+ public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
+ return null;
+ }
+
public Expression[] arguments() {
return this.arguments;
}
- public boolean updateBindings(MethodBinding updatedBinding, TypeBinding targetType) {
- boolean hasUpdate = this.binding != updatedBinding;
- if (this.inferenceContexts != null) {
- InferenceContext18 ctx = (InferenceContext18)this.inferenceContexts.removeKey(this.binding);
- if (ctx != null && updatedBinding instanceof ParameterizedGenericMethodBinding) {
- this.inferenceContexts.put(updatedBinding, ctx);
- // solution may have come from an outer inference, mark now that this (inner) is done (but not deep inners):
- hasUpdate |= ctx.registerSolution(targetType, updatedBinding);
- }
- }
- this.binding = updatedBinding;
- return hasUpdate;
- }
- public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 infCtx18) {
- if (this.inferenceContexts == null)
- this.inferenceContexts = new SimpleLookupTable();
- this.inferenceContexts.put(method, infCtx18);
- }
- public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
- if (this.inferenceContexts == null)
- return null;
- return (InferenceContext18) this.inferenceContexts.get(method);
- }
- public boolean usesInference() {
- return (this.binding instanceof ParameterizedGenericMethodBinding)
- && getInferenceContext((ParameterizedGenericMethodBinding) this.binding) != null;
- }
- public boolean innersNeedUpdate() {
- return this.innerInferenceHelper != null;
- }
- public void innerUpdateDone() {
- this.innerInferenceHelper = null;
- }
- public InnerInferenceHelper innerInferenceHelper() {
- return this.innerInferenceHelper;
- }
-
// -- interface InvocationSite: --
public InferenceContext18 freshInferenceContext(Scope scope) {
- return new InferenceContext18(scope, this.arguments, this);
+ return new InferenceContext18(scope, this.arguments, this, null);
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.java
index 2c5c630..e98af09 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Expression.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 292478 - Report potentially null across variable assignment
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 392862 - [1.8][compiler][null] Evaluate null annotations on array types
@@ -25,6 +25,7 @@
* Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
* Bug 428274 - [1.8] [compiler] Cannot cast from Number to double
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -45,6 +46,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
@@ -71,6 +73,9 @@
public int implicitConversion;
public TypeBinding resolvedType;
+
+ static Expression [] NO_EXPRESSIONS = new Expression[0];
+
public static final boolean isConstantValueRepresentable(Constant constant, int constantTypeID, int targetTypeID) {
//true if there is no loss of precision while casting.
@@ -302,7 +307,7 @@
return true;
}
- if (castType.isIntersectionCastType()) {
+ if (castType.isIntersectionType18()) {
ReferenceBinding [] intersectingTypes = castType.getIntersectingTypes();
for (int i = 0, length = intersectingTypes.length; i < length; i++) {
if (!checkCastTypesCompatibility(scope, intersectingTypes[i], expressionType, expression))
@@ -382,7 +387,7 @@
if (bound == null) bound = scope.getJavaLangObject();
// recursively on the type variable upper bound
return checkCastTypesCompatibility(scope, castType, bound, expression);
- case Binding.INTERSECTION_CAST_TYPE:
+ case Binding.INTERSECTION_TYPE18:
ReferenceBinding [] intersectingTypes = expressionType.getIntersectingTypes();
for (int i = 0, length = intersectingTypes.length; i < length; i++) {
if (checkCastTypesCompatibility(scope, castType, intersectingTypes[i], expression))
@@ -652,6 +657,9 @@
TypeBinding boxedType = scope.environment().computeBoxingType(runtimeType);
if (TypeBinding.equalsEquals(boxedType, runtimeType)) // Object o = 12;
boxedType = compileTimeType;
+ if (boxedType.id >= TypeIds.T_LastWellKnownTypeId) { // (Comparable & Serializable) 0
+ boxedType = compileTimeType;
+ }
this.implicitConversion = TypeIds.BOXING | (boxedType.id << 4) + compileTimeType.id;
scope.problemReporter().autoboxing(this, compileTimeType, scope.environment().computeBoxingType(boxedType));
return;
@@ -914,14 +922,6 @@
return false;
}
-public boolean isAssignmentCompatible (TypeBinding left, Scope scope) {
- if (this.resolvedType == null)
- return false;
- return isConstantValueOfTypeAssignableToType(this.resolvedType, left) ||
- this.resolvedType.isCompatibleWith(left) ||
- isBoxingCompatible(this.resolvedType, left, this, scope);
-}
-
public boolean isTypeReference() {
return false;
}
@@ -1062,14 +1062,8 @@
return expressionType;
}
-/**
- * Once outer contexts have finalized the target type for this expression,
- * perform any checks that might have been delayed previously.
- * @param targetType the final target type (aka expectedType) for this expression.
- * @param scope scope for error reporting
- */
-public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
- return this.resolvedType; // subclasses may choose to do real stuff here
+public Expression resolveExpressionExpecting(TypeBinding targetType, Scope scope, InferenceContext18 context) {
+ return this; // subclasses should implement for a better resolved expression if required.
}
/**
@@ -1164,17 +1158,13 @@
}
public boolean isBoxingCompatibleWith(TypeBinding left, Scope scope) {
- return isBoxingCompatible(this.resolvedType, left, this, scope);
+ return this.resolvedType != null && isBoxingCompatible(this.resolvedType, left, this, scope);
}
public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) {
return s.isCompatibleWith(t, scope);
}
-public void tagAsEllipsisArgument() {
- // don't care. Subclasses that are poly expressions in specific contexts should listen in and make note.
-}
-
public boolean isExactMethodReference() {
return false;
}
@@ -1250,4 +1240,17 @@
public VariableBinding nullAnnotatedVariableBinding(boolean supportTypeAnnotations) {
return null;
}
+
+public boolean isFunctionalType() {
+ return false;
}
+
+/** Returns contained poly expressions, result could be 0, 1 or more (for conditional expression) */
+public Expression [] getPolyExpressions() {
+ return isPolyExpression() ? new Expression [] { this } : NO_EXPRESSIONS;
+}
+
+public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope) {
+ return isCompatibleWith(targetType, scope); // for all but functional expressions, potential compatibility is the same as compatibility.
+}
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
index 021950d..7b99069 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FakedTrackingVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2014 GK Software AG and others.
+ * Copyright (c) 2011, 2015 GK Software AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,9 @@
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -33,6 +35,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
@@ -182,6 +185,8 @@
return local.closeTracker;
if (!isAnyCloseable(expression.resolvedType))
return null;
+ if ((local.tagBits & TagBits.IsResource) != 0)
+ return null;
// tracking var doesn't yet exist. This happens in finally block
// which is analyzed before the corresponding try block
Statement location = local.declaration;
@@ -237,6 +242,8 @@
ConditionalExpression conditional = (ConditionalExpression) location;
return containsAllocation(conditional.valueIfTrue) || containsAllocation(conditional.valueIfFalse);
}
+ if (location instanceof CastExpression)
+ return containsAllocation(((CastExpression) location).expression);
return false;
}
@@ -246,6 +253,8 @@
preConnectTrackerAcrossAssignment(location, local, flowInfo, (AllocationExpression) expression, closeTracker);
} else if (expression instanceof ConditionalExpression) {
preConnectTrackerAcrossAssignment(location, local, flowInfo, (ConditionalExpression) expression, closeTracker);
+ } else if (expression instanceof CastExpression) {
+ preConnectTrackerAcrossAssignment(location, local, ((CastExpression) expression).expression, flowInfo);
}
}
@@ -273,7 +282,7 @@
if (((ReferenceBinding)allocation.resolvedType).hasTypeBit(TypeIds.BitResourceFreeCloseable)) {
// remove unnecessary attempts (closeable is not relevant)
if (allocation.closeTracker != null) {
- scope.removeTrackingVar(allocation.closeTracker);
+ allocation.closeTracker.withdraw();
allocation.closeTracker = null;
}
} else if (((ReferenceBinding)allocation.resolvedType).hasTypeBit(TypeIds.BitWrapperCloseable)) {
@@ -328,7 +337,7 @@
if (isWrapper) {
// remove unnecessary attempts (wrapper has no relevant inner)
if (allocation.closeTracker != null) {
- scope.removeTrackingVar(allocation.closeTracker);
+ allocation.closeTracker.withdraw();
allocation.closeTracker = null;
}
} else {
@@ -353,7 +362,7 @@
}
private static FakedTrackingVariable pick(FakedTrackingVariable tracker1, FakedTrackingVariable tracker2, BlockScope scope) {
- scope.removeTrackingVar(tracker2);
+ tracker2.withdraw();
return tracker1;
}
@@ -600,14 +609,14 @@
if (expression instanceof AllocationExpression) {
FakedTrackingVariable tracker = ((AllocationExpression) expression).closeTracker;
if (tracker != null && tracker.originalBinding == null) {
- currentScope.removeTrackingVar(tracker);
+ tracker.withdraw();
((AllocationExpression) expression).closeTracker = null;
}
} else {
// assignment passing a local into a field?
LocalVariableBinding local = expression.localVariableBinding();
if (local != null && local.closeTracker != null && ((lhsBits & Binding.FIELD) != 0))
- currentScope.removeTrackingVar(local.closeTracker); // TODO: may want to use local.closeTracker.markPassedToOutside(..,true)
+ local.closeTracker.withdraw(); // TODO: may want to use local.closeTracker.markPassedToOutside(..,true)
}
}
@@ -686,7 +695,7 @@
int finallyStatus = currentScope.finallyInfo.nullStatus(local);
if (finallyStatus == FlowInfo.NON_NULL)
return finallyStatus;
- if (finallyStatus != FlowInfo.NULL) // neither is NON_NULL, but not both are NULL => call it POTENTIALLY_NULL
+ if (finallyStatus != FlowInfo.NULL && currentScope.finallyInfo.hasNullInfoFor(local)) // neither is NON_NULL, but not both are NULL => call it POTENTIALLY_NULL
status = FlowInfo.POTENTIALLY_NULL;
}
if (currentScope != outerScope && currentScope.parent instanceof BlockScope)
@@ -701,7 +710,7 @@
do {
flowInfo.markAsDefinitelyNonNull(current.binding);
current.globalClosingState |= CLOSE_SEEN;
- flowContext.markFinallyNullStatus(this.binding, FlowInfo.NON_NULL);
+ flowContext.markFinallyNullStatus(current.binding, FlowInfo.NON_NULL);
current = current.innerTracker;
} while (current != null);
}
@@ -739,44 +748,100 @@
return flowInfo;
}
- /**
- * Pick tracking variables from 'varsOfScope' to establish a proper order of processing:
- * As much as possible pick wrapper resources before their inner resources.
- * Also consider cases of wrappers and their inners being declared at different scopes.
+ /**
+ * Iterator for a set of FakedTrackingVariable, which dispenses the elements
+ * according to the priorities defined by enum {@link Stage}.
+ * Resources whose outer is owned by an enclosing scope are never answered,
+ * unless we are analysing on behalf of an exit (return/throw).
*/
- public static FakedTrackingVariable pickVarForReporting(Set varsOfScope, BlockScope scope, boolean atExit) {
- if (varsOfScope.isEmpty()) return null;
- FakedTrackingVariable trackingVar = (FakedTrackingVariable) varsOfScope.iterator().next();
- while (trackingVar.outerTracker != null) {
- // resource is wrapped, is wrapper defined in this scope?
- if (varsOfScope.contains(trackingVar.outerTracker)) {
- // resource from same scope, travel up the wrapper chain
- trackingVar = trackingVar.outerTracker;
- } else if (atExit) {
- // at an exit point we report against inner despite a wrapper that may/may not be closed later
- break;
- } else {
- BlockScope outerTrackerScope = trackingVar.outerTracker.binding.declaringScope;
- if (outerTrackerScope == scope) {
- // outerTracker is from same scope and already processed -> pick trackingVar now
- break;
- } else {
- // outer resource is from other (outer?) scope
- Scope currentScope = scope;
- while ((currentScope = currentScope.parent) instanceof BlockScope) {
- if (outerTrackerScope == currentScope) {
- // at end of block pass responsibility for inner resource to outer scope holding a wrapper
- varsOfScope.remove(trackingVar); // drop this one
- // pick a next candidate:
- return pickVarForReporting(varsOfScope, scope, atExit);
+ public static class IteratorForReporting implements Iterator<FakedTrackingVariable> {
+
+ private final Set<FakedTrackingVariable> varSet;
+ private final Scope scope;
+ private final boolean atExit;
+
+ private Stage stage;
+ private Iterator<FakedTrackingVariable> iterator;
+ private FakedTrackingVariable next;
+
+ enum Stage {
+ /** 1. prio: all top-level resources, ie., resources with no outer. */
+ OuterLess,
+ /** 2. prio: resources whose outer has already been processed (element of the same varSet). */
+ InnerOfProcessed,
+ /** 3. prio: resources whose outer is not owned by any enclosing scope. */
+ InnerOfNotEnclosing,
+ /** 4. prio: when analysing on behalf of an exit point: anything not picked before. */
+ AtExit
+ }
+
+ public IteratorForReporting(List<FakedTrackingVariable> variables, Scope scope, boolean atExit) {
+ this.varSet = new HashSet<>(variables);
+ this.scope = scope;
+ this.atExit = atExit;
+ setUpForStage(Stage.OuterLess);
+ }
+ @Override
+ public boolean hasNext() {
+ FakedTrackingVariable trackingVar;
+ switch (this.stage) {
+ case OuterLess:
+ while (this.iterator.hasNext()) {
+ trackingVar = this.iterator.next();
+ if (trackingVar.outerTracker == null)
+ return found(trackingVar);
+ }
+ setUpForStage(Stage.InnerOfProcessed);
+ //$FALL-THROUGH$
+ case InnerOfProcessed:
+ while (this.iterator.hasNext()) {
+ trackingVar = this.iterator.next();
+ FakedTrackingVariable outer = trackingVar.outerTracker;
+ if (outer.binding.declaringScope == this.scope && !this.varSet.contains(outer))
+ return found(trackingVar);
+ }
+ setUpForStage(Stage.InnerOfNotEnclosing);
+ //$FALL-THROUGH$
+ case InnerOfNotEnclosing:
+ searchAlien: while (this.iterator.hasNext()) {
+ trackingVar = this.iterator.next();
+ FakedTrackingVariable outer = trackingVar.outerTracker;
+ if (!this.varSet.contains(outer)) {
+ Scope outerTrackerScope = outer.binding.declaringScope;
+ Scope currentScope = this.scope;
+ while ((currentScope = currentScope.parent) instanceof BlockScope) {
+ if (outerTrackerScope == currentScope)
+ break searchAlien;
+ }
+ return found(trackingVar);
}
}
- break; // not parent owned -> pick this var
- }
+ setUpForStage(Stage.AtExit);
+ //$FALL-THROUGH$
+ case AtExit:
+ if (this.atExit && this.iterator.hasNext())
+ return found(this.iterator.next());
+ return false;
+ default: throw new IllegalStateException("Unexpected Stage "+this.stage); //$NON-NLS-1$
}
}
- varsOfScope.remove(trackingVar);
- return trackingVar;
+ private boolean found(FakedTrackingVariable trackingVar) {
+ this.iterator.remove();
+ this.next = trackingVar;
+ return true;
+ }
+ private void setUpForStage(Stage nextStage) {
+ this.iterator = this.varSet.iterator();
+ this.stage = nextStage;
+ }
+ @Override
+ public FakedTrackingVariable next() {
+ return this.next;
+ }
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
}
/**
@@ -824,6 +889,11 @@
return false;
}
+ public void withdraw() {
+ // must unregister at the declaringScope, note that twr resources are owned by the scope enclosing the twr
+ this.binding.declaringScope.removeTrackingVar(this);
+ }
+
public void recordErrorLocation(ASTNode location, int nullStatus) {
if ((this.globalClosingState & OWNED_BY_OUTSIDE) != 0) {
return;
@@ -833,14 +903,20 @@
this.recordedLocations.put(location, new Integer(nullStatus));
}
- public boolean reportRecordedErrors(Scope scope, int mergedStatus) {
+ public boolean reportRecordedErrors(Scope scope, int mergedStatus, boolean atDeadEnd) {
FakedTrackingVariable current = this;
while (current.globalClosingState == 0) {
current = current.innerTracker;
if (current == null) {
// no relevant state found -> report:
- reportError(scope.problemReporter(), null, mergedStatus);
- return true;
+ if (atDeadEnd && neverClosedAtLocations())
+ mergedStatus = FlowInfo.NULL;
+ if ((mergedStatus & (FlowInfo.NULL|FlowInfo.POTENTIALLY_NULL|FlowInfo.POTENTIALLY_NON_NULL)) != 0) {
+ reportError(scope.problemReporter(), null, mergedStatus);
+ return true;
+ } else {
+ break;
+ }
}
}
boolean hasReported = false;
@@ -863,6 +939,15 @@
return hasReported;
}
+ private boolean neverClosedAtLocations() {
+ if (this.recordedLocations != null) {
+ for (Object value : this.recordedLocations.values())
+ if (!value.equals(FlowInfo.NULL))
+ return false;
+ }
+ return true;
+ }
+
public int reportError(ProblemReporter problemReporter, ASTNode location, int nullStatus) {
if ((this.globalClosingState & OWNED_BY_OUTSIDE) != 0) {
return 0; // TODO: should we still propagate some flags??
@@ -903,14 +988,6 @@
}
}
- public void resetReportingBits() {
- FakedTrackingVariable current = this;
- do {
- current.globalClosingState &= ~(REPORTED_POTENTIAL_LEAK|REPORTED_DEFINITIVE_LEAK);
- current = current.innerTracker;
- } while (current != null);
- }
-
public String nameForReporting(ASTNode location, ReferenceContext referenceContext) {
if (this.name == UNASSIGNED_CLOSEABLE_NAME) {
if (location != null && referenceContext != null) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
index bd19a3a..4eb5543 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,8 @@
* bug 400761 - [compiler][null] null may be return as boolean without a diagnostic
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
* Bug 429403 - [1.8][null] null mismatch from type arguments is not reported at field initializer
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 458396 - NPE in CodeStream.invoke()
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 409250 - [1.8][compiler] Various loose ends in 308 code generation
*******************************************************************************/
@@ -74,7 +76,7 @@
if (this.binding != null
&& this.binding.isValidBinding()
&& this.binding.isStatic()
- && this.binding.constant() == Constant.NotAConstant
+ && this.binding.constant(initializationScope) == Constant.NotAConstant
&& this.binding.declaringClass.isNestedType()
&& !this.binding.declaringClass.isStatic()) {
initializationScope.problemReporter().unexpectedStaticModifierForField(
@@ -94,7 +96,7 @@
if (options.isAnnotationBasedNullAnalysisEnabled) {
if (this.binding.isNonNull() || options.sourceLevel >= ClassFileConstants.JDK1_8) {
int nullStatus = this.initialization.nullStatus(flowInfo, flowContext);
- NullAnnotationMatching.checkAssignment(initializationScope, flowContext, this.binding, nullStatus, this.initialization, this.initialization.resolvedType);
+ NullAnnotationMatching.checkAssignment(initializationScope, flowContext, this.binding, flowInfo, nullStatus, this.initialization, this.initialization.resolvedType);
}
}
this.initialization.checkNPEbyUnboxing(initializationScope, flowContext, flowInfo);
@@ -317,7 +319,7 @@
} finally {
initializationScope.initializedField = previousField;
initializationScope.lastVisibleFieldID = previousFieldID;
- if (this.binding.constant() == null)
+ if (this.binding.constant(initializationScope) == null)
this.binding.setConstant(Constant.NotAConstant);
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
index d270630..cab9c7c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
* bug 383368 - [compiler][null] syntactic null analysis for field references
* Bug 412203 - [compiler] Internal compiler error: java.lang.IllegalArgumentException: info cannot be null
* Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
+ * Bug 458396 - NPE in CodeStream.invoke()
* Jesper S Moller - Contributions for
* Bug 378674 - "The method can be declared as static" is wrong
*******************************************************************************/
@@ -496,6 +497,11 @@
return this.receiver.isSuper();
}
+@Override
+public boolean isQualifiedSuper() {
+ return this.receiver.isQualifiedSuper();
+}
+
public boolean isTypeAccess() {
return this.receiver != null && this.receiver.isTypeReference();
}
@@ -525,7 +531,7 @@
FieldBinding codegenBinding = this.binding.original();
if (this.binding.isPrivate()) {
if ((TypeBinding.notEquals(currentScope.enclosingSourceType(), codegenBinding.declaringClass))
- && this.binding.constant() == Constant.NotAConstant) {
+ && this.binding.constant(currentScope) == Constant.NotAConstant) {
if (this.syntheticAccessors == null)
this.syntheticAccessors = new MethodBinding[2];
this.syntheticAccessors[isReadAccess ? FieldReference.READ : FieldReference.WRITE] =
@@ -683,7 +689,7 @@
scope.problemReporter().deprecatedField(fieldBinding, this);
}
boolean isImplicitThisRcv = this.receiver.isImplicitThis();
- this.constant = isImplicitThisRcv ? fieldBinding.constant() : Constant.NotAConstant;
+ this.constant = isImplicitThisRcv ? fieldBinding.constant(scope) : Constant.NotAConstant;
if (fieldBinding.isStatic()) {
// static field accessed through receiver? legal but unoptimal (optional warning)
if (!(isImplicitThisRcv
@@ -712,7 +718,7 @@
TypeBinding fieldType = fieldBinding.type;
if (fieldType != null) {
if ((this.bits & ASTNode.IsStrictlyAssigned) == 0) {
- fieldType = fieldType.capture(scope, this.sourceEnd); // perform capture conversion if read access
+ fieldType = fieldType.capture(scope, this.sourceStart, this.sourceEnd); // perform capture conversion if read access
}
this.resolvedType = fieldType;
if ((fieldType.tagBits & TagBits.HasMissingType) != 0) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
index 571aa54..b0a6c2b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
+ * Bug 415790 - [compiler][resource]Incorrect potential resource leak warning in for loop with close in try/catch
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -204,8 +205,9 @@
}
if (loopingContext.hasEscapingExceptions()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=321926
FlowInfo loopbackFlowInfo = flowInfo.copy();
- if (this.continueLabel != null) { // we do get to the bottom
- loopbackFlowInfo.mergedWith(actionInfo.unconditionalCopy());
+ if (this.continueLabel != null) { // we do get to the bottom
+ // loopback | (loopback + action):
+ loopbackFlowInfo = loopbackFlowInfo.mergedWith(loopbackFlowInfo.unconditionalCopy().addNullInfoFrom(actionInfo).unconditionalInits());
}
loopingContext.simulateThrowAfterLoopBack(loopbackFlowInfo);
}
@@ -427,4 +429,19 @@
}
visitor.endVisit(this, blockScope);
}
+
+ @Override
+ public boolean doesNotCompleteNormally() {
+ Constant cst = this.condition == null ? null : this.condition.constant;
+ boolean isConditionTrue = cst == null || cst != Constant.NotAConstant && cst.booleanValue() == true;
+ cst = this.condition == null ? null : this.condition.optimizedBooleanConstant();
+ boolean isConditionOptimizedTrue = cst == null ? true : cst != Constant.NotAConstant && cst.booleanValue() == true;
+
+ return (isConditionTrue || isConditionOptimizedTrue) && (this.action == null || !this.action.breaksOut(null));
+ }
+
+ @Override
+ public boolean completesByContinue() {
+ return this.action.continuesAtOuterLabel();
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
index dcde874..bd1fa34 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java
@@ -15,6 +15,8 @@
* bug 393719 - [compiler] inconsistent warnings on iteration variables
* Bug 411964 - [1.8][null] leverage null type annotation in foreach statement
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 415790 - [compiler][resource]Incorrect potential resource leak warning in for loop with close in try/catch
* Jesper S Moller - Contribution for
* bug 401853 - Eclipse Java compiler creates invalid bytecode (java.lang.VerifyError)
*******************************************************************************/
@@ -111,8 +113,8 @@
actionInfo.markAsDefinitelyUnknown(elementVarBinding);
if (currentScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
int elementNullStatus = FlowInfo.tagBitsToNullStatus(this.collectionElementType.tagBits);
- int nullStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, elementVarBinding, elementNullStatus,
- this.collection, this.collectionElementType);
+ int nullStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, elementVarBinding, null, // have no useful flowinfo for element var
+ elementNullStatus, this.collection, this.collectionElementType);
if ((elementVarBinding.type.tagBits & TagBits.IsBaseType) == 0) {
actionInfo.markNullStatus(elementVarBinding, nullStatus);
}
@@ -165,6 +167,14 @@
}
//end of loop
loopingContext.complainOnDeferredNullChecks(currentScope, actionInfo);
+ if (loopingContext.hasEscapingExceptions()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=321926
+ FlowInfo loopbackFlowInfo = flowInfo.copy();
+ if (this.continueLabel != null) { // we do get to the bottom
+ // loopback | (loopback + action):
+ loopbackFlowInfo = loopbackFlowInfo.mergedWith(loopbackFlowInfo.unconditionalCopy().addNullInfoFrom(actionInfo).unconditionalInits());
+ }
+ loopingContext.simulateThrowAfterLoopBack(loopbackFlowInfo);
+ }
FlowInfo mergedInfo = FlowInfo.mergedOptimizedBranches(
(loopingContext.initsOnBreak.tagBits &
@@ -577,4 +587,9 @@
}
visitor.endVisit(this, blockScope);
}
+
+ @Override
+ public boolean doesNotCompleteNormally() {
+ return false; // may not be entered at all.
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
index 21f4db5..4f0ea9f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/FunctionalExpression.java
@@ -19,6 +19,7 @@
* Bug 424403 - [1.8][compiler] Generic method call with method reference argument fails to resolve properly.
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
+ * Bug 446442 - [1.8] merge null annotations from super methods
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
*******************************************************************************/
@@ -32,10 +33,9 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionCastTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionTypeBinding18;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
@@ -57,11 +57,8 @@
protected MethodBinding actualMethodBinding; // void of synthetics.
boolean ignoreFurtherInvestigation;
protected ExpressionContext expressionContext = VANILLA_CONTEXT;
- static Expression [] NO_EXPRESSIONS = new Expression[0];
- protected Expression [] resultExpressions = NO_EXPRESSIONS;
public CompilationResult compilationResult;
public BlockScope enclosingScope;
- protected boolean ellipsisArgument;
public int bootstrapMethodNumber = -1;
protected static IErrorHandlingPolicy silentErrorHandlingPolicy = DefaultErrorHandlingPolicies.ignoreAllProblems();
private boolean hasReportedSamProblem = false;
@@ -74,9 +71,8 @@
super();
}
- // for lambda's and reference expressions boxing compatibility is same as vanilla compatibility.
public boolean isBoxingCompatibleWith(TypeBinding targetType, Scope scope) {
- return isCompatibleWith(targetType, scope);
+ return false;
}
public void setCompilationResult(CompilationResult compilationResult) {
@@ -87,19 +83,19 @@
public MethodBinding getMethodBinding() {
return null;
}
+
public void setExpectedType(TypeBinding expectedType) {
- this.expectedType = this.ellipsisArgument ? ((ArrayBinding) expectedType).elementsType() : expectedType;
+ this.expectedType = expectedType;
}
public void setExpressionContext(ExpressionContext context) {
this.expressionContext = context;
}
+
public ExpressionContext getExpressionContext() {
return this.expressionContext;
}
- public void tagAsEllipsisArgument() {
- this.ellipsisArgument = true;
- }
+
public boolean isPolyExpression(MethodBinding candidate) {
return true;
}
@@ -107,15 +103,20 @@
return true; // always as per introduction of part D, JSR 335
}
+ @Override
+ public boolean isFunctionalType() {
+ return true;
+ }
+
public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method) {
if (targetType instanceof TypeVariableBinding) {
+ TypeVariableBinding typeVariable = (TypeVariableBinding) targetType;
if (method != null) { // when called from type inference
- if (((TypeVariableBinding)targetType).declaringElement == method)
+ if (typeVariable.declaringElement == method)
return false;
- if (method.isConstructor() && ((TypeVariableBinding)targetType).declaringElement == method.declaringClass)
+ if (method.isConstructor() && typeVariable.declaringElement == method.declaringClass)
return false;
} else { // for internal calls
- TypeVariableBinding typeVariable = (TypeVariableBinding) targetType;
if (typeVariable.declaringElement instanceof MethodBinding)
return false;
}
@@ -179,6 +180,8 @@
this.descriptor = sam;
if (kosherDescriptor(blockScope, sam, true)) {
+ if (blockScope.environment().globalOptions.isAnnotationBasedNullAnalysisEnabled)
+ NullAnnotationMatching.checkForContradictions(sam, this, blockScope);
return this.resolvedType = this.expectedType;
}
@@ -205,11 +208,6 @@
return null;
}
- public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
- targetType = targetType.uncapture(this.enclosingScope);
- return resolveTypeExpecting(this.enclosingScope, targetType);
- }
-
class VisibilityInspector extends TypeBindingVisitor {
private Scope scope;
@@ -345,8 +343,8 @@
}
ReferenceBinding functionalType;
- if (this.expectedType instanceof IntersectionCastTypeBinding) {
- functionalType = (ReferenceBinding) ((IntersectionCastTypeBinding)this.expectedType).getSAMType(this.enclosingScope);
+ if (this.expectedType instanceof IntersectionTypeBinding18) {
+ functionalType = (ReferenceBinding) ((IntersectionTypeBinding18)this.expectedType).getSAMType(this.enclosingScope);
} else {
functionalType = (ReferenceBinding) this.expectedType;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java
new file mode 100644
index 0000000..b26cf3f
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IPolyExpression.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contributions for
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
+
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+
+/**
+ Contract to be implemented by all poly expressions and potential poly expressions for uniform integration into overload resolution and type inference.
+ Additional contracts may be imposed by {@link Invocation} and {@link InvocationSite}. For most contracts "default" implementations are furnished by
+ {@link Expression} or {@link Statement} or by {@link ASTNode} and the poly expression should suitably override where required.
+
+ @see PolyTypeBinding
+ @see ExpressionContext
+*/
+public interface IPolyExpression {
+
+ // Expression context manipulation
+ public void setExpressionContext(ExpressionContext context);
+ public ExpressionContext getExpressionContext();
+
+ // Target type injection.
+ public void setExpectedType(TypeBinding targetType);
+ public TypeBinding invocationTargetType();
+
+ // Compatibility checks.
+ public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope);
+ public boolean isCompatibleWith(TypeBinding targetType, final Scope scope);
+ public boolean isBoxingCompatibleWith(TypeBinding targetType, Scope scope);
+ public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope skope);
+
+ // Pertinence checks.
+ public boolean isPertinentToApplicability(TypeBinding targetType, MethodBinding method);
+
+ // Polyness checks
+ public boolean isPolyExpression(MethodBinding candidate);
+ public boolean isPolyExpression();
+ public boolean isFunctionalType();
+ public Expression[] getPolyExpressions();
+
+
+ /* Resolution: A poly expression must be prepared to be resolved multiple times and should manage matters in a side effect free fashion.
+ Typically, in invocation contexts, there is an initial resolution, multiple tentative resolutions and then a final resolution against
+ the ultimate target type.
+ */
+ public TypeBinding resolveType(BlockScope blockScope);
+ // Resolve expression tentatively - should have no lingering side-effects that may impact final resolution !
+ public Expression resolveExpressionExpecting(TypeBinding targetType, Scope scope, InferenceContext18 inferenceContext);
+
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
index 5e86b01..98cedc8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IfStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -284,4 +284,13 @@
}
visitor.endVisit(this, blockScope);
}
+
+@Override
+public boolean doesNotCompleteNormally() {
+ return this.thenStatement != null && this.thenStatement.doesNotCompleteNormally() && this.elseStatement != null && this.elseStatement.doesNotCompleteNormally();
+}
+@Override
+public boolean completesByContinue() {
+ return this.thenStatement != null && this.thenStatement.completesByContinue() || this.elseStatement != null && this.elseStatement.completesByContinue();
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.java
index f31d348..b9aaa73 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Initializer.java
@@ -1,14 +1,17 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
+import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.*;
@@ -23,6 +26,8 @@
public int bodyStart;
public int bodyEnd;
+ private MethodBinding methodBinding;
+
public Initializer(Block block, int modifiers) {
this.block = block;
this.modifiers = modifiers;
@@ -125,6 +130,17 @@
}
}
+ /** Method used only by DOM to support bindings of initializers. */
+ public MethodBinding getMethodBinding() {
+ if (this.methodBinding == null) {
+ Scope scope = this.block.scope;
+ this.methodBinding = isStatic()
+ ? new MethodBinding(ClassFileConstants.AccStatic, CharOperation.NO_CHAR, TypeBinding.VOID, Binding.NO_PARAMETERS, Binding.NO_EXCEPTIONS, scope.enclosingSourceType())
+ : new MethodBinding(0, CharOperation.NO_CHAR, TypeBinding.VOID, Binding.NO_PARAMETERS, Binding.NO_EXCEPTIONS, scope.enclosingSourceType());
+ }
+ return this.methodBinding;
+ }
+
public void traverse(ASTVisitor visitor, MethodScope scope) {
if (visitor.visit(this, scope)) {
if (this.block != null) this.block.traverse(visitor, scope);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InnerInferenceHelper.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InnerInferenceHelper.java
deleted file mode 100644
index 56fca72..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InnerInferenceHelper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 GK Software AG.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Stephan Herrmann - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
-
-public class InnerInferenceHelper {
-
- /** For each candidate method store here the array of argument types if inner inference has improved any during Invocation Type Inference. */
- private Map<MethodBinding,TypeBinding[]> argTypesPerCandidate = new HashMap<MethodBinding,TypeBinding[]>();
-
- public void registerInnerResult(MethodBinding method, TypeBinding resolvedType, int argCount, int argIdx) {
- TypeBinding[] argTypes = this.argTypesPerCandidate.get(method);
- if (argTypes == null)
- this.argTypesPerCandidate.put(method, argTypes = new TypeBinding[argCount]);
- argTypes[argIdx] = resolvedType;
- }
-
- public TypeBinding[] getArgumentTypesForCandidate(MethodBinding candidate, TypeBinding[] plainArgTypes) {
- TypeBinding[] argTypes = this.argTypesPerCandidate.get(candidate);
- if (argTypes == null)
- return plainArgTypes;
- // fill in any blanks now:
- for (int i = 0; i < argTypes.length; i++) {
- if (argTypes[i] == null)
- argTypes[i] = plainArgTypes[i];
- }
- return argTypes;
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
index 032a84c..2927e65 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,12 +15,14 @@
* Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
* Bug 392238 - [1.8][compiler][null] Detect semantically invalid null type annotations
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Andy Clement - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
@@ -90,7 +92,7 @@
this.constant = Constant.NotAConstant;
TypeBinding expressionType = this.expression.resolveType(scope);
TypeBinding checkedType = this.type.resolveType(scope, true /* check bounds*/);
- if (expressionType != null && checkedType != null && this.type.hasNullTypeAnnotation()) {
+ if (expressionType != null && checkedType != null && this.type.hasNullTypeAnnotation(AnnotationPosition.ANY)) {
// don't complain if the entire operation is redundant anyway
if (!expressionType.isCompatibleWith(checkedType) || NullAnnotationMatching.analyse(checkedType, expressionType, -1).isAnyMismatch())
scope.problemReporter().nullAnnotationUnsupportedLocation(this.type);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java
index 18d1766..a85e637 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java
@@ -20,7 +20,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionCastTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionTypeBinding18;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
@@ -127,7 +127,7 @@
}
System.arraycopy(intersectingTypes, 0, intersectingTypes = new ReferenceBinding[typeCount], 0, typeCount);
}
- IntersectionCastTypeBinding intersectionType = (IntersectionCastTypeBinding) scope.environment().createIntersectionCastType(intersectingTypes);
+ IntersectionTypeBinding18 intersectionType = (IntersectionTypeBinding18) scope.environment().createIntersectionType18(intersectingTypes);
// check for parameterized interface collisions (when different parameterizations occur)
ReferenceBinding itsSuperclass = null;
ReferenceBinding[] interfaces = intersectingTypes;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.java
index f4b1f4e..618fc6e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Invocation.java
@@ -15,75 +15,34 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
/**
- * Abstraction for invocation AST nodes that can trigger
- * <ul>
- * <li>Invocation Applicability Inferences (18.5.1), and</li>
- * <li>Invocation Type Inference (18.5.2).</li>
- * </ul>
- */
+ * Abstraction for invocation AST nodes that can trigger overload resolution possibly involving type inference
+*/
public interface Invocation extends InvocationSite {
Expression[] arguments();
- /**
- * Answer the resolved method binding of this invocation.
- * If a target type is given, the invocation gets a chance to do repeated method lookup.
- * @param targetType the target type of this invocation or null if not yet known
- * @param reportErrors if true then this is the last call, if no valid binding can be answered we should report an error
- * @param scope if reportErrors is true then this scope can be used for error reporting
- *
- */
- MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope);
-
+ /** Answer the resolved method binding of this invocation */
+ MethodBinding binding();
+
/**
* Register the given inference context, which produced the given method as its intermediate result.
* Later when the same method is selected as the most specific method, the inference context
- * for this pair (Invocation x MethodBinding) can be looked up using {@link #getExpressionContext()}
+ * for this pair (Invocation x MethodBinding) can be looked up using {@link #getInferenceContext(ParameterizedMethodBinding)}
* to continue the type inference.
*/
void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 infCtx18);
-
+
/**
- * Retrieve an inference context for the given method which must have been registered
- * using {@link #registerInferenceContext(ParameterizedGenericMethodBinding, InferenceContext18)}.
+ * Retrieve an inference context for the given method.
* @param method an intermediate resolved candidate for this invocation
- * return a suspended inference context or null if none was registered for this method.
+ * return the associated inference context.
*/
InferenceContext18 getInferenceContext(ParameterizedMethodBinding method);
- /**
- * Answer true if this invocation has determined its binding using inference.
- */
- boolean usesInference();
-
- /**
- * Where the AST node may hold references to the results of Invocation Applicability Inference,
- * this method allows to update those references to the result of Invocation Type Inference.
- * Note that potentially more than just the method binding is updated.
- * @param updatedBinding the final method binding after full inference
- * @param targetType the target type used during Invocation Type Inference
- * @return true if an update has happened
- */
- boolean updateBindings(MethodBinding updatedBinding, TypeBinding targetType);
-
- /**
- * Answer whether the current invocation has inner expressions that still need updating after inference.
- */
- boolean innersNeedUpdate();
+ /** Record result against target type */
+ void registerResult(TypeBinding targetType, MethodBinding method);
- /**
- * Mark that updating (the need for which is signaled via {@link #innersNeedUpdate()}) has been done.
- */
- void innerUpdateDone();
-
- /**
- * If this invocation has any poly expressions as arguments, this method answers an inference helper
- * that mediates during overload resolution, even if no actual inference happens for this invocation.
- */
- InnerInferenceHelper innerInferenceHelper();
-
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
index e8bdeaf..cb973fc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -478,7 +478,7 @@
// Verify that there's no type variable reference
// (javadoc does not accept them and this is not a referenced bug or requested enhancement)
- if (reference.resolvedType != null && reference.resolvedType.isTypeVariable()) {
+ else if (reference instanceof JavadocSingleTypeReference && reference.resolvedType != null && reference.resolvedType.isTypeVariable()) {
scope.problemReporter().javadocInvalidReference(reference.sourceStart, reference.sourceEnd);
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java
index bb096bc..6fd34e6 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java
@@ -43,26 +43,26 @@
}
// buffering the arguments' types
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
+ this.argumentTypes = Binding.NO_PARAMETERS;
boolean hasTypeVarArgs = false;
if (this.arguments != null) {
- boolean argHasError = false;
+ this.argumentsHaveErrors = false;
int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
+ this.argumentTypes = new TypeBinding[length];
for (int i = 0; i < length; i++) {
Expression argument = this.arguments[i];
if (scope.kind == Scope.CLASS_SCOPE) {
- argumentTypes[i] = argument.resolveType((ClassScope)scope);
+ this.argumentTypes[i] = argument.resolveType((ClassScope)scope);
} else {
- argumentTypes[i] = argument.resolveType((BlockScope)scope);
+ this.argumentTypes[i] = argument.resolveType((BlockScope)scope);
}
- if (argumentTypes[i] == null) {
- argHasError = true;
+ if (this.argumentTypes[i] == null) {
+ this.argumentsHaveErrors = true;
} else if (!hasTypeVarArgs) {
- hasTypeVarArgs = argumentTypes[i].isTypeVariable();
+ hasTypeVarArgs = this.argumentTypes[i].isTypeVariable();
}
}
- if (argHasError) {
+ if (this.argumentsHaveErrors) {
return null;
}
}
@@ -78,13 +78,13 @@
}
ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType;
- this.binding = scope.getConstructor(allocationType, argumentTypes, this);
+ this.binding = scope.getConstructor(allocationType, this.argumentTypes, this);
if (!this.binding.isValidBinding()) {
ReferenceBinding enclosingTypeBinding = allocationType;
MethodBinding contructorBinding = this.binding;
while (!contructorBinding.isValidBinding() && (enclosingTypeBinding.isMemberType() || enclosingTypeBinding.isLocalType())) {
enclosingTypeBinding = enclosingTypeBinding.enclosingType();
- contructorBinding = scope.getConstructor(enclosingTypeBinding, argumentTypes, this);
+ contructorBinding = scope.getConstructor(enclosingTypeBinding, this.argumentTypes, this);
}
if (contructorBinding.isValidBinding()) {
this.binding = contructorBinding;
@@ -92,7 +92,7 @@
}
if (!this.binding.isValidBinding()) {
// First try to search a method instead
- MethodBinding methodBinding = scope.getMethod(this.resolvedType, this.resolvedType.sourceName(), argumentTypes, this);
+ MethodBinding methodBinding = scope.getMethod(this.resolvedType, this.resolvedType.sourceName(), this.argumentTypes, this);
if (methodBinding.isValidBinding()) {
this.binding = methodBinding;
} else {
@@ -103,22 +103,22 @@
}
return this.resolvedType;
} else if (this.binding.isVarargs()) {
- int length = argumentTypes.length;
- if (!(this.binding.parameters.length == length && argumentTypes[length-1].isArrayType())) {
- MethodBinding problem = new ProblemMethodBinding(this.binding, this.binding.selector, argumentTypes, ProblemReasons.NotFound);
+ int length = this.argumentTypes.length;
+ if (!(this.binding.parameters.length == length && this.argumentTypes[length-1].isArrayType())) {
+ MethodBinding problem = new ProblemMethodBinding(this.binding, this.binding.selector, this.argumentTypes, ProblemReasons.NotFound);
scope.problemReporter().javadocInvalidConstructor(this, problem, scope.getDeclarationModifiers());
}
} else if (hasTypeVarArgs) {
- MethodBinding problem = new ProblemMethodBinding(this.binding, this.binding.selector, argumentTypes, ProblemReasons.NotFound);
+ MethodBinding problem = new ProblemMethodBinding(this.binding, this.binding.selector, this.argumentTypes, ProblemReasons.NotFound);
scope.problemReporter().javadocInvalidConstructor(this, problem, scope.getDeclarationModifiers());
} else if (this.binding instanceof ParameterizedMethodBinding) {
ParameterizedMethodBinding paramMethodBinding = (ParameterizedMethodBinding) this.binding;
if (paramMethodBinding.hasSubstitutedParameters()) {
- int length = argumentTypes.length;
+ int length = this.argumentTypes.length;
for (int i=0; i<length; i++) {
- if (TypeBinding.notEquals(paramMethodBinding.parameters[i], argumentTypes[i]) &&
- TypeBinding.notEquals(paramMethodBinding.parameters[i].erasure(), argumentTypes[i].erasure())) {
- MethodBinding problem = new ProblemMethodBinding(this.binding, this.binding.selector, argumentTypes, ProblemReasons.NotFound);
+ if (TypeBinding.notEquals(paramMethodBinding.parameters[i], this.argumentTypes[i]) &&
+ TypeBinding.notEquals(paramMethodBinding.parameters[i].erasure(), this.argumentTypes[i].erasure())) {
+ MethodBinding problem = new ProblemMethodBinding(this.binding, this.binding.selector, this.argumentTypes, ProblemReasons.NotFound);
scope.problemReporter().javadocInvalidConstructor(this, problem, scope.getDeclarationModifiers());
break;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java
index 4cebbc6..2243f33 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java
@@ -50,26 +50,25 @@
// will check for null after args are resolved
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
boolean hasArgsTypeVar = false;
if (this.arguments != null) {
- boolean argHasError = false; // typeChecks all arguments
+ this.argumentsHaveErrors = false; // typeChecks all arguments
int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
+ this.argumentTypes = new TypeBinding[length];
for (int i = 0; i < length; i++){
Expression argument = this.arguments[i];
if (scope.kind == Scope.CLASS_SCOPE) {
- argumentTypes[i] = argument.resolveType((ClassScope)scope);
+ this.argumentTypes[i] = argument.resolveType((ClassScope)scope);
} else {
- argumentTypes[i] = argument.resolveType((BlockScope)scope);
+ this.argumentTypes[i] = argument.resolveType((BlockScope)scope);
}
- if (argumentTypes[i] == null) {
- argHasError = true;
+ if (this.argumentTypes[i] == null) {
+ this.argumentsHaveErrors = true;
} else if (!hasArgsTypeVar) {
- hasArgsTypeVar = argumentTypes[i].isTypeVariable();
+ hasArgsTypeVar = this.argumentTypes[i].isTypeVariable();
}
}
- if (argHasError) {
+ if (this.argumentsHaveErrors) {
return null;
}
}
@@ -86,17 +85,17 @@
// base type cannot receive any message
if (this.actualReceiverType.isBaseType()) {
- scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, argumentTypes, scope.getDeclarationModifiers());
+ scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, this.argumentTypes, scope.getDeclarationModifiers());
return null;
}
- this.binding = scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this);
+ this.binding = scope.getMethod(this.actualReceiverType, this.selector, this.argumentTypes, this);
if (!this.binding.isValidBinding()) {
// Try method in enclosing types
TypeBinding enclosingTypeBinding = this.actualReceiverType;
MethodBinding methodBinding = this.binding;
while (!methodBinding.isValidBinding() && (enclosingTypeBinding.isMemberType() || enclosingTypeBinding.isLocalType())) {
enclosingTypeBinding = enclosingTypeBinding.enclosingType();
- methodBinding = scope.getMethod(enclosingTypeBinding, this.selector, argumentTypes, this);
+ methodBinding = scope.getMethod(enclosingTypeBinding, this.selector, this.argumentTypes, this);
}
if (methodBinding.isValidBinding()) {
this.binding = methodBinding;
@@ -105,12 +104,12 @@
enclosingTypeBinding = this.actualReceiverType;
MethodBinding contructorBinding = this.binding;
if (!contructorBinding.isValidBinding() && CharOperation.equals(this.selector, enclosingTypeBinding.shortReadableName())) {
- contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, argumentTypes, this);
+ contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, this.argumentTypes, this);
}
while (!contructorBinding.isValidBinding() && (enclosingTypeBinding.isMemberType() || enclosingTypeBinding.isLocalType())) {
enclosingTypeBinding = enclosingTypeBinding.enclosingType();
if (CharOperation.equals(this.selector, enclosingTypeBinding.shortReadableName())) {
- contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, argumentTypes, this);
+ contructorBinding = scope.getConstructor((ReferenceBinding)enclosingTypeBinding, this.argumentTypes, this);
}
}
if (contructorBinding.isValidBinding()) {
@@ -140,7 +139,7 @@
if (this.actualReceiverType instanceof ReferenceBinding) {
this.binding.declaringClass = (ReferenceBinding) this.actualReceiverType;
} else {
- scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, argumentTypes, scope.getDeclarationModifiers());
+ scope.problemReporter().javadocErrorNoMethodFor(this, this.actualReceiverType, this.argumentTypes, scope.getDeclarationModifiers());
return null;
}
}
@@ -152,19 +151,19 @@
}
return this.resolvedType = this.binding == null ? null : this.binding.returnType;
} else if (hasArgsTypeVar) {
- MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, argumentTypes, ProblemReasons.NotFound);
+ MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, this.argumentTypes, ProblemReasons.NotFound);
scope.problemReporter().javadocInvalidMethod(this, problem, scope.getDeclarationModifiers());
} else if (this.binding.isVarargs()) {
- int length = argumentTypes.length;
- if (!(this.binding.parameters.length == length && argumentTypes[length-1].isArrayType())) {
- MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, argumentTypes, ProblemReasons.NotFound);
+ int length = this.argumentTypes.length;
+ if (!(this.binding.parameters.length == length && this.argumentTypes[length-1].isArrayType())) {
+ MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, this.argumentTypes, ProblemReasons.NotFound);
scope.problemReporter().javadocInvalidMethod(this, problem, scope.getDeclarationModifiers());
}
} else {
- int length = argumentTypes.length;
+ int length = this.argumentTypes.length;
for (int i=0; i<length; i++) {
- if (TypeBinding.notEquals(this.binding.parameters[i].erasure(), argumentTypes[i].erasure())) {
- MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, argumentTypes, ProblemReasons.NotFound);
+ if (TypeBinding.notEquals(this.binding.parameters[i].erasure(), this.argumentTypes[i].erasure())) {
+ MethodBinding problem = new ProblemMethodBinding(this.binding, this.selector, this.argumentTypes, ProblemReasons.NotFound);
scope.problemReporter().javadocInvalidMethod(this, problem, scope.getDeclarationModifiers());
break;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
index 8831655..0bb3687 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -140,4 +140,16 @@
}
visitor.endVisit(this, blockScope);
}
+
+ @Override
+ public boolean doesNotCompleteNormally() {
+ if (this.statement.breaksOut(this.label))
+ return false;
+ return this.statement.doesNotCompleteNormally();
+ }
+
+ @Override
+ public boolean completesByContinue() {
+ return this.statement instanceof ContinueStatement; // NOT this.statement.continuesAtOuterLabel
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
index d72ca10..e5b776c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
@@ -32,6 +32,10 @@
* Bug 429430 - [1.8] Lambdas and method reference infer wrong exception type with generics (RuntimeException instead of IOException)
* Bug 432110 - [1.8][compiler] nested lambda type incorrectly inferred vs javac
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 455723 - Nonnull argument not correctly inferred in loop
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
*******************************************************************************/
@@ -40,6 +44,7 @@
import static org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExpressionContext.INVOCATION_CONTEXT;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -55,6 +60,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext;
+import org.aspectj.org.eclipse.jdt.internal.compiler.flow.ExceptionInferenceFlowContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
@@ -67,7 +73,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionCastTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionTypeBinding18;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
@@ -94,7 +100,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
@SuppressWarnings({"rawtypes", "unchecked"})
-public class LambdaExpression extends FunctionalExpression implements ReferenceContext, ProblemSeverities {
+public class LambdaExpression extends FunctionalExpression implements IPolyExpression, ReferenceContext, ProblemSeverities {
public Argument [] arguments;
private TypeBinding [] argumentTypes;
public int arrowPosition;
@@ -103,9 +109,9 @@
public MethodScope scope;
boolean voidCompatible = true;
boolean valueCompatible = false;
- private boolean shapeAnalysisComplete = false;
boolean returnsValue;
public boolean isSerializable;
+ private boolean requiresGenericSignature;
boolean returnsVoid;
public LambdaExpression original = this;
public SyntheticArgumentBinding[] outerLocalVariables = NO_SYNTHETIC_ARGUMENTS;
@@ -118,15 +124,23 @@
private Set thrownExceptions;
public char[] text; // source representation of the lambda.
private static final SyntheticArgumentBinding [] NO_SYNTHETIC_ARGUMENTS = new SyntheticArgumentBinding[0];
- private static final Block NO_BODY = new Block(0, true);
-
- public LambdaExpression(CompilationResult compilationResult, boolean assistNode) {
+ private static final Block NO_BODY = new Block(0);
+ private HashMap<TypeBinding, LambdaExpression> copiesPerTargetType;
+ protected Expression [] resultExpressions = NO_EXPRESSIONS;
+ public InferenceContext18 inferenceContext; // when performing tentative resolve keep a back reference to the driving context
+
+ public LambdaExpression(CompilationResult compilationResult, boolean assistNode, boolean requiresGenericSignature) {
super(compilationResult);
this.assistNode = assistNode;
+ this.requiresGenericSignature = requiresGenericSignature;
setArguments(NO_ARGUMENTS);
setBody(NO_BODY);
}
-
+
+ public LambdaExpression(CompilationResult compilationResult, boolean assistNode) {
+ this(compilationResult, assistNode, false);
+ }
+
public void setArguments(Argument [] arguments) {
this.arguments = arguments != null ? arguments : ASTNode.NO_ARGUMENTS;
this.argumentTypes = new TypeBinding[arguments != null ? arguments.length : 0];
@@ -171,6 +185,7 @@
this.binding.modifiers |= ClassFileConstants.AccStatic;
}
SourceTypeBinding sourceType = currentScope.enclosingSourceType();
+ boolean firstSpill = !(this.binding instanceof SyntheticMethodBinding);
this.binding = sourceType.addSyntheticMethod(this);
int pc = codeStream.position;
StringBuffer signature = new StringBuffer();
@@ -181,7 +196,7 @@
}
for (int i = 0, length = this.outerLocalVariables == null ? 0 : this.outerLocalVariables.length; i < length; i++) {
SyntheticArgumentBinding syntheticArgument = this.outerLocalVariables[i];
- if (this.shouldCaptureInstance) {
+ if (this.shouldCaptureInstance && firstSpill) { // finally block handling results in extra spills, avoid side effect.
syntheticArgument.resolvedPosition++;
}
signature.append(syntheticArgument.type.signature());
@@ -190,8 +205,8 @@
codeStream.generateOuterAccess(path, this, capturedOuterLocal, currentScope);
}
signature.append(')');
- if (this.expectedType instanceof IntersectionCastTypeBinding) {
- signature.append(((IntersectionCastTypeBinding)this.expectedType).getSAMType(currentScope).signature());
+ if (this.expectedType instanceof IntersectionTypeBinding18) {
+ signature.append(((IntersectionTypeBinding18)this.expectedType).getSAMType(currentScope).signature());
} else {
signature.append(this.expectedType.signature());
}
@@ -219,31 +234,29 @@
*/
public TypeBinding resolveType(BlockScope blockScope) {
- if (this.resolvedType != null)
- return this.resolvedType;
-
- if (this.expectedType != null && this.original == this) { // final resolution ? may be not - i.e may be, but only in a non-final universe.
- this.ordinal = recordFunctionalType(blockScope);
- }
-
- this.constant = Constant.NotAConstant;
- this.enclosingScope = blockScope;
-
boolean argumentsTypeElided = argumentsTypeElided();
- int length = this.arguments == null ? 0 : this.arguments.length;
- if (!argumentsTypeElided) {
- for (int i = 0; i < length; i++)
- this.argumentTypes[i] = this.arguments[i].type.resolveType(blockScope, true /* check bounds*/);
+ int argumentsLength = this.arguments == null ? 0 : this.arguments.length;
+
+ if (this.constant != Constant.NotAConstant) {
+ this.constant = Constant.NotAConstant;
+ this.enclosingScope = blockScope;
+ if (this.original == this)
+ this.ordinal = recordFunctionalType(blockScope);
+
+ if (!argumentsTypeElided) {
+ for (int i = 0; i < argumentsLength; i++)
+ this.argumentTypes[i] = this.arguments[i].type.resolveType(blockScope, true /* check bounds*/);
+ }
+ if (this.expectedType == null && this.expressionContext == INVOCATION_CONTEXT) {
+ return new PolyTypeBinding(this);
+ }
}
- if (this.expectedType == null && this.expressionContext == INVOCATION_CONTEXT) {
- return new PolyTypeBinding(this);
- }
MethodScope methodScope = blockScope.methodScope();
this.scope = new MethodScope(blockScope, this, methodScope.isStatic, methodScope.lastVisibleFieldID);
this.scope.isConstructorCall = methodScope.isConstructorCall;
- super.resolveType(blockScope); // compute & capture interface function descriptor in singleAbstractMethod.
+ super.resolveType(blockScope); // compute & capture interface function descriptor.
final boolean haveDescriptor = this.descriptor != null;
@@ -258,89 +271,99 @@
blockScope.enclosingSourceType());
this.binding.typeVariables = Binding.NO_TYPE_VARIABLES;
- boolean buggyArguments = false;
+ boolean argumentsHaveErrors = false;
if (haveDescriptor) {
- int descriptorParameterCount = this.descriptor.parameters.length;
- int lambdaArgumentCount = this.arguments != null ? this.arguments.length : 0;
- if (descriptorParameterCount != lambdaArgumentCount) {
+ int parametersLength = this.descriptor.parameters.length;
+ if (parametersLength != argumentsLength) {
this.scope.problemReporter().lambdaSignatureMismatched(this);
if (argumentsTypeElided || this.original != this) // no interest in continuing to error check copy.
return this.resolvedType = null; // FUBAR, bail out ...
else {
this.resolvedType = null; // continue to type check.
- buggyArguments = true;
+ argumentsHaveErrors = true;
}
}
}
- TypeBinding[] newParameters = new TypeBinding[length];
+ TypeBinding[] newParameters = new TypeBinding[argumentsLength];
AnnotationBinding [][] parameterAnnotations = null;
- for (int i = 0; i < length; i++) {
+ for (int i = 0; i < argumentsLength; i++) {
Argument argument = this.arguments[i];
if (argument.isVarArgs()) {
- if (i == length - 1) {
+ if (i == argumentsLength - 1) {
this.binding.modifiers |= ClassFileConstants.AccVarargs;
} else {
this.scope.problemReporter().illegalVarargInLambda(argument);
- buggyArguments = true;
+ argumentsHaveErrors = true;
}
}
- TypeBinding parameterType;
+ TypeBinding argumentType;
final TypeBinding expectedParameterType = haveDescriptor && i < this.descriptor.parameters.length ? this.descriptor.parameters[i] : null;
- parameterType = argumentsTypeElided ? expectedParameterType : this.argumentTypes[i];
- if (parameterType == null) {
- buggyArguments = true;
- } else if (parameterType == TypeBinding.VOID) {
+ argumentType = argumentsTypeElided ? expectedParameterType : this.argumentTypes[i];
+ if (argumentType == null) {
+ argumentsHaveErrors = true;
+ } else if (argumentType == TypeBinding.VOID) {
this.scope.problemReporter().argumentTypeCannotBeVoid(this, argument);
- buggyArguments = true;
+ argumentsHaveErrors = true;
} else {
- if (!parameterType.isValidBinding()) {
+ if (!argumentType.isValidBinding()) {
this.binding.tagBits |= TagBits.HasUnresolvedArguments;
}
- if ((parameterType.tagBits & TagBits.HasMissingType) != 0) {
+ if ((argumentType.tagBits & TagBits.HasMissingType) != 0) {
this.binding.tagBits |= TagBits.HasMissingType;
}
}
}
- if (!argumentsTypeElided && !buggyArguments) {
+ if (!argumentsTypeElided && !argumentsHaveErrors) {
ReferenceBinding groundType = null;
ReferenceBinding expectedSAMType = null;
- if (this.expectedType instanceof IntersectionCastTypeBinding)
- expectedSAMType = (ReferenceBinding) ((IntersectionCastTypeBinding) this.expectedType).getSAMType(blockScope);
+ if (this.expectedType instanceof IntersectionTypeBinding18)
+ expectedSAMType = (ReferenceBinding) ((IntersectionTypeBinding18) this.expectedType).getSAMType(blockScope);
else if (this.expectedType instanceof ReferenceBinding)
expectedSAMType = (ReferenceBinding) this.expectedType;
if (expectedSAMType != null)
groundType = findGroundTargetType(blockScope, expectedSAMType, argumentsTypeElided);
+
if (groundType != null) {
this.descriptor = groundType.getSingleAbstractMethod(blockScope, true);
if (!this.descriptor.isValidBinding()) {
reportSamProblem(blockScope, this.descriptor);
} else {
+ if (groundType != expectedSAMType) { //$IDENTITY-COMPARISON$
+ if (!groundType.isCompatibleWith(expectedSAMType, this.scope)) { // the ground has shifted, are we still on firm grounds ?
+ blockScope.problemReporter().typeMismatchError(groundType, this.expectedType, this, null); // report deliberately against block scope so as not to blame the lambda.
+ return this.resolvedType = null;
+ }
+ }
this.resolvedType = groundType;
}
- // TODO: in which cases do we have to assign this.resolvedType & this.descriptor (with problem bindings) to prevent NPE downstream??
}
}
- for (int i = 0; i < length; i++) {
+ boolean genericSignatureNeeded = this.requiresGenericSignature || blockScope.compilerOptions().generateGenericSignatureForLambdaExpressions;
+ for (int i = 0; i < argumentsLength; i++) {
Argument argument = this.arguments[i];
- TypeBinding parameterType;
+ TypeBinding argumentType;
final TypeBinding expectedParameterType = haveDescriptor && i < this.descriptor.parameters.length ? this.descriptor.parameters[i] : null;
- parameterType = argumentsTypeElided ? expectedParameterType : this.argumentTypes[i];
- if (parameterType != null && parameterType != TypeBinding.VOID) {
- if (haveDescriptor && expectedParameterType != null && parameterType.isValidBinding() && TypeBinding.notEquals(parameterType, expectedParameterType)) {
+ argumentType = argumentsTypeElided ? expectedParameterType : this.argumentTypes[i];
+ if (argumentType != null && argumentType != TypeBinding.VOID) {
+ if (haveDescriptor && expectedParameterType != null && argumentType.isValidBinding() && TypeBinding.notEquals(argumentType, expectedParameterType)) {
if (expectedParameterType.isProperType(true)) {
this.scope.problemReporter().lambdaParameterTypeMismatched(argument, argument.type, expectedParameterType);
this.resolvedType = null; // continue to type check.
}
}
-
- newParameters[i] = argument.bind(this.scope, parameterType, false);
+ if (genericSignatureNeeded) {
+ TypeBinding leafType = argumentType.leafComponentType();
+ if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0)
+ this.binding.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
+ }
+ newParameters[i] = argument.bind(this.scope, argumentType, false);
if (argument.annotations != null) {
this.binding.tagBits |= TagBits.HasParameterAnnotations;
if (parameterAnnotations == null) {
- parameterAnnotations = new AnnotationBinding[length][];
+ parameterAnnotations = new AnnotationBinding[argumentsLength][];
for (int j = 0; j < i; j++) {
parameterAnnotations[j] = Binding.NO_ANNOTATIONS;
}
@@ -352,7 +375,7 @@
}
}
// only assign parameters if no problems are found
- if (!buggyArguments) {
+ if (!argumentsHaveErrors) {
this.binding.parameters = newParameters;
if (parameterAnnotations != null)
this.binding.setParameterAnnotations(parameterAnnotations);
@@ -365,12 +388,14 @@
}
ReferenceBinding [] exceptions = this.binding.thrownExceptions;
- length = exceptions.length;
- for (int i = 0; i < length; i++) {
+ int exceptionsLength = exceptions.length;
+ for (int i = 0; i < exceptionsLength; i++) {
ReferenceBinding exception = exceptions[i];
if ((exception.tagBits & TagBits.HasMissingType) != 0) {
this.binding.tagBits |= TagBits.HasMissingType;
}
+ if (genericSignatureNeeded)
+ this.binding.modifiers |= (exception.modifiers & ExtraCompilerModifiers.AccGenericSignature);
}
TypeBinding returnType = this.binding.returnType;
@@ -378,12 +403,16 @@
if ((returnType.tagBits & TagBits.HasMissingType) != 0) {
this.binding.tagBits |= TagBits.HasMissingType;
}
+ if (genericSignatureNeeded) {
+ TypeBinding leafType = returnType.leafComponentType();
+ if (leafType instanceof ReferenceBinding && (((ReferenceBinding) leafType).modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0)
+ this.binding.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
+ }
} // TODO (stephan): else? (can that happen?)
- if (haveDescriptor && !buggyArguments && blockScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
+ if (haveDescriptor && !argumentsHaveErrors && blockScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
if (!argumentsTypeElided) {
- AbstractMethodDeclaration.createArgumentBindings(this.arguments, this.binding, this.scope);
- validateNullAnnotations();
+ AbstractMethodDeclaration.createArgumentBindings(this.arguments, this.binding, this.scope); // includes validation
// no application of null-ness default, hence also no warning regarding redundant null annotation
mergeParameterNullAnnotations(blockScope);
}
@@ -397,9 +426,15 @@
new ReturnStatement(expression, expression.sourceStart, expression.sourceEnd, true).resolve(this.scope); // :-) ;-)
} else {
this.body.resolve(this.scope);
+ /* At this point, shape analysis is complete for ((see returnsExpression(...))
+ - a lambda with an expression body,
+ - a lambda with a block body in which we saw a return statement naked or otherwise.
+ */
+ if (!this.returnsVoid && !this.returnsValue)
+ this.valueCompatible = this.body.doesNotCompleteNormally();
}
- if (this.expectedType instanceof IntersectionCastTypeBinding) {
- ReferenceBinding[] intersectingTypes = ((IntersectionCastTypeBinding)this.expectedType).intersectingTypes;
+ if (this.expectedType instanceof IntersectionTypeBinding18) {
+ ReferenceBinding[] intersectingTypes = ((IntersectionTypeBinding18)this.expectedType).intersectingTypes;
for (int t = 0, max = intersectingTypes.length; t < max; t++) {
if (intersectingTypes[t].findSuperTypeOriginatingFrom(TypeIds.T_JavaIoSerializable, false /*Serializable is not a class*/) != null) {
this.isSerializable = true;
@@ -413,20 +448,28 @@
if ((this.binding.tagBits & TagBits.HasMissingType) != 0) {
this.scope.problemReporter().missingTypeInLambda(this, this.binding);
}
- return this.resolvedType;
+ if (this.shouldCaptureInstance && this.scope.isConstructorCall) {
+ this.scope.problemReporter().fieldsOrThisBeforeConstructorInvocation(this);
+ }
+ return argumentsHaveErrors ? this.resolvedType = null : this.resolvedType;
}
- private ReferenceBinding findGroundTargetType(BlockScope blockScope, ReferenceBinding targetType, boolean argumentTypesElided) {
- if (!targetType.isValidBinding())
- return null;
- ParameterizedTypeBinding withWildCards = InferenceContext18.parameterizedWithWildcard(targetType);
- if (withWildCards != null) {
- if (!argumentTypesElided)
- return new InferenceContext18(blockScope).inferFunctionalInterfaceParameterization(this, blockScope, withWildCards);
- else
- return findGroundTargetTypeForElidedLambda(blockScope, withWildCards);
+ private ReferenceBinding findGroundTargetType(BlockScope blockScope, TypeBinding targetType, boolean argumentTypesElided) {
+
+ if (targetType instanceof IntersectionTypeBinding18)
+ targetType = ((IntersectionTypeBinding18) targetType).getSAMType(blockScope);
+
+ if (targetType instanceof ReferenceBinding && targetType.isValidBinding()) {
+ ParameterizedTypeBinding withWildCards = InferenceContext18.parameterizedWithWildcard(targetType);
+ if (withWildCards != null) {
+ if (!argumentTypesElided)
+ return new InferenceContext18(blockScope).inferFunctionalInterfaceParameterization(this, blockScope, withWildCards);
+ else
+ return findGroundTargetTypeForElidedLambda(blockScope, withWildCards);
+ }
+ return (ReferenceBinding) targetType;
}
- return targetType;
+ return null;
}
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) {
@@ -435,21 +478,22 @@
if (types == null)
return null;
ReferenceBinding genericType = withWildCards.genericType();
- return blockScope.environment().createParameterizedType(genericType, types, genericType.enclosingType());
+ return blockScope.environment().createParameterizedType(genericType, types, withWildCards.enclosingType());
}
public boolean argumentsTypeElided() {
return this.arguments.length > 0 && this.arguments[0].hasElidedType();
}
- private boolean doesNotCompleteNormally() {
+ private void analyzeExceptions() {
+ ExceptionHandlingFlowContext ehfc;
try {
- return this.body.analyseCode(this.scope,
- new ExceptionHandlingFlowContext(null, this, Binding.NO_EXCEPTIONS, null, this.scope, FlowInfo.DEAD_END),
- UnconditionalFlowInfo.fakeInitializedFlowInfo(this.scope.outerMostMethodScope().analysisIndex, this.scope.referenceType().maxFieldCount)) == FlowInfo.DEAD_END;
- } catch (RuntimeException e) {
- this.scope.problemReporter().lambdaShapeComputationError(this);
- return this.valueCompatible;
+ this.body.analyseCode(this.scope,
+ ehfc = new ExceptionInferenceFlowContext(null, this, Binding.NO_EXCEPTIONS, null, this.scope, FlowInfo.DEAD_END),
+ UnconditionalFlowInfo.fakeInitializedFlowInfo(this.scope.outerMostMethodScope().analysisIndex, this.scope.referenceType().maxFieldCount));
+ this.thrownExceptions = ehfc.extendedExceptions == null ? Collections.emptySet() : new HashSet<TypeBinding>(ehfc.extendedExceptions);
+ } catch (Exception e) {
+ // drop silently.
}
}
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, final FlowInfo flowInfo) {
@@ -463,7 +507,7 @@
flowContext,
this,
this.binding.thrownExceptions,
- null,
+ flowContext.getInitializationContext(),
this.scope,
FlowInfo.DEAD_END);
@@ -496,7 +540,7 @@
&& lambdaInfo.reachMode() == FlowInfo.REACHABLE)
{
Expression expression = (Expression)this.body;
- checkAgainstNullAnnotation(flowContext, expression, expression.nullStatus(lambdaInfo, flowContext));
+ checkAgainstNullAnnotation(flowContext, expression, flowInfo, expression.nullStatus(lambdaInfo, flowContext));
}
}
return flowInfo;
@@ -510,7 +554,7 @@
int length = this.binding.parameters.length;
for (int i=0; i<length; i++) {
if (!this.scope.validateNullAnnotation(this.binding.returnType.tagBits, this.arguments[i].type, this.arguments[i].annotations))
- this.binding.returnType = this.binding.returnType.unannotated(true);
+ this.binding.returnType = this.binding.returnType.withoutToplevelNullAnnotation();
}
}
}
@@ -552,12 +596,12 @@
}
// simplified version of ReturnStatement.checkAgainstNullAnnotation()
- void checkAgainstNullAnnotation(FlowContext flowContext, Expression expression, int nullStatus) {
+ void checkAgainstNullAnnotation(FlowContext flowContext, Expression expression, FlowInfo flowInfo, int nullStatus) {
if (nullStatus != FlowInfo.NON_NULL) {
// if we can't prove non-null check against declared null-ness of the descriptor method:
// Note that this.binding never has a return type declaration, always inherit null-ness from the descriptor
if ((this.descriptor.returnType.tagBits & TagBits.AnnotationNonNull) != 0) {
- flowContext.recordNullityMismatch(this.scope, expression, expression.resolvedType, this.descriptor.returnType, nullStatus);
+ flowContext.recordNullityMismatch(this.scope, expression, expression.resolvedType, this.descriptor.returnType, flowInfo, nullStatus, null);
}
}
}
@@ -587,14 +631,10 @@
}
public boolean isVoidCompatible() {
- if (!this.shapeAnalysisComplete)
- throw new IllegalStateException("asking isVoidCompatible before shape analysis is complete"); //$NON-NLS-1$
return this.voidCompatible;
}
public boolean isValueCompatible() {
- if (!this.shapeAnalysisComplete)
- throw new IllegalStateException("asking isValueCompatible before shape analysis is complete"); //$NON-NLS-1$
return this.valueCompatible;
}
@@ -663,7 +703,7 @@
return false;
}
- private void analyzeShape() { // simple minded analysis for code assist.
+ private void analyzeShape() { // Simple minded analysis for code assist & potential compatibility.
class ShapeComputer extends ASTVisitor {
public boolean visit(TypeDeclaration type, BlockScope skope) {
return false;
@@ -678,107 +718,51 @@
if (returnStatement.expression != null) {
LambdaExpression.this.valueCompatible = true;
LambdaExpression.this.voidCompatible = false;
+ LambdaExpression.this.returnsValue = true;
} else {
LambdaExpression.this.voidCompatible = true;
LambdaExpression.this.valueCompatible = false;
+ LambdaExpression.this.returnsVoid = true;
}
return false;
}
}
if (this.body instanceof Expression) {
- this.voidCompatible = ((Expression) this.body).statementExpression();
- this.valueCompatible = true;
+ // When completion is still in progress, it is not possible to ask if the expression constitutes a statement expression. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=435219
+ this.voidCompatible = this.assistNode ? true : ((Expression) this.body).statementExpression();
+ this.valueCompatible = true; // expression could be of type void - we can't determine that as we are working with unresolved expressions, for potential compatibility it is OK.
} else {
- // We need to be a bit tolerant/fuzzy here: the code is being written "just now", if we are too pedantic, selection/completion will break;
- this.voidCompatible = true;
- this.valueCompatible = true;
+ // For code assist, we need to be a bit tolerant/fuzzy here: the code is being written "just now", if we are too pedantic, selection/completion will break;
+ if (this.assistNode) {
+ this.voidCompatible = true;
+ this.valueCompatible = true;
+ }
this.body.traverse(new ShapeComputer(), null);
+ if (!this.returnsValue && !this.returnsVoid)
+ this.valueCompatible = this.body.doesNotCompleteNormally();
}
- this.shapeAnalysisComplete = true;
}
- public boolean isCompatibleWith(TypeBinding left, final Scope someScope) {
- if (!(left instanceof ReferenceBinding))
- return false;
-
- left = left.uncapture(this.enclosingScope);
- shapeAnalysis: if (!this.shapeAnalysisComplete) {
- IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
- final CompilerOptions compilerOptions = this.enclosingScope.compilerOptions();
- boolean analyzeNPE = compilerOptions.isAnnotationBasedNullAnalysisEnabled;
- compilerOptions.isAnnotationBasedNullAnalysisEnabled = false;
- try {
- final LambdaExpression copy = copy();
- if (copy == null) {
- if (this.assistNode) {
- analyzeShape(); // not on terra firma here !
-// FIXME: we don't yet have the same, should we compute it here & now?
-// if (sam.returnType.id == TypeIds.T_void) {
-// if (!this.voidCompatible)
-// return false;
-// } else {
-// if (!this.valueCompatible)
-// return false;
-// }
- }
- return !isPertinentToApplicability(left, null);
- }
- copy.setExpressionContext(this.expressionContext);
- copy.setExpectedType(left);
- this.hasIgnoredMandatoryErrors = false;
- TypeBinding type = copy.resolveType(this.enclosingScope);
- if (type == null || !type.isValidBinding())
- return false;
- if (this.body instanceof Block) {
- if (this.returnsVoid) {
- this.shapeAnalysisComplete = true;
- }
- } else {
- this.voidCompatible = ((Expression) this.body).statementExpression();
- // TODO: in getResolvedCopyForInferenceTargeting() we need to check if the expression
- // *could* also produce a value and set valueCompatible accordingly.
- // Is that needed also here?
- this.shapeAnalysisComplete = true;
- }
- // Do not proceed with data/control flow analysis if resolve encountered errors.
- if (this.hasIgnoredMandatoryErrors || enclosingScopesHaveErrors()) {
- if (!isPertinentToApplicability(left, null))
- break shapeAnalysis;
- if (this.arguments.length != 0) // error not because of the target type imposition, but is inherent. Just say compatible since errors in body aren't to influence applicability.
- return false;
- break shapeAnalysis;
- }
-
- // value compatibility of block lambda's is the only open question.
- if (!this.shapeAnalysisComplete)
- this.valueCompatible = copy.doesNotCompleteNormally();
-
- this.shapeAnalysisComplete = true;
- } finally {
- compilerOptions.isAnnotationBasedNullAnalysisEnabled = analyzeNPE;
- this.hasIgnoredMandatoryErrors = false;
- this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
- }
- }
-
- ReferenceBinding expectedSAMType = null;
- if (left instanceof IntersectionCastTypeBinding)
- expectedSAMType = (ReferenceBinding) ((IntersectionCastTypeBinding) left).getSAMType(this.enclosingScope);
- else if (left instanceof ReferenceBinding)
- expectedSAMType = (ReferenceBinding) left;
- ReferenceBinding groundTargetType = expectedSAMType != null ? findGroundTargetType(this.enclosingScope, expectedSAMType, argumentsTypeElided()) : null;
- if (groundTargetType == null)
- return false;
+ @Override
+ public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope skope) {
+ /* We get here only when the lambda is NOT pertinent to applicability and that too only for type elided lambdas. */
- MethodBinding sam = groundTargetType.getSingleAbstractMethod(this.enclosingScope, true);
+ /* 15.12.2.1: A lambda expression (§15.27) is potentially compatible with a functional interface type (§9.8) if all of the following are true:
+ – The arity of the target type's function type is the same as the arity of the lambda expression.
+ – If the target type's function type has a void return, then the lambda body is either a statement expression (§14.8) or a void-compatible block (§15.27.2).
+ – If the target type's function type has a (non-void) return type, then the lambda body is either an expression or a value-compatible block (§15.27.2).
+ */
+ if (!super.isPertinentToApplicability(targetType, null))
+ return true;
+
+ final MethodBinding sam = targetType.getSingleAbstractMethod(skope, true);
if (sam == null || !sam.isValidBinding())
return false;
+
if (sam.parameters.length != this.arguments.length)
return false;
-
- if (!isPertinentToApplicability(left, null)) // This check should happen after return type check below, but for buggy javac compatibility we have left it in.
- return true;
-
+
+ analyzeShape();
if (sam.returnType.id == TypeIds.T_void) {
if (!this.voidCompatible)
return false;
@@ -786,29 +770,108 @@
if (!this.valueCompatible)
return false;
}
- Expression [] returnExpressions = this.resultExpressions;
- for (int i = 0, length = returnExpressions.length; i < length; i++) {
- if (returnExpressions[i] instanceof FunctionalExpression) { // don't want to use the resolvedType - polluted from some other overload resolution candidate
- if (!returnExpressions[i].isCompatibleWith(sam.returnType, this.enclosingScope))
- return false;
- } else {
- if (this.enclosingScope.parameterCompatibilityLevel(returnExpressions[i].resolvedType, sam.returnType) == Scope.NOT_COMPATIBLE) {
- if (!returnExpressions[i].isConstantValueOfTypeAssignableToType(returnExpressions[i].resolvedType, sam.returnType))
- if (sam.returnType.id != TypeIds.T_void || this.body instanceof Block)
- return false;
- }
- }
- }
+ return true;
+ }
- TypeBinding [] samPararameterTypes = sam.parameters;
- for (int i = 0, length = samPararameterTypes.length; i < length; i++) { // lengths known to be equal.
- if (TypeBinding.notEquals(samPararameterTypes[i], this.argumentTypes[i]))
+ public boolean isCompatibleWith(TypeBinding targetType, final Scope skope) {
+
+ if (!super.isPertinentToApplicability(targetType, null))
+ return true;
+
+ LambdaExpression copy = null;
+ try {
+ copy = cachedResolvedCopy(targetType, argumentsTypeElided(), false, null); // if argument types are elided, we don't care for result expressions against *this* target, any valid target is OK.
+ } catch (CopyFailureException cfe) {
+ if (this.assistNode)
+ return true; // can't type check result expressions, just say yes.
+ return !isPertinentToApplicability(targetType, null); // don't expect to hit this ever.
+ }
+ if (copy == null)
+ return false;
+
+ // copy here is potentially compatible with the target type and has its shape fully computed: i.e value/void compatibility is determined and result expressions have been gathered.
+ targetType = findGroundTargetType(this.enclosingScope, targetType, argumentsTypeElided());
+ MethodBinding sam = targetType.getSingleAbstractMethod(this.enclosingScope, true);
+ if (sam.returnType.id == TypeIds.T_void) {
+ if (!copy.voidCompatible)
+ return false;
+ } else {
+ if (!copy.valueCompatible)
return false;
}
+ if (!isPertinentToApplicability(targetType, null))
+ return true;
+
+ Expression [] returnExpressions = copy.resultExpressions;
+ for (int i = 0, length = returnExpressions.length; i < length; i++) {
+ if (this.enclosingScope.parameterCompatibilityLevel(returnExpressions[i].resolvedType, sam.returnType) == Scope.NOT_COMPATIBLE) {
+ if (!returnExpressions[i].isConstantValueOfTypeAssignableToType(returnExpressions[i].resolvedType, sam.returnType))
+ if (sam.returnType.id != TypeIds.T_void || this.body instanceof Block)
+ return false;
+ }
+ }
return true;
}
+
+ class CopyFailureException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
+ }
+ private LambdaExpression cachedResolvedCopy(TypeBinding targetType, boolean anyTargetOk, boolean requireExceptionAnalysis, InferenceContext18 context) {
+
+ targetType = findGroundTargetType(this.enclosingScope, targetType, argumentsTypeElided());
+ if (targetType == null)
+ return null;
+
+ MethodBinding sam = targetType.getSingleAbstractMethod(this.enclosingScope, true);
+ if (sam == null || !sam.isValidBinding())
+ return null;
+
+ if (sam.parameters.length != this.arguments.length)
+ return null;
+
+ LambdaExpression copy = null;
+ if (this.copiesPerTargetType != null) {
+ copy = this.copiesPerTargetType.get(targetType);
+ if (copy == null) {
+ if (anyTargetOk && this.copiesPerTargetType.values().size() > 0)
+ copy = this.copiesPerTargetType.values().iterator().next();
+ }
+ }
+ final CompilerOptions compilerOptions = this.enclosingScope.compilerOptions();
+ boolean analyzeNPE = compilerOptions.isAnnotationBasedNullAnalysisEnabled;
+ IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
+ compilerOptions.isAnnotationBasedNullAnalysisEnabled = false;
+ try {
+ if (copy == null) {
+ copy = copy();
+ if (copy == null)
+ throw new CopyFailureException();
+
+ copy.setExpressionContext(this.expressionContext);
+ copy.setExpectedType(targetType);
+ copy.inferenceContext = context;
+ TypeBinding type = copy.resolveType(this.enclosingScope);
+ if (type == null || !type.isValidBinding())
+ return null;
+
+ if (this.copiesPerTargetType == null)
+ this.copiesPerTargetType = new HashMap<TypeBinding, LambdaExpression>();
+ this.copiesPerTargetType.put(targetType, copy);
+ }
+ if (!requireExceptionAnalysis)
+ return copy;
+ if (copy.thrownExceptions == null)
+ if (!copy.hasIgnoredMandatoryErrors && !enclosingScopesHaveErrors())
+ copy.analyzeExceptions();
+ return copy;
+ } finally {
+ compilerOptions.isAnnotationBasedNullAnalysisEnabled = analyzeNPE;
+ this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
+ }
+ }
+
/**
* Get a resolved copy of this lambda for use by type inference, as to avoid spilling any premature
* type results into the original lambda.
@@ -816,60 +879,12 @@
* @param targetType the target functional type against which inference is attempted, must be a non-null valid functional type
* @return a resolved copy of 'this' or null if significant errors where encountered
*/
- public LambdaExpression getResolvedCopyForInferenceTargeting(TypeBinding targetType) {
- // note: this is essentially a simplified extract from isCompatibleWith(TypeBinding,Scope).
- if (this.shapeAnalysisComplete && this.binding != null)
- return this;
-
- targetType = targetType.uncapture(this.enclosingScope);
- // TODO: caching
- IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
- final CompilerOptions compilerOptions = this.enclosingScope.compilerOptions();
- boolean analyzeNPE = compilerOptions.isAnnotationBasedNullAnalysisEnabled;
- final LambdaExpression copy = copy();
- if (copy == null) {
- return null;
- }
+ public LambdaExpression resolveExpressionExpecting(TypeBinding targetType, Scope skope, InferenceContext18 context) {
+ LambdaExpression copy = null;
try {
- compilerOptions.isAnnotationBasedNullAnalysisEnabled = false;
- copy.setExpressionContext(this.expressionContext);
- copy.setExpectedType(targetType);
- this.hasIgnoredMandatoryErrors = false;
- TypeBinding type = copy.resolveType(this.enclosingScope);
- if (type == null || !type.isValidBinding())
- return null;
- if (this.body instanceof Block) {
- if (copy.returnsVoid) {
- copy.shapeAnalysisComplete = true;
- } else {
- copy.valueCompatible = this.returnsValue;
- }
- } else {
- copy.voidCompatible = ((Expression) this.body).statementExpression();
- TypeBinding resultType = ((Expression) this.body).resolvedType;
- if (resultType == null) // case of a yet-unresolved poly expression?
- copy.valueCompatible = true;
- else
- copy.valueCompatible = (resultType != TypeBinding.VOID);
- copy.shapeAnalysisComplete = true;
- }
- // Do not proceed with data/control flow analysis if resolve encountered errors.
- if (!this.hasIgnoredMandatoryErrors && !enclosingScopesHaveErrors()) {
- // value compatibility of block lambda's is the only open question.
- if (!copy.shapeAnalysisComplete)
- copy.valueCompatible = copy.doesNotCompleteNormally();
- } else {
- if (!copy.returnsVoid)
- copy.valueCompatible = true; // optimistically, TODO: is this OK??
- }
-
- copy.shapeAnalysisComplete = true;
- copy.resultExpressions = this.resultExpressions;
- this.resultExpressions = NO_EXPRESSIONS;
- } finally {
- compilerOptions.isAnnotationBasedNullAnalysisEnabled = analyzeNPE;
- this.hasIgnoredMandatoryErrors = false;
- this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
+ copy = cachedResolvedCopy(targetType, false, true, context);
+ } catch (CopyFailureException cfe) {
+ return null;
}
return copy;
}
@@ -884,14 +899,14 @@
if (argumentsTypeElided() || t.findSuperTypeOriginatingFrom(s) != null)
return false;
- s = s.capture(this.enclosingScope, this.sourceEnd);
+ s = s.capture(this.enclosingScope, this.sourceStart, this.sourceEnd);
MethodBinding sSam = s.getSingleAbstractMethod(this.enclosingScope, true);
if (sSam == null || !sSam.isValidBinding())
return false;
TypeBinding r1 = sSam.returnType;
MethodBinding tSam = t.getSingleAbstractMethod(this.enclosingScope, true);
if (tSam == null || !tSam.isValidBinding())
- return false;
+ return true; // See ORT8.test450415a for a case that slips through isCompatibleWith.
TypeBinding r2 = tSam.returnType;
if (r2.id == TypeIds.T_void)
@@ -904,7 +919,8 @@
if (r1.isCompatibleWith(r2, skope))
return true;
- Expression [] returnExpressions = this.resultExpressions;
+ LambdaExpression copy = cachedResolvedCopy(s, true /* any resolved copy is good */, false, null); // we expect a cached copy - otherwise control won't reach here.
+ Expression [] returnExpressions = copy.resultExpressions;
int returnExpressionsLength = returnExpressions == null ? 0 : returnExpressions.length;
int i;
@@ -946,34 +962,36 @@
if (copy != null) { // ==> syntax errors == null
copy.original = this;
+ copy.assistNode = this.assistNode;
+ copy.enclosingScope = this.enclosingScope;
}
return copy;
}
public void returnsExpression(Expression expression, TypeBinding resultType) {
- if (this.original == this) // not in overload resolution context.
+ if (this.original == this) // Not in overload resolution context. result expressions not relevant.
return;
if (this.body instanceof Expression) {
- this.original.valueCompatible = resultType != null && resultType.id != TypeIds.T_void;
- this.original.resultExpressions = new Expression[1];
- this.original.resultExpressions[0] = expression;
- return; // void compatibility determined via statementExpression()
+ this.valueCompatible = resultType != null && resultType.id == TypeIds.T_void ? false : true;
+ this.voidCompatible = this.assistNode ? true : ((Expression) this.body).statementExpression(); // while code is still being written and completed, we can't ask if it is a statement
+ this.resultExpressions = new Expression[] { expression };
+ return;
}
if (expression != null) {
- this.original.returnsValue = true;
- this.original.voidCompatible = false;
- this.original.valueCompatible = !this.original.returnsVoid;
+ this.returnsValue = true;
+ this.voidCompatible = false;
+ this.valueCompatible = !this.returnsVoid;
if (resultType != null) {
- Expression [] returnExpressions = this.original.resultExpressions;
+ Expression [] returnExpressions = this.resultExpressions;
int resultsLength = returnExpressions.length;
System.arraycopy(returnExpressions, 0, returnExpressions = new Expression[resultsLength + 1], 0, resultsLength);
returnExpressions[resultsLength] = expression;
- this.original.resultExpressions = returnExpressions;
+ this.resultExpressions = returnExpressions;
}
} else {
- this.original.returnsVoid = true;
- this.original.valueCompatible = false;
- this.original.voidCompatible = !this.original.returnsValue;
+ this.returnsVoid = true;
+ this.valueCompatible = false;
+ this.voidCompatible = !this.returnsValue;
}
}
@@ -1044,26 +1062,17 @@
case IProblem.NoGenericLambda:
return;
default:
- this.original.hasIgnoredMandatoryErrors = true;
+ this.hasIgnoredMandatoryErrors = true;
MethodScope enclosingLambdaScope = this.scope == null ? null : this.scope.enclosingLambdaScope();
while (enclosingLambdaScope != null) {
LambdaExpression enclosingLambda = (LambdaExpression) enclosingLambdaScope.referenceContext;
- if (enclosingLambda.original != enclosingLambda)
- enclosingLambda.original.hasIgnoredMandatoryErrors = true;
+ enclosingLambda.hasIgnoredMandatoryErrors = true;
enclosingLambdaScope = enclosingLambdaScope.enclosingLambdaScope();
}
return;
}
}
- public void throwsException(TypeBinding exceptionType) {
- if (this.expressionContext != INVOCATION_CONTEXT)
- return;
- if (this.thrownExceptions == null)
- this.thrownExceptions = new HashSet<TypeBinding>();
- this.thrownExceptions.add(exceptionType);
- }
-
public Set<TypeBinding> getThrownExceptions() {
if (this.thrownExceptions == null)
return Collections.emptySet();
@@ -1197,9 +1206,16 @@
public MethodBinding getMethodBinding() {
if (this.actualMethodBinding == null) {
if (this.binding != null) {
- this.actualMethodBinding = new MethodBinding(this.binding.modifiers, this.binding.selector, this.binding.returnType,
- this.binding instanceof SyntheticMethodBinding ? this.descriptor.parameters : this.binding.parameters, // retain any faults in parameter list.
- this.binding.thrownExceptions, this.binding.declaringClass);
+ // Get rid of the synthetic arguments added via addSyntheticArgument()
+ TypeBinding[] newParams = null;
+ if (this.binding instanceof SyntheticMethodBinding && this.outerLocalVariables.length > 0) {
+ newParams = new TypeBinding[this.binding.parameters.length - this.outerLocalVariables.length];
+ System.arraycopy(this.binding.parameters, this.outerLocalVariables.length, newParams, 0, newParams.length);
+ } else {
+ newParams = this.binding.parameters;
+ }
+ this.actualMethodBinding = new MethodBinding(this.binding.modifiers, this.binding.selector,
+ this.binding.returnType, newParams, this.binding.thrownExceptions, this.binding.declaringClass);
this.actualMethodBinding.tagBits = this.binding.tagBits;
} else {
this.actualMethodBinding = new ProblemMethodBinding(CharOperation.NO_CHAR, null, ProblemReasons.NoSuchSingleAbstractMethod);
@@ -1213,9 +1229,9 @@
}
public TypeBinding[] getMarkerInterfaces() {
- if (this.expectedType instanceof IntersectionCastTypeBinding) {
+ if (this.expectedType instanceof IntersectionTypeBinding18) {
Set markerBindings = new LinkedHashSet();
- TypeBinding[] intersectionTypes = ((IntersectionCastTypeBinding)this.expectedType).intersectingTypes;
+ TypeBinding[] intersectionTypes = ((IntersectionTypeBinding18)this.expectedType).intersectingTypes;
for (int i = 0,max = intersectionTypes.length; i < max; i++) {
TypeBinding typeBinding = intersectionTypes[i];
MethodBinding methodBinding = typeBinding.getSingleAbstractMethod(this.scope, true);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
index 852d39d..cb3fc4b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
@@ -25,6 +25,7 @@
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
* Bug 430150 - [1.8][null] stricter checking against type variables
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
* Jesper S Moller - Contributions for
* Bug 378674 - "The method can be declared as static" is wrong
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
@@ -44,6 +45,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.*;
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.RecoveryScanner;
@SuppressWarnings("rawtypes")
public class LocalDeclaration extends AbstractVariableDeclaration {
@@ -100,7 +102,7 @@
}
flowInfo.markAsDefinitelyAssigned(this.binding);
if (currentScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
- nullStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, this.binding, nullStatus, this.initialization, this.initialization.resolvedType);
+ nullStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, this.binding, flowInfo, nullStatus, this.initialization, this.initialization.resolvedType);
}
if ((this.binding.type.tagBits & TagBits.IsBaseType) == 0) {
flowInfo.markNullStatus(this.binding, nullStatus);
@@ -331,4 +333,8 @@
visitor.endVisit(this, scope);
}
+ public boolean isRecoveredFromLoneIdentifier() { // recovered from lonely identifier or identifier cluster ?
+ return this.name == RecoveryScanner.FAKE_IDENTIFIER &&
+ (this.type instanceof SingleTypeReference || (this.type instanceof QualifiedTypeReference && !(this.type instanceof ArrayQualifiedTypeReference))) && this.initialization == null && !this.type.isBaseTypeReference();
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index 2fe55a8..f657dcd 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -48,6 +48,10 @@
* Bug 426996 - [1.8][inference] try to avoid method Expression.unresolve()?
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
* Bug 429430 - [1.8] Lambdas and method reference infer wrong exception type with generics (RuntimeException instead of IOException)
+ * Bug 441734 - [1.8][inference] Generic method with nested parameterized type argument fails on method reference
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ * Bug 456487 - [1.8][null] @Nullable type variant of @NonNull-constrained type parameter causes grief
+ * Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
* Jesper S Moller - Contributions for
* Bug 378674 - "The method can be declared as static" is wrong
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
@@ -58,6 +62,8 @@
import static org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExpressionContext.*;
+import java.util.HashMap;
+
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -81,6 +87,8 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MissingTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolyParameterizedGenericMethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolymorphicMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
@@ -101,7 +109,7 @@
* AspectJ Extension - support for MethodBinding.alwaysNeedsAccessMethod
* Possible mergeconflict? Was InvocationSite but now Invocation in implements clause
*/
-public class MessageSend extends Expression implements Invocation {
+public class MessageSend extends Expression implements IPolyExpression, Invocation {
public Expression receiver;
public char[] selector;
@@ -120,7 +128,14 @@
// hold on to this context from invocation applicability inference until invocation type inference (per method candidate):
private SimpleLookupTable/*<PGMB,InferenceContext18>*/ inferenceContexts;
- protected InnerInferenceHelper innerInferenceHelper;
+ private HashMap<TypeBinding, MethodBinding> solutionsPerTargetType;
+ private InferenceContext18 outerInferenceContext; // resolving within the context of an outer (lambda) inference?
+
+ private boolean receiverIsType;
+ protected boolean argsContainCast;
+ public TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
+ public boolean argumentsHaveErrors = false;
+
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
boolean nonStatic = !this.binding.isStatic();
@@ -454,7 +469,7 @@
// AspectJ accessors. For example: ajc$privMethod for accessing private
// methods on types from a privileged aspect.
if (syntheticAccessor.isStatic()) {
- codeStream.invoke(Opcodes.OPC_invokestatic, this.syntheticAccessor, null /* default declaringClass */, this.typeArguments);
+ codeStream.invoke(Opcodes.OPC_invokestatic, this.syntheticAccessor, null /* default declaringClass */, this.typeArguments);
} else {
codeStream.invoke(Opcodes.OPC_invokevirtual, this.syntheticAccessor, null /* default declaringClass */, this.typeArguments);
}
@@ -556,6 +571,8 @@
}
}
public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) {
+ if ((this.implicitConversion & TypeIds.BOXING) != 0)
+ return FlowInfo.NON_NULL;
if (this.binding.isValidBinding()) {
// try to retrieve null status of this message send from an annotation of the called method:
long tagBits = this.binding.tagBits;
@@ -630,12 +647,12 @@
}
public TypeBinding resolveType(BlockScope scope) {
- // Answer the signature return type
+ // Answer the signature return type, answers PolyTypeBinding if a poly expression and there is no target type
// Base type promotion
-
+ if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
long sourceLevel = scope.compilerOptions().sourceLevel;
- boolean receiverCast = false, argsContainCast = false;
+ boolean receiverCast = false;
if (this.receiver instanceof CastExpression) {
this.receiver.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
receiverCast = true;
@@ -646,7 +663,7 @@
// scope.problemReporter().genericInferenceError("Receiver was unexpectedly found resolved", this); //$NON-NLS-1$
// AspectJ Extension: End
this.actualReceiverType = this.receiver.resolveType(scope);
- boolean receiverIsType = this.receiver instanceof NameReference && (((NameReference) this.receiver).bits & Binding.TYPE) != 0;
+ this.receiverIsType = this.receiver instanceof NameReference && (((NameReference) this.receiver).bits & Binding.TYPE) != 0;
if (receiverCast && this.actualReceiverType != null) {
// due to change of declaring class with receiver type, only identity cast should be notified
if (TypeBinding.equalsEquals(((CastExpression)this.receiver).expression.resolvedType, this.actualReceiverType)) {
@@ -656,18 +673,18 @@
// resolve type arguments (for generic constructor call)
if (this.typeArguments != null) {
int length = this.typeArguments.length;
- boolean argHasError = sourceLevel < ClassFileConstants.JDK1_5; // typeChecks all arguments
+ this.argumentsHaveErrors = sourceLevel < ClassFileConstants.JDK1_5; // typeChecks all arguments
this.genericTypeArguments = new TypeBinding[length];
for (int i = 0; i < length; i++) {
TypeReference typeReference = this.typeArguments[i];
if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
- argHasError = true;
+ this.argumentsHaveErrors = true;
}
- if (argHasError && typeReference instanceof Wildcard) {
+ if (this.argumentsHaveErrors && typeReference instanceof Wildcard) {
scope.problemReporter().illegalUsageOfWildcard(typeReference);
}
}
- if (argHasError) {
+ if (this.argumentsHaveErrors) {
if (this.arguments != null) { // still attempt to resolve arguments
for (int i = 0, max = this.arguments.length; i < max; i++) {
this.arguments[i].resolveType(scope);
@@ -677,41 +694,34 @@
}
}
// will check for null after args are resolved
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
if (this.arguments != null) {
- boolean argHasError = false; // typeChecks all arguments
+ this.argumentsHaveErrors = false; // typeChecks all arguments
int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
+ this.argumentTypes = new TypeBinding[length];
for (int i = 0; i < length; i++){
Expression argument = this.arguments[i];
if (this.arguments[i].resolvedType != null)
scope.problemReporter().genericInferenceError("Argument was unexpectedly found resolved", this); //$NON-NLS-1$
if (argument instanceof CastExpression) {
argument.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
- argsContainCast = true;
+ this.argsContainCast = true;
}
argument.setExpressionContext(INVOCATION_CONTEXT);
- if ((argumentTypes[i] = argument.resolveType(scope)) == null){
- argHasError = true;
- }
- if (sourceLevel >= ClassFileConstants.JDK1_8) {
- if (argument.isPolyExpression()
- || (argument instanceof Invocation && ((Invocation)argument).usesInference())) {
- if (this.innerInferenceHelper == null)
- this.innerInferenceHelper = new InnerInferenceHelper();
- }
+ if ((this.argumentTypes[i] = argument.resolveType(scope)) == null){
+ this.argumentsHaveErrors = true;
}
}
- if (argHasError) {
+ if (this.argumentsHaveErrors) {
if (this.actualReceiverType instanceof ReferenceBinding) {
// record a best guess, for clients who need hint about possible method match
TypeBinding[] pseudoArgs = new TypeBinding[length];
for (int i = length; --i >= 0;)
- pseudoArgs[i] = argumentTypes[i] == null ? TypeBinding.NULL : argumentTypes[i]; // replace args with errors with null type
- this.binding =
- this.receiver.isImplicitThis()
- ? scope.getImplicitMethod(this.selector, pseudoArgs, this)
- : scope.findMethod((ReferenceBinding) this.actualReceiverType, this.selector, pseudoArgs, this, false);
+ pseudoArgs[i] = this.argumentTypes[i] == null ? TypeBinding.NULL : this.argumentTypes[i]; // replace args with errors with null type
+
+ this.binding = this.receiver.isImplicitThis() ?
+ scope.getImplicitMethod(this.selector, pseudoArgs, this) :
+ scope.findMethod((ReferenceBinding) this.actualReceiverType, this.selector, pseudoArgs, this, false);
+
if (this.binding != null && !this.binding.isValidBinding()) {
MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch;
// record the closest match, for clients who may still need hint about possible method match
@@ -737,9 +747,10 @@
}
// base type cannot receive any message
if (this.actualReceiverType.isBaseType()) {
- scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes);
+ scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, this.argumentTypes);
return null;
}
+ }
// AspectJ Extension
// MERGECONFLICT - very different to how it used to be, what is that findMethodBinding() call?
// this.binding = this.receiver.isImplicitThis()
@@ -748,14 +759,18 @@
// resolveMethodBinding(scope, argumentTypes); // AspectJ Extension - moved to helper method
// End AspectJ Extension
- findMethodBinding(scope, argumentTypes);
+ TypeBinding methodType = findMethodBinding(scope);
+ if (methodType != null && methodType.isPolyType()) {
+ this.resolvedType = this.binding.returnType.capture(scope, this.sourceStart, this.sourceEnd);
+ return methodType;
+ }
if (!this.binding.isValidBinding()) {
if (this.binding.declaringClass == null) {
if (this.actualReceiverType instanceof ReferenceBinding) {
this.binding.declaringClass = (ReferenceBinding) this.actualReceiverType;
} else {
- scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes);
+ scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, this.argumentTypes);
return null;
}
}
@@ -766,11 +781,17 @@
declaringClass.isAnonymousType() &&
declaringClass.superclass() instanceof MissingTypeBinding;
if (!avoidSecondary)
- scope.problemReporter().invalidMethod(this, this.binding);
+ scope.problemReporter().invalidMethod(this, this.binding, scope);
MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch;
switch (this.binding.problemId()) {
case ProblemReasons.Ambiguous :
break; // no resilience on ambiguous
+ case ProblemReasons.InferredApplicableMethodInapplicable:
+ case ProblemReasons.InvocationTypeInferenceFailure:
+ // Grabbing the closest match improves error reporting in nested invocation contexts
+ if (this.expressionContext != INVOCATION_CONTEXT)
+ break;
+ //$FALL-THROUGH$
case ProblemReasons.NotVisible :
case ProblemReasons.NonStaticReferenceInConstructorInvocation :
case ProblemReasons.NonStaticReferenceInStaticContext :
@@ -779,6 +800,10 @@
// only steal returnType in cases listed above
if (closestMatch != null) this.resolvedType = closestMatch.returnType;
break;
+ case ProblemReasons.ContradictoryNullAnnotations :
+ if (closestMatch != null && closestMatch.returnType != null)
+ this.resolvedType = closestMatch.returnType.withoutToplevelNullAnnotation();
+ break;
}
// record the closest match, for clients who may still need hint about possible method match
if (closestMatch != null) {
@@ -825,7 +850,7 @@
}
if (!this.binding.isStatic()) {
// the "receiver" must not be a type
- if (receiverIsType) {
+ if (this.receiverIsType) {
scope.problemReporter().mustUseAStaticMethod(this, this.binding);
if (this.actualReceiverType.isRawType()
&& (this.receiver.bits & ASTNode.IgnoreRawTypeCheck) == 0
@@ -844,14 +869,14 @@
}
} else {
// static message invoked through receiver? legal but unoptimal (optional warning).
- if (!(this.receiver.isImplicitThis() || this.receiver.isSuper() || receiverIsType)) {
+ if (!(this.receiver.isImplicitThis() || this.receiver.isSuper() || this.receiverIsType)) {
scope.problemReporter().nonStaticAccessToStaticMethod(this, this.binding);
}
if (!this.receiver.isImplicitThis() && TypeBinding.notEquals(this.binding.declaringClass, this.actualReceiverType)) {
scope.problemReporter().indirectAccessToStaticMethod(this, this.binding);
}
}
- if (checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this)) {
+ if (checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, this.argumentTypes, this.argsContainCast, this)) {
this.bits |= ASTNode.Unchecked;
}
@@ -879,7 +904,7 @@
} else {
returnType = this.binding.returnType;
if (returnType != null) {
- returnType = returnType.capture(scope, this.sourceEnd);
+ returnType = returnType.capture(scope, this.sourceStart, this.sourceEnd);
}
}
this.resolvedType = returnType;
@@ -898,88 +923,37 @@
}
if (this.receiver.isSuper() && this.actualReceiverType.isInterface()) {
// 15.12.3 (Java 8)
- scope.checkAppropriateMethodAgainstSupers(this.selector, this.binding, argumentTypes, this);
+ scope.checkAppropriateMethodAgainstSupers(this.selector, this.binding, this.argumentTypes, this);
}
if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments);
}
- recordExceptionsForEnclosingLambda(scope, this.binding.thrownExceptions);
return (this.resolvedType.tagBits & TagBits.HasMissingType) == 0
? this.resolvedType
: null;
}
-/**
- * Find the method binding;
- * if this.innersNeedUpdate allow for two attempts where the first round may stop
- * after applicability checking (18.5.1) to include more information into the final
- * invocation type inference (18.5.2).
- */
-protected void findMethodBinding(BlockScope scope, TypeBinding[] argumentTypes) {
- resolveMethodBinding(scope, argumentTypes);
-// this.binding = this.receiver.isImplicitThis()
-// ? scope.getImplicitMethod(this.selector, argumentTypes, this)
-// : scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this);
- resolvePolyExpressionArguments(this, this.binding, argumentTypes, scope);
- /* There are embedded assumptions in the JLS8 type inference scheme that a successful solution of the type equations results in an
- applicable method. This appears to be a tenuous assumption, at least one not made by the JLS7 engine or the reference compiler and
- there are cases where this assumption would appear invalid: See https://bugs.eclipse.org/bugs/show_bug.cgi?id=426537, where we allow
- certain compatibility constrains around raw types to be violated.
-
- Here, we filter out such inapplicable methods with raw type usage that may have sneaked past overload resolution and type inference,
- playing the devils advocate, blaming the invocations with raw arguments that should not go blameless. At this time this is in the
- nature of a point fix and is not a general solution which needs to come later (that also includes AE, QAE and ECC)
- */
- final CompilerOptions compilerOptions = scope.compilerOptions();
- if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8 && this.binding instanceof ParameterizedGenericMethodBinding && this.binding.isValidBinding()) {
- if (!compilerOptions.postResolutionRawTypeCompatibilityCheck)
- return;
- ParameterizedGenericMethodBinding pgmb = (ParameterizedGenericMethodBinding) this.binding;
- InferenceContext18 ctx = getInferenceContext(pgmb);
- if (ctx == null || ctx.stepCompleted < InferenceContext18.BINDINGS_UPDATED)
- return;
- int length = pgmb.typeArguments == null ? 0 : pgmb.typeArguments.length;
- boolean sawRawType = false;
- for (int i = 0; i < length; i++) {
- /* Must check compatibility against capture free method. Formal parameters cannot have captures, but our machinery is not up to snuff to
- construct a PGMB without captures at the moment - for one thing ITCB does not support uncapture() yet, for another, INTERSECTION_CAST_TYPE
- does not appear fully hooked up into isCompatibleWith and isEquivalent to everywhere. At the moment, bail out if we see capture.
- */
- if (pgmb.typeArguments[i].isCapture())
- return;
- if (pgmb.typeArguments[i].isRawType())
- sawRawType = true;
- }
- if (!sawRawType)
- return;
- length = this.arguments == null ? 0 : this.arguments.length;
- if (length == 0)
- return;
- TypeBinding [] finalArgumentTypes = new TypeBinding[length];
- for (int i = 0; i < length; i++) {
- TypeBinding finalArgumentType = this.arguments[i].resolvedType;
- if (finalArgumentType == null || !finalArgumentType.isValidBinding()) // already sided with the devil.
- return;
- finalArgumentTypes[i] = finalArgumentType;
- }
- if (scope.parameterCompatibilityLevel(this.binding, finalArgumentTypes, false) == Scope.NOT_COMPATIBLE)
- this.binding = new ProblemMethodBinding(this.binding.original(), this.binding.selector, finalArgumentTypes, ProblemReasons.NotFound);
- }
+protected TypeBinding findMethodBinding(BlockScope scope) {
+ ReferenceContext referenceContext = scope.methodScope().referenceContext;
+ if (referenceContext instanceof LambdaExpression) {
+ this.outerInferenceContext = ((LambdaExpression) referenceContext).inferenceContext;
}
-@Override
-public TypeBinding checkAgainstFinalTargetType(TypeBinding targetType, Scope scope) {
- if (this.binding instanceof ParameterizedGenericMethodBinding) {
- InferenceContext18 ctx = getInferenceContext((ParameterizedMethodBinding) this.binding);
- if (ctx != null && ctx.stepCompleted < InferenceContext18.TYPE_INFERRED) {
- this.expectedType = targetType;
- MethodBinding updatedBinding = ctx.inferInvocationType(this, (ParameterizedGenericMethodBinding) this.binding);
- if (updateBindings(updatedBinding, targetType)) {
- ASTNode.resolvePolyExpressionArguments(this, updatedBinding, scope);
+ if (this.expectedType != null && this.binding instanceof PolyParameterizedGenericMethodBinding) {
+ this.binding = this.solutionsPerTargetType.get(this.expectedType);
}
+ if (this.binding == null) { // first look up or a "cache miss" somehow.
+ this.binding = this.receiver.isImplicitThis() ?
+ scope.getImplicitMethod(this.selector, this.argumentTypes, this)
+ : scope.getMethod(this.actualReceiverType, this.selector, this.argumentTypes, this);
+
+ if (this.binding instanceof PolyParameterizedGenericMethodBinding) {
+ this.solutionsPerTargetType = new HashMap<TypeBinding, MethodBinding>();
+ return new PolyTypeBinding(this);
}
}
- return this.resolvedType;
+ resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
+ return this.binding.returnType;
}
public void setActualReceiverType(ReferenceBinding receiverType) {
@@ -1015,6 +989,52 @@
*/
return isPolyExpression(this.binding);
}
+
+public boolean isBoxingCompatibleWith(TypeBinding targetType, Scope scope) {
+ if (this.argumentsHaveErrors || this.binding == null || !this.binding.isValidBinding() || targetType == null || scope == null)
+ return false;
+ if (isPolyExpression() && !targetType.isPrimitiveOrBoxedPrimitiveType()) // i.e it is dumb to trigger inference, checking boxing compatibility against say Collector<? super T, A, R>.
+ return false;
+ TypeBinding originalExpectedType = this.expectedType;
+ try {
+ MethodBinding method = this.solutionsPerTargetType != null ? this.solutionsPerTargetType.get(targetType) : null;
+ if (method == null) {
+ this.expectedType = targetType;
+ // No need to tunnel through overload resolution. this.binding is the MSMB.
+ method = isPolyExpression() ? ParameterizedGenericMethodBinding.computeCompatibleMethod18(this.binding.shallowOriginal(), this.argumentTypes, scope, this) : this.binding;
+ registerResult(targetType, method);
+ }
+ if (method == null || !method.isValidBinding() || method.returnType == null || !method.returnType.isValidBinding())
+ return false;
+ return super.isBoxingCompatible(method.returnType.capture(scope, this.sourceStart, this.sourceEnd), targetType, this, scope);
+ } finally {
+ this.expectedType = originalExpectedType;
+ }
+}
+
+public boolean isCompatibleWith(TypeBinding targetType, final Scope scope) {
+ if (this.argumentsHaveErrors || this.binding == null || !this.binding.isValidBinding() || targetType == null || scope == null)
+ return false;
+ TypeBinding originalExpectedType = this.expectedType;
+ try {
+ MethodBinding method = this.solutionsPerTargetType != null ? this.solutionsPerTargetType.get(targetType) : null;
+ if (method == null) {
+ this.expectedType = targetType;
+ // No need to tunnel through overload resolution. this.binding is the MSMB.
+ method = isPolyExpression() ? ParameterizedGenericMethodBinding.computeCompatibleMethod18(this.binding.shallowOriginal(), this.argumentTypes, scope, this) : this.binding;
+ registerResult(targetType, method);
+ }
+ TypeBinding returnType;
+ if (method == null || !method.isValidBinding() || (returnType = method.returnType) == null || !returnType.isValidBinding())
+ return false;
+ if (method == scope.environment().arrayClone)
+ returnType = this.actualReceiverType;
+ return returnType != null && returnType.capture(scope, this.sourceStart, this.sourceEnd).isCompatibleWith(targetType, scope);
+ } finally {
+ this.expectedType = originalExpectedType;
+ }
+}
+
/** Variant of isPolyExpression() to be used during type inference, when a resolution candidate exists. */
public boolean isPolyExpression(MethodBinding resolutionCandidate) {
if (this.expressionContext != ASSIGNMENT_CONTEXT && this.expressionContext != INVOCATION_CONTEXT)
@@ -1072,67 +1092,47 @@
visitor.endVisit(this, blockScope);
}
public boolean statementExpression() {
- return true;
+ return ((this.bits & ASTNode.ParenthesizedMASK) == 0);
}
public boolean receiverIsImplicitThis() {
return this.receiver.isImplicitThis();
}
// -- interface Invocation: --
-public MethodBinding binding(TypeBinding targetType, boolean reportErrors, Scope scope) {
- if (reportErrors) {
- if (this.binding == null)
- scope.problemReporter().genericInferenceError("method is unexpectedly unresolved", this); //$NON-NLS-1$
- else if (!this.binding.isValidBinding())
- scope.problemReporter().invalidMethod(this, this.binding);
- }
+public MethodBinding binding() {
return this.binding;
}
+
+public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 infCtx18) {
+ if (this.inferenceContexts == null)
+ this.inferenceContexts = new SimpleLookupTable();
+ this.inferenceContexts.put(method, infCtx18);
+}
+
+@Override
+public void registerResult(TypeBinding targetType, MethodBinding method) {
+ if (this.solutionsPerTargetType == null)
+ this.solutionsPerTargetType = new HashMap<TypeBinding, MethodBinding>();
+ this.solutionsPerTargetType.put(targetType, method);
+}
+
+public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
+ if (this.inferenceContexts == null)
+ return null;
+ return (InferenceContext18) this.inferenceContexts.get(method);
+}
public Expression[] arguments() {
return this.arguments;
}
public ExpressionContext getExpressionContext() {
return this.expressionContext;
}
-public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 infCtx18) {
- if (this.inferenceContexts == null)
- this.inferenceContexts = new SimpleLookupTable();
- this.inferenceContexts.put(method, infCtx18);
-}
-public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
- if (this.inferenceContexts == null)
- return null;
- return (InferenceContext18) this.inferenceContexts.get(method);
-}
-public boolean usesInference() {
- return (this.binding instanceof ParameterizedGenericMethodBinding)
- && getInferenceContext((ParameterizedGenericMethodBinding) this.binding) != null;
-}
-public boolean updateBindings(MethodBinding updatedBinding, TypeBinding targetType) {
- boolean hasUpdate = this.binding != updatedBinding;
- if (this.inferenceContexts != null) {
- InferenceContext18 ctx = (InferenceContext18)this.inferenceContexts.removeKey(this.binding);
- if (ctx != null && updatedBinding instanceof ParameterizedGenericMethodBinding) {
- this.inferenceContexts.put(updatedBinding, ctx);
- // solution may have come from an outer inference, mark now that this (inner) is done (but not deep inners):
- hasUpdate |= ctx.registerSolution(targetType, updatedBinding);
- }
- }
- this.binding = updatedBinding;
- this.resolvedType = updatedBinding.returnType;
- return hasUpdate;
-}
-public boolean innersNeedUpdate() {
- return this.innerInferenceHelper != null;
-}
-public void innerUpdateDone() {
- this.innerInferenceHelper = null;
-}
-public InnerInferenceHelper innerInferenceHelper() {
- return this.innerInferenceHelper;
-}
// -- Interface InvocationSite: --
public InferenceContext18 freshInferenceContext(Scope scope) {
- return new InferenceContext18(scope, this.arguments, this);
+ return new InferenceContext18(scope, this.arguments, this, this.outerInferenceContext);
+}
+@Override
+public boolean isQualifiedSuper() {
+ return this.receiver.isQualifiedSuper();
}
// AspectJ Extension
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
index 1038e73..883c5df 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,8 @@
* Bug 392238 - [1.8][compiler][null] Detect semantically invalid null type annotations
* Bug 416176 - [1.8][compiler][null] null type annotations cause grief on type variables
* Bug 438012 - [1.8][null] Bogus Warning: The nullness annotation is redundant with a default that applies to this location
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* bug 378674 - "The method can be declared as static" is wrong
*******************************************************************************/
@@ -46,6 +48,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortMethod;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
public class MethodDeclaration extends AbstractMethodDeclaration {
@@ -106,10 +109,10 @@
FlowInfo.DEAD_END);
// nullity and mark as assigned
- if (classScope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8)
- analyseArguments(flowInfo, this.arguments, this.binding);
- else
+ if (classScope.environment().usesNullTypeAnnotations())
analyseArguments18(flowInfo, this.arguments, this.binding);
+ else
+ analyseArguments(flowInfo, this.arguments, this.binding);
if (this.binding.declaringClass instanceof MemberTypeBinding && !this.binding.declaringClass.isStatic()) {
// method of a non-static member type can't be static.
@@ -172,10 +175,10 @@
}
}
- public boolean hasNullTypeAnnotation() {
+ public boolean hasNullTypeAnnotation(AnnotationPosition position) {
// parser associates SE8 annotations to the declaration
return TypeReference.containsNullAnnotation(this.annotations) ||
- (this.returnType != null && this.returnType.hasNullTypeAnnotation()); // just in case
+ (this.returnType != null && this.returnType.hasNullTypeAnnotation(position)); // just in case
}
public boolean isDefaultMethod() {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java
index ff95f88..a41ee0e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/NullAnnotationMatching.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG and others.
+ * Copyright (c) 2013, 2015 GK Software AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,15 +10,16 @@
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CaptureBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
@@ -72,35 +73,36 @@
public boolean isUnchecked() { return this.severity == 1; }
public boolean isDefiniteMismatch() { return this.severity == 2; }
+ public boolean isPotentiallyNullMismatch() {
+ return !isDefiniteMismatch() && this.nullStatus != -1 && (this.nullStatus & FlowInfo.POTENTIALLY_NULL) != 0;
+ }
+
public String superTypeHintName(CompilerOptions options, boolean shortNames) {
return String.valueOf(this.superTypeHint.nullAnnotatedReadableName(options, shortNames));
}
/** Check null-ness of 'var' against a possible null annotation */
public static int checkAssignment(BlockScope currentScope, FlowContext flowContext,
- VariableBinding var, int nullStatus, Expression expression, TypeBinding providedType)
+ VariableBinding var, FlowInfo flowInfo, int nullStatus, Expression expression, TypeBinding providedType)
{
long lhsTagBits = 0L;
boolean hasReported = false;
- if (currentScope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8) {
+ if (!currentScope.environment().usesNullTypeAnnotations()) {
lhsTagBits = var.tagBits & TagBits.AnnotationNullMASK;
} else {
if (expression instanceof ConditionalExpression && expression.isPolyExpression()) {
// drill into both branches:
ConditionalExpression ce = ((ConditionalExpression) expression);
- int status1 = NullAnnotationMatching.checkAssignment(currentScope, flowContext, var, ce.ifTrueNullStatus, ce.valueIfTrue, ce.valueIfTrue.resolvedType);
- int status2 = NullAnnotationMatching.checkAssignment(currentScope, flowContext, var, ce.ifFalseNullStatus, ce.valueIfFalse, ce.valueIfFalse.resolvedType);
+ int status1 = NullAnnotationMatching.checkAssignment(currentScope, flowContext, var, flowInfo, ce.ifTrueNullStatus, ce.valueIfTrue, ce.valueIfTrue.resolvedType);
+ int status2 = NullAnnotationMatching.checkAssignment(currentScope, flowContext, var, flowInfo, ce.ifFalseNullStatus, ce.valueIfFalse, ce.valueIfFalse.resolvedType);
if (status1 == status2)
return status1;
return nullStatus; // if both branches disagree use the precomputed & merged nullStatus
}
lhsTagBits = var.type.tagBits & TagBits.AnnotationNullMASK;
NullAnnotationMatching annotationStatus = analyse(var.type, providedType, nullStatus);
- if (annotationStatus.isDefiniteMismatch()) {
- currentScope.problemReporter().nullityMismatchingTypeAnnotation(expression, providedType, var.type, annotationStatus);
- hasReported = true;
- } else if (annotationStatus.isUnchecked()) {
- flowContext.recordNullityMismatch(currentScope, expression, providedType, var.type, nullStatus);
+ if (annotationStatus.isAnyMismatch()) {
+ flowContext.recordNullityMismatch(currentScope, expression, providedType, var.type, flowInfo, nullStatus, annotationStatus);
hasReported = true;
} else if (annotationStatus.nullStatus != FlowInfo.UNKNOWN) {
return annotationStatus.nullStatus;
@@ -108,7 +110,7 @@
}
if (lhsTagBits == TagBits.AnnotationNonNull && nullStatus != FlowInfo.NON_NULL) {
if (!hasReported)
- flowContext.recordNullityMismatch(currentScope, expression, providedType, var.type, nullStatus);
+ flowContext.recordNullityMismatch(currentScope, expression, providedType, var.type, flowInfo, nullStatus, null);
return FlowInfo.NON_NULL;
} else if (lhsTagBits == TagBits.AnnotationNullable && nullStatus == FlowInfo.UNKNOWN) { // provided a legacy type?
return FlowInfo.POTENTIALLY_NULL; // -> use more specific info from the annotation
@@ -137,9 +139,9 @@
* @return a status object representing the severity of mismatching plus optionally a supertype hint
*/
public static NullAnnotationMatching analyse(TypeBinding requiredType, TypeBinding providedType, TypeBinding providedSubstitute, int nullStatus, CheckMode mode) {
+ if (!requiredType.enterRecursiveFunction())
+ return NullAnnotationMatching.NULL_ANNOTATIONS_OK;
try {
- if (!requiredType.enterRecursiveFunction())
- return NullAnnotationMatching.NULL_ANNOTATIONS_OK;
int severity = 0;
TypeBinding superTypeHint = null;
NullAnnotationMatching okStatus = NullAnnotationMatching.NULL_ANNOTATIONS_OK;
@@ -177,14 +179,17 @@
long[] providedDimsTagBits = ((ArrayBinding)providedType).nullTagBitsPerDimension;
if (providedDimsTagBits == null)
providedDimsTagBits = new long[dims+1]; // set to unspec'd at all dimensions
+ int currentNullStatus = nullStatus;
for (int i=0; i<=dims; i++) {
long requiredBits = validNullTagBits(requiredDimsTagBits[i]);
long providedBits = validNullTagBits(providedDimsTagBits[i]);
if (i > 0)
- nullStatus = -1; // don't use beyond the outermost dimension
- severity = Math.max(severity, computeNullProblemSeverity(requiredBits, providedBits, nullStatus, mode == CheckMode.OVERRIDE && nullStatus == -1));
+ currentNullStatus = -1; // don't use beyond the outermost dimension
+ severity = Math.max(severity, computeNullProblemSeverity(requiredBits, providedBits, currentNullStatus, mode == CheckMode.OVERRIDE && nullStatus == -1));
if (severity == 2)
return NullAnnotationMatching.NULL_ANNOTATIONS_MISMATCH;
+ if (severity == 0)
+ nullStatus = -1;
}
} else if (providedType.id == TypeIds.T_null) {
if (dims > 0 && requiredDimsTagBits[0] == TagBits.AnnotationNonNull)
@@ -204,12 +209,13 @@
}
if (severity < 2) {
TypeBinding providedSuper = providedType.findSuperTypeOriginatingFrom(requiredType);
+ TypeBinding providedSubstituteSuper = providedSubstitute != null ? providedSubstitute.findSuperTypeOriginatingFrom(requiredType) : null;
if (providedSuper != providedType) //$IDENTITY-COMPARISON$
superTypeHint = providedSuper;
if (requiredType.isParameterizedType() && providedSuper instanceof ParameterizedTypeBinding) { // TODO(stephan): handle providedType.isRaw()
TypeBinding[] requiredArguments = ((ParameterizedTypeBinding) requiredType).arguments;
TypeBinding[] providedArguments = ((ParameterizedTypeBinding) providedSuper).arguments;
- TypeBinding[] providedSubstitutes = (providedSubstitute instanceof ParameterizedTypeBinding) ? ((ParameterizedTypeBinding)providedSubstitute).arguments : null;
+ TypeBinding[] providedSubstitutes = (providedSubstituteSuper instanceof ParameterizedTypeBinding) ? ((ParameterizedTypeBinding)providedSubstituteSuper).arguments : null;
if (requiredArguments != null && providedArguments != null && requiredArguments.length == providedArguments.length) {
for (int i = 0; i < requiredArguments.length; i++) {
TypeBinding providedArgSubstitute = providedSubstitutes != null ? providedSubstitutes[i] : null;
@@ -415,46 +421,87 @@
return 0; // OK by tagBits
}
+ static class SearchContradictions extends TypeBindingVisitor {
+ ReferenceBinding typeWithContradiction;
+ @Override
+ public boolean visit(ReferenceBinding referenceBinding) {
+ if ((referenceBinding.tagBits & TagBits.AnnotationNullMASK) == TagBits.AnnotationNullMASK) {
+ this.typeWithContradiction = referenceBinding;
+ return false;
+ }
+ return true;
+ }
+ @Override
+ public boolean visit(TypeVariableBinding typeVariable) {
+ if (!visit((ReferenceBinding)typeVariable))
+ return false;
+ long allNullBits = typeVariable.tagBits & TagBits.AnnotationNullMASK;
+ if (typeVariable.firstBound != null)
+ allNullBits = typeVariable.firstBound.tagBits & TagBits.AnnotationNullMASK;
+ for (TypeBinding otherBound : typeVariable.otherUpperBounds())
+ allNullBits |= otherBound.tagBits & TagBits.AnnotationNullMASK;
+ if (allNullBits == TagBits.AnnotationNullMASK) {
+ this.typeWithContradiction = typeVariable;
+ return false;
+ }
+ return true;
+ }
+ @Override
+ public boolean visit(RawTypeBinding rawType) {
+ return visit((ReferenceBinding)rawType);
+ }
+ @Override
+ public boolean visit(WildcardBinding wildcardBinding) {
+ long allNullBits = wildcardBinding.tagBits & TagBits.AnnotationNullMASK;
+ switch (wildcardBinding.boundKind) {
+ case Wildcard.EXTENDS:
+ allNullBits |= wildcardBinding.bound.tagBits & TagBits.AnnotationNonNull;
+ break;
+ case Wildcard.SUPER:
+ allNullBits |= wildcardBinding.bound.tagBits & TagBits.AnnotationNullable;
+ break;
+ }
+ if (allNullBits == TagBits.AnnotationNullMASK) {
+ this.typeWithContradiction = wildcardBinding;
+ return false;
+ }
+ return true;
+ }
+ @Override
+ public boolean visit(ParameterizedTypeBinding parameterizedTypeBinding) {
+ if (!visit((ReferenceBinding) parameterizedTypeBinding))
+ return false;
+ return super.visit(parameterizedTypeBinding);
+ }
+ }
+
/**
* After a method has substituted type parameters, check if this resulted in any contradictory null annotations.
* Problems are either reported directly (if scope != null) or by returning a ProblemMethodBinding.
*/
- public static MethodBinding checkForContraditions(
- final MethodBinding method, final InvocationSite invocationSite, final Scope scope) {
-
- class SearchContradictions extends TypeBindingVisitor {
- ReferenceBinding typeWithContradiction;
- @Override
- public boolean visit(ReferenceBinding referenceBinding) {
- if ((referenceBinding.tagBits & TagBits.AnnotationNullMASK) == TagBits.AnnotationNullMASK) {
- this.typeWithContradiction = referenceBinding;
- return false;
- }
- return true;
- }
- @Override
- public boolean visit(TypeVariableBinding typeVariable) {
- return visit((ReferenceBinding)typeVariable);
- }
- @Override
- public boolean visit(RawTypeBinding rawType) {
- return visit((ReferenceBinding)rawType);
- }
- }
+ public static MethodBinding checkForContradictions(MethodBinding method, Object location, Scope scope) {
+ int start = 0, end = 0;
+ if (location instanceof InvocationSite) {
+ start = ((InvocationSite) location).sourceStart();
+ end = ((InvocationSite) location).sourceEnd();
+ } else if (location instanceof ASTNode) {
+ start = ((ASTNode) location).sourceStart;
+ end = ((ASTNode) location).sourceEnd;
+ }
SearchContradictions searchContradiction = new SearchContradictions();
TypeBindingVisitor.visit(searchContradiction, method.returnType);
if (searchContradiction.typeWithContradiction != null) {
if (scope == null)
return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ContradictoryNullAnnotations);
- scope.problemReporter().contradictoryNullAnnotationsInferred(method, invocationSite);
+ scope.problemReporter().contradictoryNullAnnotationsInferred(method, start, end, location instanceof FunctionalExpression);
// note: if needed, we might want to update the method by removing the contradictory annotations??
return method;
}
Expression[] arguments = null;
- if (invocationSite instanceof Invocation)
- arguments = ((Invocation)invocationSite).arguments();
+ if (location instanceof Invocation)
+ arguments = ((Invocation)location).arguments();
for (int i = 0; i < method.parameters.length; i++) {
TypeBindingVisitor.visit(searchContradiction, method.parameters[i]);
if (searchContradiction.typeWithContradiction != null) {
@@ -463,10 +510,59 @@
if (arguments != null && i < arguments.length)
scope.problemReporter().contradictoryNullAnnotationsInferred(method, arguments[i]);
else
- scope.problemReporter().contradictoryNullAnnotationsInferred(method, invocationSite);
+ scope.problemReporter().contradictoryNullAnnotationsInferred(method, start, end, location instanceof FunctionalExpression);
return method;
}
}
return method;
}
+
+ public static boolean hasContradictions(TypeBinding type) {
+ SearchContradictions searchContradiction = new SearchContradictions();
+ TypeBindingVisitor.visit(searchContradiction, type);
+ return searchContradiction.typeWithContradiction != null;
+ }
+
+ public static TypeBinding strongerType(TypeBinding type1, TypeBinding type2, LookupEnvironment environment) {
+ if ((type1.tagBits & TagBits.AnnotationNonNull) != 0)
+ return mergeTypeAnnotations(type1, type2, true, environment);
+ return mergeTypeAnnotations(type2, type1, true, environment); // don't bother to distinguish unannotated vs. @Nullable, since both can accept null
+ }
+
+ public static TypeBinding[] weakerTypes(TypeBinding[] parameters1, TypeBinding[] parameters2, LookupEnvironment environment) {
+ TypeBinding[] newParameters = new TypeBinding[parameters1.length];
+ for (int i = 0; i < newParameters.length; i++) {
+ long tagBits1 = parameters1[i].tagBits;
+ long tagBits2 = parameters2[i].tagBits;
+ if ((tagBits1 & TagBits.AnnotationNullable) != 0)
+ newParameters[i] = mergeTypeAnnotations(parameters1[i], parameters2[i], true, environment); // @Nullable must be preserved
+ else if ((tagBits2 & TagBits.AnnotationNullable) != 0)
+ newParameters[i] = mergeTypeAnnotations(parameters2[i], parameters1[i], true, environment); // @Nullable must be preserved
+ else if ((tagBits1 & TagBits.AnnotationNonNull) == 0)
+ newParameters[i] = mergeTypeAnnotations(parameters1[i], parameters2[i], true, environment); // unannotated must be preserved
+ else
+ newParameters[i] = mergeTypeAnnotations(parameters2[i], parameters1[i], true, environment); // either unannotated, or both are @NonNull
+ }
+ return newParameters;
+ }
+ private static TypeBinding mergeTypeAnnotations(TypeBinding type, TypeBinding otherType, boolean top, LookupEnvironment environment) {
+ TypeBinding mainType = type;
+ if (!top) {
+ // for all but the top level type superimpose other's type annotation onto type
+ AnnotationBinding[] otherAnnotations = otherType.getTypeAnnotations();
+ if (otherAnnotations != Binding.NO_ANNOTATIONS)
+ mainType = environment.createAnnotatedType(type, otherAnnotations);
+ }
+ if (mainType.isParameterizedType() && otherType.isParameterizedType()) {
+ ParameterizedTypeBinding ptb = (ParameterizedTypeBinding) type, otherPTB = (ParameterizedTypeBinding) otherType;
+ TypeBinding[] typeArguments = ptb.arguments;
+ TypeBinding[] otherTypeArguments = otherPTB.arguments;
+ TypeBinding[] newTypeArguments = new TypeBinding[typeArguments.length];
+ for (int i = 0; i < typeArguments.length; i++) {
+ newTypeArguments[i] = mergeTypeAnnotations(typeArguments[i], otherTypeArguments[i], false, environment);
+ }
+ return environment.createParameterizedType(ptb.genericType(), newTypeArguments, ptb.enclosingType());
+ }
+ return mainType;
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
index a12edf9..978c31b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 434600 - Incorrect null analysis error reporting on type parameters
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
+ * Bug 456508 - Unexpected RHS PolyTypeBinding for: <code-snippet>
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Andy Clement - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
*******************************************************************************/
@@ -100,20 +102,24 @@
}
@Override
- public boolean hasNullTypeAnnotation() {
- if (super.hasNullTypeAnnotation())
- return true;
- if (this.resolvedType != null && !this.resolvedType.hasNullTypeAnnotations())
- return false; // shortcut
- if (this.typeArguments != null) {
- for (int i = 0; i < this.typeArguments.length; i++) {
- TypeReference[] arguments = this.typeArguments[i];
- for (int j = 0; j < arguments.length; j++) {
- if (arguments[i].hasNullTypeAnnotation())
- return true;
+ public boolean hasNullTypeAnnotation(AnnotationPosition position) {
+ if (super.hasNullTypeAnnotation(position))
+ return true;
+ if (position == AnnotationPosition.ANY) {
+ if (this.resolvedType != null && !this.resolvedType.hasNullTypeAnnotations())
+ return false; // shortcut
+ if (this.typeArguments != null) {
+ for (int i = 0; i < this.typeArguments.length; i++) {
+ TypeReference[] arguments = this.typeArguments[i];
+ if (arguments != null) {
+ for (int j = 0; j < arguments.length; j++) {
+ if (arguments[j].hasNullTypeAnnotation(position))
+ return true;
+ }
+ }
}
- }
- }
+ }
+ }
return false;
}
@@ -334,6 +340,8 @@
parameterizedType.boundCheck(scope, args);
else
scope.deferBoundCheck(this);
+ } else {
+ parameterizedType.arguments = ParameterizedSingleTypeReference.DIAMOND_TYPE_ARGUMENTS;
}
qualifyingType = parameterizedType;
} else {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
index fdb2ffb..5166e0d 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 434600 - Incorrect null analysis error reporting on type parameters
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
+ * Bug 456508 - Unexpected RHS PolyTypeBinding for: <code-snippet>
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Andy Clement - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
*******************************************************************************/
@@ -32,6 +34,8 @@
*/
public class ParameterizedSingleTypeReference extends ArrayTypeReference {
+ public static final TypeBinding[] DIAMOND_TYPE_ARGUMENTS = new TypeBinding[0];
+
public TypeReference[] typeArguments;
public ParameterizedSingleTypeReference(char[] name, TypeReference[] typeArguments, int dim, long pos){
@@ -121,17 +125,19 @@
}
@Override
- public boolean hasNullTypeAnnotation() {
- if (super.hasNullTypeAnnotation())
- return true;
- if (this.resolvedType != null && !this.resolvedType.hasNullTypeAnnotations())
- return false; // shortcut
- if (this.typeArguments != null) {
- for (int i = 0; i < this.typeArguments.length; i++) {
- if (this.typeArguments[i].hasNullTypeAnnotation())
- return true;
- }
- }
+ public boolean hasNullTypeAnnotation(AnnotationPosition position) {
+ if (super.hasNullTypeAnnotation(position))
+ return true;
+ if (position == AnnotationPosition.ANY) {
+ if (this.resolvedType != null && !this.resolvedType.hasNullTypeAnnotations())
+ return false; // shortcut
+ if (this.typeArguments != null) {
+ for (int i = 0; i < this.typeArguments.length; i++) {
+ if (this.typeArguments[i].hasNullTypeAnnotation(position))
+ return true;
+ }
+ }
+ }
return false;
}
@@ -309,6 +315,8 @@
parameterizedType.boundCheck(scope, this.typeArguments);
else
scope.deferBoundCheck(this);
+ } else {
+ parameterizedType.arguments = DIAMOND_TYPE_ARGUMENTS;
}
if (isTypeUseDeprecated(parameterizedType, scope))
reportDeprecatedType(parameterizedType, scope);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
index 6ad6c2a..290e6ba 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
@@ -50,7 +50,9 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ImplicitNullAnnotationVerifier;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
@@ -60,6 +62,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
/**
* Variation on allocation, where can optionally be specified any of:
@@ -280,12 +283,21 @@
if (this.anonymousType == null && this.enclosingInstance == null) {
return super.resolveType(scope);
}
- TypeBinding result=resolveTypeForQualifiedAllocationExpression(scope);
- if(result != null && this.binding != null) {
+ TypeBinding result = resolveTypeForQualifiedAllocationExpression(scope);
+ if (result != null && !result.isPolyType() && this.binding != null) {
final CompilerOptions compilerOptions = scope.compilerOptions();
- if (compilerOptions.isAnnotationBasedNullAnalysisEnabled && (this.binding.tagBits & TagBits.IsNullnessKnown) == 0) {
- new ImplicitNullAnnotationVerifier(scope.environment(), compilerOptions.inheritNullAnnotations)
- .checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, scope);
+ if (compilerOptions.isAnnotationBasedNullAnalysisEnabled) {
+ if ((this.binding.tagBits & TagBits.IsNullnessKnown) == 0) {
+ new ImplicitNullAnnotationVerifier(scope.environment(), compilerOptions.inheritNullAnnotations)
+ .checkImplicitNullAnnotations(this.binding, null/*srcMethod*/, false, scope);
+ }
+ if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8) {
+ if (this.binding instanceof ParameterizedGenericMethodBinding && this.typeArguments != null) {
+ TypeVariableBinding[] typeVariables = this.binding.original().typeVariables();
+ for (int i = 0; i < this.typeArguments.length; i++)
+ this.typeArguments[i].checkNullConstraints(scope, typeVariables, i);
+ }
+ }
}
}
return result;
@@ -295,292 +307,297 @@
// Propagate the type checking to the arguments, and checks if the constructor is defined.
// ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
// ClassInstanceCreationExpression ::= Name '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
-
- this.constant = Constant.NotAConstant;
+ final boolean isDiamond = this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0;
TypeBinding enclosingInstanceType = null;
- ReferenceBinding enclosingInstanceReference = null;
TypeBinding receiverType = null;
- boolean hasError = false;
- boolean enclosingInstanceContainsCast = false;
- boolean argsContainCast = false;
+ long sourceLevel = scope.compilerOptions().sourceLevel;
+ if (this.constant != Constant.NotAConstant) {
+ this.constant = Constant.NotAConstant;
+ ReferenceBinding enclosingInstanceReference = null;
+ boolean hasError = false;
+ boolean enclosingInstanceContainsCast = false;
- if (this.enclosingInstance != null) {
- if (this.enclosingInstance instanceof CastExpression) {
- this.enclosingInstance.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
- enclosingInstanceContainsCast = true;
- }
- if ((enclosingInstanceType = this.enclosingInstance.resolveType(scope)) == null){
- hasError = true;
- } else if (enclosingInstanceType.isBaseType() || enclosingInstanceType.isArrayType()) {
- scope.problemReporter().illegalPrimitiveOrArrayTypeForEnclosingInstance(
- enclosingInstanceType,
- this.enclosingInstance);
- hasError = true;
- } else if (this.type instanceof QualifiedTypeReference) {
- scope.problemReporter().illegalUsageOfQualifiedTypeReference((QualifiedTypeReference)this.type);
- hasError = true;
- } else if (!(enclosingInstanceReference = (ReferenceBinding) enclosingInstanceType).canBeSeenBy(scope)) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=317212
- enclosingInstanceType = new ProblemReferenceBinding(
+ if (this.enclosingInstance != null) {
+ if (this.enclosingInstance instanceof CastExpression) {
+ this.enclosingInstance.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
+ enclosingInstanceContainsCast = true;
+ }
+ if ((enclosingInstanceType = this.enclosingInstance.resolveType(scope)) == null){
+ hasError = true;
+ } else if (enclosingInstanceType.isBaseType() || enclosingInstanceType.isArrayType()) {
+ scope.problemReporter().illegalPrimitiveOrArrayTypeForEnclosingInstance(
+ enclosingInstanceType,
+ this.enclosingInstance);
+ hasError = true;
+ } else if (this.type instanceof QualifiedTypeReference) {
+ scope.problemReporter().illegalUsageOfQualifiedTypeReference((QualifiedTypeReference)this.type);
+ hasError = true;
+ } else if (!(enclosingInstanceReference = (ReferenceBinding) enclosingInstanceType).canBeSeenBy(scope)) {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=317212
+ enclosingInstanceType = new ProblemReferenceBinding(
enclosingInstanceReference.compoundName,
enclosingInstanceReference,
ProblemReasons.NotVisible);
- scope.problemReporter().invalidType(this.enclosingInstance, enclosingInstanceType);
- hasError = true;
- } else {
- receiverType = ((SingleTypeReference) this.type).resolveTypeEnclosing(scope, (ReferenceBinding) enclosingInstanceType);
- checkIllegalNullAnnotation(scope, receiverType);
- if (receiverType != null && enclosingInstanceContainsCast) {
- CastExpression.checkNeedForEnclosingInstanceCast(scope, this.enclosingInstance, enclosingInstanceType, receiverType);
- }
- }
- } else {
- if (this.type == null) {
- // initialization of an enum constant
- receiverType = scope.enclosingSourceType();
- } else {
- receiverType = this.type.resolveType(scope, true /* check bounds*/);
- checkIllegalNullAnnotation(scope, receiverType);
- checkParameterizedAllocation: {
- if (receiverType == null || !receiverType.isValidBinding()) break checkParameterizedAllocation;
- if (this.type instanceof ParameterizedQualifiedTypeReference) { // disallow new X<String>.Y<Integer>()
- ReferenceBinding currentType = (ReferenceBinding)receiverType;
- do {
- // isStatic() is answering true for toplevel types
- if ((currentType.modifiers & ClassFileConstants.AccStatic) != 0) break checkParameterizedAllocation;
- if (currentType.isRawType()) break checkParameterizedAllocation;
- } while ((currentType = currentType.enclosingType())!= null);
- ParameterizedQualifiedTypeReference qRef = (ParameterizedQualifiedTypeReference) this.type;
- for (int i = qRef.typeArguments.length - 2; i >= 0; i--) {
- if (qRef.typeArguments[i] != null) {
- scope.problemReporter().illegalQualifiedParameterizedTypeAllocation(this.type, receiverType);
- break;
- }
- }
- }
- }
- }
- }
- if (receiverType == null || !receiverType.isValidBinding()) {
- hasError = true;
- }
-
- // resolve type arguments (for generic constructor call)
- long sourceLevel = scope.compilerOptions().sourceLevel;
- final boolean isDiamond = this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0;
- if (this.typeArguments != null) {
- int length = this.typeArguments.length;
- boolean argHasError = sourceLevel < ClassFileConstants.JDK1_5;
- this.genericTypeArguments = new TypeBinding[length];
- for (int i = 0; i < length; i++) {
- TypeReference typeReference = this.typeArguments[i];
- if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
- argHasError = true;
- }
- if (argHasError && typeReference instanceof Wildcard) {
- scope.problemReporter().illegalUsageOfWildcard(typeReference);
- }
- }
- if (isDiamond) {
- scope.problemReporter().diamondNotWithExplicitTypeArguments(this.typeArguments);
- return null;
- }
- if (argHasError) {
- if (this.arguments != null) { // still attempt to resolve arguments
- for (int i = 0, max = this.arguments.length; i < max; i++) {
- this.arguments[i].resolveType(scope);
- }
- }
- return null;
- }
- }
-
- // will check for null after args are resolved
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
- if (this.arguments != null) {
- int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
- for (int i = 0; i < length; i++) {
- Expression argument = this.arguments[i];
- if (argument instanceof CastExpression) {
- argument.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
- argsContainCast = true;
- }
- argument.setExpressionContext(INVOCATION_CONTEXT);
- if ((argumentTypes[i] = argument.resolveType(scope)) == null){
+ scope.problemReporter().invalidType(this.enclosingInstance, enclosingInstanceType);
hasError = true;
- }
- if (sourceLevel >= ClassFileConstants.JDK1_8 && argument.isPolyExpression()) {
- if (this.innerInferenceHelper == null)
- this.innerInferenceHelper = new InnerInferenceHelper();
- }
- }
- }
-
- // limit of fault-tolerance
- if (hasError) {
- /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=345359, if arguments have errors, completely bail out in the <> case.
- No meaningful type resolution is possible since inference of the elided types is fully tied to argument types. Do
- not return the partially resolved type.
- */
- if (isDiamond) {
- return null; // not the partially cooked this.resolvedType
- }
- if (receiverType instanceof ReferenceBinding) {
- ReferenceBinding referenceReceiver = (ReferenceBinding) receiverType;
- if (receiverType.isValidBinding()) {
- // record a best guess, for clients who need hint about possible contructor match
- int length = this.arguments == null ? 0 : this.arguments.length;
- TypeBinding[] pseudoArgs = new TypeBinding[length];
- for (int i = length; --i >= 0;) {
- pseudoArgs[i] = argumentTypes[i] == null ? TypeBinding.NULL : argumentTypes[i]; // replace args with errors with null type
+ } else {
+ this.resolvedType = receiverType = ((SingleTypeReference) this.type).resolveTypeEnclosing(scope, (ReferenceBinding) enclosingInstanceType);
+ checkIllegalNullAnnotation(scope, receiverType);
+ if (receiverType != null && enclosingInstanceContainsCast) {
+ CastExpression.checkNeedForEnclosingInstanceCast(scope, this.enclosingInstance, enclosingInstanceType, receiverType);
}
- this.binding = scope.findMethod(referenceReceiver, TypeConstants.INIT, pseudoArgs, this, false);
- if (this.binding != null && !this.binding.isValidBinding()) {
- MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch;
- // record the closest match, for clients who may still need hint about possible method match
- if (closestMatch != null) {
- if (closestMatch.original().typeVariables != Binding.NO_TYPE_VARIABLES) { // generic method
- // shouldn't return generic method outside its context, rather convert it to raw method (175409)
- closestMatch = scope.environment().createParameterizedGenericMethod(closestMatch.original(), (RawTypeBinding)null);
- }
- this.binding = closestMatch;
- MethodBinding closestMatchOriginal = closestMatch.original();
- if (closestMatchOriginal.isOrEnclosedByPrivateType() && !scope.isDefinedInMethod(closestMatchOriginal)) {
- // ignore cases where method is used from within inside itself (e.g. direct recursions)
- closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ }
+ } else {
+ if (this.type == null) {
+ // initialization of an enum constant
+ receiverType = scope.enclosingSourceType();
+ } else {
+ receiverType = this.type.resolveType(scope, true /* check bounds*/);
+ checkIllegalNullAnnotation(scope, receiverType);
+ checkParameterizedAllocation: {
+ if (receiverType == null || !receiverType.isValidBinding()) break checkParameterizedAllocation;
+ if (this.type instanceof ParameterizedQualifiedTypeReference) { // disallow new X<String>.Y<Integer>()
+ ReferenceBinding currentType = (ReferenceBinding)receiverType;
+ do {
+ // isStatic() is answering true for toplevel types
+ if ((currentType.modifiers & ClassFileConstants.AccStatic) != 0) break checkParameterizedAllocation;
+ if (currentType.isRawType()) break checkParameterizedAllocation;
+ } while ((currentType = currentType.enclosingType())!= null);
+ ParameterizedQualifiedTypeReference qRef = (ParameterizedQualifiedTypeReference) this.type;
+ for (int i = qRef.typeArguments.length - 2; i >= 0; i--) {
+ if (qRef.typeArguments[i] != null) {
+ scope.problemReporter().illegalQualifiedParameterizedTypeAllocation(this.type, receiverType);
+ break;
+ }
}
}
}
}
- if (this.anonymousType != null) {
- // insert anonymous type in scope (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=210070)
- scope.addAnonymousType(this.anonymousType, referenceReceiver);
- this.anonymousType.resolve(scope);
- return this.resolvedType = this.anonymousType.binding;
- }
}
- return this.resolvedType = receiverType;
- }
- if (this.anonymousType == null) {
- // qualified allocation with no anonymous type
- if (!receiverType.canBeInstantiated()) {
- scope.problemReporter().cannotInstantiate(this.type, receiverType);
- return this.resolvedType = receiverType;
+ if (receiverType == null || !receiverType.isValidBinding()) {
+ hasError = true;
}
- if (isDiamond) {
- TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) receiverType, receiverType.enclosingType(), argumentTypes, scope);
- if (inferredTypes == null) {
- scope.problemReporter().cannotInferElidedTypes(this);
- return this.resolvedType = null;
- }
- receiverType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) receiverType).genericType(), inferredTypes, ((ParameterizedTypeBinding) receiverType).enclosingType());
- }
- ReferenceBinding allocationType = (ReferenceBinding) receiverType;
- this.binding = findConstructorBinding(scope, this, allocationType, argumentTypes);
- if (this.binding.isValidBinding()) {
- if (isMethodUseDeprecated(this.binding, scope, true)) {
- scope.problemReporter().deprecatedMethod(this.binding, this);
+ // resolve type arguments (for generic constructor call)
+ if (this.typeArguments != null) {
+ int length = this.typeArguments.length;
+ this.argumentsHaveErrors = sourceLevel < ClassFileConstants.JDK1_5;
+ this.genericTypeArguments = new TypeBinding[length];
+ for (int i = 0; i < length; i++) {
+ TypeReference typeReference = this.typeArguments[i];
+ if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
+ this.argumentsHaveErrors = true;
+ }
+ if (this.argumentsHaveErrors && typeReference instanceof Wildcard) {
+ scope.problemReporter().illegalUsageOfWildcard(typeReference);
+ }
}
- if (checkInvocationArguments(scope, null, allocationType, this.binding, this.arguments, argumentTypes, argsContainCast, this)) {
- this.bits |= ASTNode.Unchecked;
- }
- if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
- scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments);
- }
- } else {
- if (this.binding.declaringClass == null) {
- this.binding.declaringClass = allocationType;
- }
- if (this.type != null && !this.type.resolvedType.isValidBinding()) {
- // problem already got signaled on type reference, do not report secondary problem
+ if (isDiamond) {
+ scope.problemReporter().diamondNotWithExplicitTypeArguments(this.typeArguments);
return null;
}
- scope.problemReporter().invalidConstructor(this, this.binding);
- return this.resolvedType = receiverType;
+ if (this.argumentsHaveErrors) {
+ if (this.arguments != null) { // still attempt to resolve arguments
+ for (int i = 0, max = this.arguments.length; i < max; i++) {
+ this.arguments[i].resolveType(scope);
+ }
+ }
+ return null;
+ }
}
- if ((this.binding.tagBits & TagBits.HasMissingType) != 0) {
- scope.problemReporter().missingTypeInConstructor(this, this.binding);
- }
- if (!isDiamond && receiverType.isParameterizedTypeWithActualArguments()) {
- checkTypeArgumentRedundancy((ParameterizedTypeBinding)receiverType, receiverType.enclosingType(), argumentTypes , scope);
- }
- // The enclosing instance must be compatible with the innermost enclosing type
- ReferenceBinding expectedType = this.binding.declaringClass.enclosingType();
- if (TypeBinding.notEquals(expectedType, enclosingInstanceType)) // must call before computeConversion() and typeMismatchError()
- scope.compilationUnitScope().recordTypeConversion(expectedType, enclosingInstanceType);
- if (enclosingInstanceType.isCompatibleWith(expectedType) || scope.isBoxingCompatibleWith(enclosingInstanceType, expectedType)) {
- this.enclosingInstance.computeConversion(scope, expectedType, enclosingInstanceType);
- return this.resolvedType = receiverType;
- }
- scope.problemReporter().typeMismatchError(enclosingInstanceType, expectedType, this.enclosingInstance, null);
- return this.resolvedType = receiverType;
- } else {
- if (isDiamond) {
- scope.problemReporter().diamondNotWithAnoymousClasses(this.type);
- return null;
- }
- }
- ReferenceBinding superType = (ReferenceBinding) receiverType;
- if (superType.isTypeVariable()) {
- superType = new ProblemReferenceBinding(new char[][]{superType.sourceName()}, superType, ProblemReasons.IllegalSuperTypeVariable);
- scope.problemReporter().invalidType(this, superType);
- return null;
- } else if (this.type != null && superType.isEnum()) { // tolerate enum constant body
- scope.problemReporter().cannotInstantiate(this.type, superType);
- return this.resolvedType = superType;
- }
- // anonymous type scenario
- // an anonymous class inherits from java.lang.Object when declared "after" an interface
- ReferenceBinding anonymousSuperclass = superType.isInterface() ? scope.getJavaLangObject() : superType;
- // insert anonymous type in scope
- scope.addAnonymousType(this.anonymousType, superType);
- this.anonymousType.resolve(scope);
- // find anonymous super constructor
- this.resolvedType = this.anonymousType.binding; // 1.2 change
- if ((this.resolvedType.tagBits & TagBits.HierarchyHasProblems) != 0) {
- return null; // stop secondary errors
+ // will check for null after args are resolved
+ this.argumentTypes = Binding.NO_PARAMETERS;
+ if (this.arguments != null) {
+ int length = this.arguments.length;
+ this.argumentTypes = new TypeBinding[length];
+ for (int i = 0; i < length; i++) {
+ Expression argument = this.arguments[i];
+ if (argument instanceof CastExpression) {
+ argument.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
+ this.argsContainCast = true;
+ }
+ argument.setExpressionContext(INVOCATION_CONTEXT);
+ if ((this.argumentTypes[i] = argument.resolveType(scope)) == null){
+ this.argumentsHaveErrors = hasError = true;
+ }
+ }
+ }
+
+ // limit of fault-tolerance
+ if (hasError) {
+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=345359, if arguments have errors, completely bail out in the <> case.
+ No meaningful type resolution is possible since inference of the elided types is fully tied to argument types. Do
+ not return the partially resolved type.
+ */
+ if (isDiamond) {
+ return null; // not the partially cooked this.resolvedType
+ }
+ if (receiverType instanceof ReferenceBinding) {
+ ReferenceBinding referenceReceiver = (ReferenceBinding) receiverType;
+ if (receiverType.isValidBinding()) {
+ // record a best guess, for clients who need hint about possible contructor match
+ int length = this.arguments == null ? 0 : this.arguments.length;
+ TypeBinding[] pseudoArgs = new TypeBinding[length];
+ for (int i = length; --i >= 0;) {
+ pseudoArgs[i] = this.argumentTypes[i] == null ? TypeBinding.NULL : this.argumentTypes[i]; // replace args with errors with null type
+ }
+ this.binding = scope.findMethod(referenceReceiver, TypeConstants.INIT, pseudoArgs, this, false);
+ if (this.binding != null && !this.binding.isValidBinding()) {
+ MethodBinding closestMatch = ((ProblemMethodBinding)this.binding).closestMatch;
+ // record the closest match, for clients who may still need hint about possible method match
+ if (closestMatch != null) {
+ if (closestMatch.original().typeVariables != Binding.NO_TYPE_VARIABLES) { // generic method
+ // shouldn't return generic method outside its context, rather convert it to raw method (175409)
+ closestMatch = scope.environment().createParameterizedGenericMethod(closestMatch.original(), (RawTypeBinding)null);
+ }
+ this.binding = closestMatch;
+ MethodBinding closestMatchOriginal = closestMatch.original();
+ if (closestMatchOriginal.isOrEnclosedByPrivateType() && !scope.isDefinedInMethod(closestMatchOriginal)) {
+ // ignore cases where method is used from within inside itself (e.g. direct recursions)
+ closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
+ }
+ }
+ }
+ }
+ if (this.anonymousType != null) {
+ // insert anonymous type in scope (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=210070)
+ scope.addAnonymousType(this.anonymousType, referenceReceiver);
+ this.anonymousType.resolve(scope);
+ return this.resolvedType = this.anonymousType.binding;
+ }
+ }
+ return this.resolvedType = receiverType;
+ }
+ if (this.anonymousType == null) {
+ // qualified allocation with no anonymous type
+ if (!receiverType.canBeInstantiated()) {
+ scope.problemReporter().cannotInstantiate(this.type, receiverType);
+ return this.resolvedType = receiverType;
+ }
+ } else {
+ if (isDiamond) {
+ scope.problemReporter().diamondNotWithAnoymousClasses(this.type);
+ return null;
+ }
+ ReferenceBinding superType = (ReferenceBinding) receiverType;
+ if (superType.isTypeVariable()) {
+ superType = new ProblemReferenceBinding(new char[][]{superType.sourceName()}, superType, ProblemReasons.IllegalSuperTypeVariable);
+ scope.problemReporter().invalidType(this, superType);
+ return null;
+ } else if (this.type != null && superType.isEnum()) { // tolerate enum constant body
+ scope.problemReporter().cannotInstantiate(this.type, superType);
+ return this.resolvedType = superType;
+ }
+ // anonymous type scenario
+ // an anonymous class inherits from java.lang.Object when declared "after" an interface
+ ReferenceBinding anonymousSuperclass = superType.isInterface() ? scope.getJavaLangObject() : superType;
+ // insert anonymous type in scope
+ scope.addAnonymousType(this.anonymousType, superType);
+ this.anonymousType.resolve(scope);
+
+ // find anonymous super constructor
+ this.resolvedType = this.anonymousType.binding; // 1.2 change
+ if ((this.resolvedType.tagBits & TagBits.HierarchyHasProblems) != 0) {
+ return null; // stop secondary errors
+ }
+ MethodBinding inheritedBinding = findConstructorBinding(scope, this, anonymousSuperclass, this.argumentTypes);
+
+ if (!inheritedBinding.isValidBinding()) {
+ if (inheritedBinding.declaringClass == null) {
+ inheritedBinding.declaringClass = anonymousSuperclass;
+ }
+ if (this.type != null && !this.type.resolvedType.isValidBinding()) {
+ // problem already got signaled on type reference, do not report secondary problem
+ return null;
+ }
+ scope.problemReporter().invalidConstructor(this, inheritedBinding);
+ return this.resolvedType;
+ }
+ if ((inheritedBinding.tagBits & TagBits.HasMissingType) != 0) {
+ scope.problemReporter().missingTypeInConstructor(this, inheritedBinding);
+ }
+ if (this.enclosingInstance != null) {
+ ReferenceBinding targetEnclosing = inheritedBinding.declaringClass.enclosingType();
+ if (targetEnclosing == null) {
+ scope.problemReporter().unnecessaryEnclosingInstanceSpecification(this.enclosingInstance, superType);
+ return this.resolvedType;
+ } else if (!enclosingInstanceType.isCompatibleWith(targetEnclosing) && !scope.isBoxingCompatibleWith(enclosingInstanceType, targetEnclosing)) {
+ scope.problemReporter().typeMismatchError(enclosingInstanceType, targetEnclosing, this.enclosingInstance, null);
+ return this.resolvedType;
+ }
+ this.enclosingInstance.computeConversion(scope, targetEnclosing, enclosingInstanceType);
+ }
+ if (this.arguments != null) {
+ if (checkInvocationArguments(scope, null, anonymousSuperclass, inheritedBinding, this.arguments, this.argumentTypes, this.argsContainCast, this)) {
+ this.bits |= ASTNode.Unchecked;
+ }
+ }
+ if (this.typeArguments != null && inheritedBinding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
+ scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(inheritedBinding, this.genericTypeArguments, this.typeArguments);
+ }
+ // Update the anonymous inner class : superclass, interface
+ this.binding = this.anonymousType.createDefaultConstructorWithBinding(inheritedBinding, (this.bits & ASTNode.Unchecked) != 0 && this.genericTypeArguments == null);
+ return this.resolvedType;
+ }
+ } else {
+ if (this.enclosingInstance != null) {
+ enclosingInstanceType = this.enclosingInstance.resolvedType;
+ this.resolvedType = receiverType = this.type.resolvedType;
+ }
}
- MethodBinding inheritedBinding = findConstructorBinding(scope, this, anonymousSuperclass, argumentTypes);
-
- if (!inheritedBinding.isValidBinding()) {
- if (inheritedBinding.declaringClass == null) {
- inheritedBinding.declaringClass = anonymousSuperclass;
+ if (isDiamond) {
+ this.binding = inferConstructorOfElidedParameterizedType(scope);
+ if (this.binding == null || !this.binding.isValidBinding()) {
+ scope.problemReporter().cannotInferElidedTypes(this);
+ return this.resolvedType = null;
+ }
+ if (this.typeExpected == null && sourceLevel >= ClassFileConstants.JDK1_8 && this.expressionContext.definesTargetType()) {
+ return new PolyTypeBinding(this);
+ }
+ this.resolvedType = this.type.resolvedType = receiverType = this.binding.declaringClass;
+ resolvePolyExpressionArguments(this, this.binding, this.argumentTypes, scope);
+ } else {
+ this.binding = findConstructorBinding(scope, this, (ReferenceBinding) receiverType, this.argumentTypes);
+ }
+
+ if (this.binding.isValidBinding()) {
+ if (isMethodUseDeprecated(this.binding, scope, true)) {
+ scope.problemReporter().deprecatedMethod(this.binding, this);
+ }
+ if (checkInvocationArguments(scope, null, receiverType, this.binding, this.arguments, this.argumentTypes, this.argsContainCast, this)) {
+ this.bits |= ASTNode.Unchecked;
+ }
+ if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
+ scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments);
+ }
+ } else {
+ if (this.binding.declaringClass == null) {
+ this.binding.declaringClass = (ReferenceBinding) receiverType;
}
if (this.type != null && !this.type.resolvedType.isValidBinding()) {
// problem already got signaled on type reference, do not report secondary problem
return null;
}
- scope.problemReporter().invalidConstructor(this, inheritedBinding);
- return this.resolvedType;
+ scope.problemReporter().invalidConstructor(this, this.binding);
+ return this.resolvedType = receiverType;
}
- if ((inheritedBinding.tagBits & TagBits.HasMissingType) != 0) {
- scope.problemReporter().missingTypeInConstructor(this, inheritedBinding);
+ if ((this.binding.tagBits & TagBits.HasMissingType) != 0) {
+ scope.problemReporter().missingTypeInConstructor(this, this.binding);
}
- if (this.enclosingInstance != null) {
- ReferenceBinding targetEnclosing = inheritedBinding.declaringClass.enclosingType();
- if (targetEnclosing == null) {
- scope.problemReporter().unnecessaryEnclosingInstanceSpecification(this.enclosingInstance, superType);
- return this.resolvedType;
- } else if (!enclosingInstanceType.isCompatibleWith(targetEnclosing) && !scope.isBoxingCompatibleWith(enclosingInstanceType, targetEnclosing)) {
- scope.problemReporter().typeMismatchError(enclosingInstanceType, targetEnclosing, this.enclosingInstance, null);
- return this.resolvedType;
- }
- this.enclosingInstance.computeConversion(scope, targetEnclosing, enclosingInstanceType);
+ if (!isDiamond && receiverType.isParameterizedTypeWithActualArguments()) {
+ checkTypeArgumentRedundancy((ParameterizedTypeBinding)receiverType, scope);
}
- if (this.arguments != null) {
- if (checkInvocationArguments(scope, null, anonymousSuperclass, inheritedBinding, this.arguments, argumentTypes, argsContainCast, this)) {
- this.bits |= ASTNode.Unchecked;
- }
+ // The enclosing instance must be compatible with the innermost enclosing type
+ ReferenceBinding expectedType = this.binding.declaringClass.enclosingType();
+ if (TypeBinding.notEquals(expectedType, enclosingInstanceType)) // must call before computeConversion() and typeMismatchError()
+ scope.compilationUnitScope().recordTypeConversion(expectedType, enclosingInstanceType);
+ if (enclosingInstanceType.isCompatibleWith(expectedType) || scope.isBoxingCompatibleWith(enclosingInstanceType, expectedType)) {
+ this.enclosingInstance.computeConversion(scope, expectedType, enclosingInstanceType);
+ return this.resolvedType = receiverType;
}
- if (this.typeArguments != null && inheritedBinding.original().typeVariables == Binding.NO_TYPE_VARIABLES) {
- scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(inheritedBinding, this.genericTypeArguments, this.typeArguments);
- }
- // Update the anonymous inner class : superclass, interface
- this.binding = this.anonymousType.createDefaultConstructorWithBinding(inheritedBinding, (this.bits & ASTNode.Unchecked) != 0 && this.genericTypeArguments == null);
- return this.resolvedType;
+ scope.problemReporter().typeMismatchError(enclosingInstanceType, expectedType, this.enclosingInstance, null);
+ return this.resolvedType = receiverType;
}
public void traverse(ASTVisitor visitor, BlockScope scope) {
@@ -604,4 +621,4 @@
}
visitor.endVisit(this, scope);
}
-}
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
index f8582e3..2c3faa5 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
* bug 368546 - [compiler][resource] Avoid remaining false positives found when compiling the Eclipse SDK
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* Bug 414380 - [compiler][internal] QualifiedNameReference#indexOfFirstFieldBinding does not point to the first field
+ * Bug 458396 - NPE in CodeStream.invoke()
* Jesper S Moller - Contributions for
* bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
* bug 331649 - [compiler][null] consider null annotations for fields
@@ -726,10 +727,10 @@
TypeBinding type = ((VariableBinding) this.binding).type;
int index = this.indexOfFirstFieldBinding;
if (index == length) { // restrictiveFlag == FIELD
- this.constant = ((FieldBinding) this.binding).constant();
+ this.constant = ((FieldBinding) this.binding).constant(scope);
// perform capture conversion if read access
return (type != null && (this.bits & ASTNode.IsStrictlyAssigned) == 0)
- ? type.capture(scope, this.sourceEnd)
+ ? type.capture(scope, this.sourceStart, this.sourceEnd)
: type;
}
// allocation of the fieldBindings array and its respective constants
@@ -738,7 +739,7 @@
this.otherDepths = new int[otherBindingsLength];
// fill the first constant (the one of the binding)
- this.constant = ((VariableBinding) this.binding).constant();
+ this.constant = ((VariableBinding) this.binding).constant(scope);
// save first depth, since will be updated by visibility checks of other bindings
int firstDepth = (this.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT;
// iteration on each field
@@ -749,7 +750,7 @@
this.bits &= ~ASTNode.DepthMASK; // flush previous depth if any
FieldBinding previousField = field;
- field = scope.getField(type.capture(scope, (int)this.sourcePositions[index]), token, this);
+ field = scope.getField(type.capture(scope, (int) (this.sourcePositions[index] >>> 32), (int)this.sourcePositions[index]), token, this);
int place = index - this.indexOfFirstFieldBinding;
this.otherBindings[place] = field;
this.otherDepths[place] = (this.bits & ASTNode.DepthMASK) >> ASTNode.DepthSHIFT;
@@ -770,7 +771,7 @@
}
// constant propagation can only be performed as long as the previous one is a constant too.
if (this.constant != Constant.NotAConstant) {
- this.constant = field.constant();
+ this.constant = field.constant(scope);
}
if (field.isStatic()) {
@@ -787,7 +788,7 @@
}
// check if accessing enum static field in initializer
if ((TypeBinding.equalsEquals(sourceType, declaringClass) || TypeBinding.equalsEquals(sourceType.superclass, declaringClass)) // enum constant body
- && field.constant() == Constant.NotAConstant
+ && field.constant(scope) == Constant.NotAConstant
&& !methodScope.isStatic
&& methodScope.isInsideInitializerOrConstructor()) {
scope.problemReporter().enumStaticFieldUsedDuringInitialization(field, this);
@@ -813,7 +814,7 @@
type = (this.otherBindings[otherBindingsLength - 1]).type;
// perform capture conversion if read access
return (type != null && (this.bits & ASTNode.IsStrictlyAssigned) == 0)
- ? type.capture(scope, this.sourceEnd)
+ ? type.capture(scope, this.sourceStart, this.sourceEnd)
: type;
}
@@ -912,7 +913,7 @@
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) != 0) return;
// index == 0 denotes the first fieldBinding, index > 0 denotes one of the 'otherBindings', index < 0 denotes a write access (to last binding)
- if (fieldBinding.constant() != Constant.NotAConstant)
+ if (fieldBinding.constant(currentScope) != Constant.NotAConstant)
return;
if (fieldBinding.isPrivate()) { // private access
@@ -1079,7 +1080,7 @@
// check if accessing enum static field in initializer
if (declaringClass.isEnum()) {
if ((TypeBinding.equalsEquals(sourceType, declaringClass) || TypeBinding.equalsEquals(sourceType.superclass, declaringClass)) // enum constant body
- && fieldBinding.constant() == Constant.NotAConstant
+ && fieldBinding.constant(scope) == Constant.NotAConstant
&& !methodScope.isStatic
&& methodScope.isInsideInitializerOrConstructor()) {
scope.problemReporter().enumStaticFieldUsedDuringInitialization(fieldBinding, this);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
index f6be4a2..305fe62 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,6 +27,10 @@
return true;
}
+public boolean isQualifiedSuper() {
+ return true;
+}
+
public boolean isThis() {
return false;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.java
index 5df02b6..ad8f72e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Reference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
* bug 392384 - [1.8][compiler][null] Restore nullness info from type annotations in class files
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
* Bug 411964 - [1.8][null] leverage null type annotation in foreach statement
+ * Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -136,6 +137,8 @@
}
public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) {
+ if ((this.implicitConversion & TypeIds.BOXING) != 0)
+ return FlowInfo.NON_NULL;
FieldBinding fieldBinding = lastFieldBinding();
if (fieldBinding != null) {
if (fieldBinding.isNonNull() || flowContext.isNullcheckedFieldAccess(this)) {
@@ -167,7 +170,6 @@
{
// compoundAssignment/postIncrement is the only usage of this field
currentScope.problemReporter().unusedPrivateField(fieldBinding.sourceField());
-// fieldBinding.modifiers |= ExtraCompilerModifiers.AccLocallyUsed; // don't report again
}
}
}
@@ -215,6 +217,5 @@
// report the case of a local variable that is unread except for a special operator
currentScope.problemReporter().unusedLocalVariable(localBinding.declaration);
}
-// localBinding.useFlag = LocalVariableBinding.USED; // don't report again
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
index 448d361..a6c10ed 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,6 +29,13 @@
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
* Bug 435689 - [1.8][inference] Type inference not occurring with lambda expression and method reference
* Bug 438383 - [1.8][null] Bogus warning: Null type safety at method return type
+ * Bug 434483 - [1.8][compiler][inference] Type inference not picked up with method reference
+ * Bug 441734 - [1.8][inference] Generic method with nested parameterized type argument fails on method reference
+ * Bug 438945 - [1.8] NullPointerException InferenceContext18.checkExpression in java 8 with generics, primitives, and overloading
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ * Bug 448709 - [1.8][null] ensure we don't infer types that violate null constraints on a type parameter's bound
+ * Bug 459967 - [null] compiler should know about nullness of special methods like MyEnum.valueOf()
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contribution for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
*******************************************************************************/
@@ -37,28 +44,38 @@
import static org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExpressionContext.INVOCATION_CONTEXT;
+import java.util.HashMap;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
import org.aspectj.org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionCastTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.IntersectionTypeBinding18;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PolyTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReasons;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
@@ -70,8 +87,12 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
-public class ReferenceExpression extends FunctionalExpression implements InvocationSite {
-
+public class ReferenceExpression extends FunctionalExpression implements IPolyExpression, InvocationSite {
+ // secret variable name
+ private static final String SecretReceiverVariableName = " rec_"; //$NON-NLS-1$
+ private static final char[] ImplicitArgName = " arg".toCharArray(); //$NON-NLS-1$
+ // secret variable for codegen
+ public LocalVariableBinding receiverVariable;
public Expression lhs;
public TypeReference [] typeArguments;
public char [] selector;
@@ -87,10 +108,17 @@
private int depth;
private MethodBinding exactMethodBinding; // != null ==> exact method reference.
private boolean receiverPrecedesParameters = false;
- protected boolean trialResolution = false;
+ private TypeBinding[] freeParameters; // descriptor parameters as used for method lookup - may or may not include the receiver
+ private boolean checkingPotentialCompatibility;
+ private MethodBinding[] potentialMethods = Binding.NO_METHODS;
+ protected ReferenceExpression original;
+ private HashMap<TypeBinding, ReferenceExpression> copiesPerTargetType;
+ public char[] text; // source representation of the expression.
+ private HashMap<ParameterizedGenericMethodBinding, InferenceContext18> inferenceContexts;
public ReferenceExpression() {
super();
+ this.original = this;
}
public void initialize(CompilationResult result, Expression expression, TypeReference [] optionalTypeArguments, char [] identifierOrNew, int sourceEndPosition) {
@@ -101,20 +129,57 @@
this.sourceStart = expression.sourceStart;
this.sourceEnd = sourceEndPosition;
}
+
+ private ReferenceExpression copy() {
+ final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
+ final ICompilationUnit compilationUnit = this.compilationResult.getCompilationUnit();
+ final char[] source = compilationUnit != null ? compilationUnit.getContents() : this.text;
+ ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, compilationUnit != null ? this.sourceStart : 0, this.sourceEnd - this.sourceStart + 1,
+ this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);
+ copy.original = this;
+ copy.sourceStart = this.sourceStart;
+ copy.sourceEnd = this.sourceEnd;
+ return copy;
+ }
+ private boolean shouldGenerateSecretReceiverVariable() {
+ if (isMethodReference() && this.haveReceiver) {
+ if (this.lhs instanceof Invocation)
+ return true;
+ else {
+ return new ASTVisitor() {
+ boolean accessesnonFinalOuterLocals;
+
+ public boolean visit(SingleNameReference name, BlockScope skope) {
+ Binding local = skope.getBinding(name.getName(), ReferenceExpression.this);
+ if (local instanceof LocalVariableBinding) {
+ LocalVariableBinding localBinding = (LocalVariableBinding) local;
+ if (!localBinding.isFinal() && !localBinding.isEffectivelyFinal()) {
+ this.accessesnonFinalOuterLocals = true;
+ }
+ }
+ return false;
+ }
+
+ public boolean accessesnonFinalOuterLocals() {
+ ReferenceExpression.this.lhs.traverse(this, ReferenceExpression.this.enclosingScope);
+ return this.accessesnonFinalOuterLocals;
+ }
+ }.accessesnonFinalOuterLocals();
+ }
+ }
+ return false;
+ }
public void generateImplicitLambda(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
- final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
- final char[] source = this.compilationResult.getCompilationUnit().getContents();
- ReferenceExpression copy = (ReferenceExpression) parser.parseExpression(source, this.sourceStart, this.sourceEnd - this.sourceStart + 1,
- this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);
+ ReferenceExpression copy = copy();
int argc = this.descriptor.parameters.length;
- LambdaExpression implicitLambda = new LambdaExpression(this.compilationResult, false);
+ LambdaExpression implicitLambda = new LambdaExpression(this.compilationResult, false, (this.binding.modifiers & ExtraCompilerModifiers.AccGenericSignature) != 0);
Argument [] arguments = new Argument[argc];
for (int i = 0; i < argc; i++)
- arguments[i] = new Argument(("arg" + i).toCharArray(), 0, null, 0, true); //$NON-NLS-1$
+ arguments[i] = new Argument(CharOperation.append(ImplicitArgName, Integer.toString(i).toCharArray()), 0, null, 0, true);
implicitLambda.setArguments(arguments);
implicitLambda.setExpressionContext(this.expressionContext);
implicitLambda.setExpectedType(this.expectedType);
@@ -122,13 +187,21 @@
int parameterShift = this.receiverPrecedesParameters ? 1 : 0;
Expression [] argv = new SingleNameReference[argc - parameterShift];
for (int i = 0, length = argv.length; i < length; i++) {
- String name = "arg" + (i + parameterShift); //$NON-NLS-1$
- argv[i] = new SingleNameReference(name.toCharArray(), 0);
+ char[] name = CharOperation.append(ImplicitArgName, Integer.toString((i + parameterShift)).toCharArray());
+ argv[i] = new SingleNameReference(name, 0);
}
+ boolean generateSecretReceiverVariable = shouldGenerateSecretReceiverVariable();
if (isMethodReference()) {
+ if (generateSecretReceiverVariable) {
+ this.lhs.generateCode(currentScope, codeStream, true);
+ codeStream.store(this.receiverVariable, false);
+ codeStream.addVariable(this.receiverVariable);
+ }
MessageSend message = new MessageSend();
message.selector = this.selector;
- message.receiver = this.receiverPrecedesParameters ? new SingleNameReference("arg0".toCharArray(), 0) : copy.lhs; //$NON-NLS-1$
+ Expression receiver = generateSecretReceiverVariable ? new SingleNameReference(this.receiverVariable.name, 0) : copy.lhs;
+ message.receiver = this.receiverPrecedesParameters ?
+ new SingleNameReference(CharOperation.append(ImplicitArgName, Integer.toString(0).toCharArray()), 0) : receiver;
message.typeArguments = copy.typeArguments;
message.arguments = argv;
implicitLambda.setBody(message);
@@ -178,13 +251,17 @@
implicitLambda.addSyntheticArgument(outerLocals[i].actualOuterLocalVariable);
implicitLambda.generateCode(currentScope, codeStream, valueRequired);
+ if (generateSecretReceiverVariable) {
+ codeStream.removeVariable(this.receiverVariable);
+ this.receiverVariable = null;
+ }
}
private boolean shouldGenerateImplicitLambda(BlockScope currentScope) {
// these cases are either too complicated, impossible to handle or result in significant code duplication
return (this.binding.isVarargs() ||
(isConstructorReference() && this.receiverType.syntheticOuterLocalVariables() != null && currentScope.methodScope().isStatic) ||
- this.expectedType instanceof IntersectionCastTypeBinding || // marker interfaces require alternate meta factory.
+ this.expectedType instanceof IntersectionTypeBinding18 || // marker interfaces require alternate meta factory.
this.expectedType.findSuperTypeOriginatingFrom(currentScope.getJavaIoSerializable()) != null || // serialization support.
this.requiresBridges()); // bridges.
// To fix: We should opt for direct code generation wherever possible.
@@ -342,24 +419,39 @@
if (this.haveReceiver) {
this.lhs.checkNPE(currentScope, flowContext, flowInfo);
this.lhs.analyseCode(currentScope, flowContext, flowInfo, true);
+ } else if (isConstructorReference()) {
+ TypeBinding type = this.receiverType.leafComponentType();
+ if (type.isMemberType() &&
+ type instanceof ReferenceBinding && !((ReferenceBinding)type).isStatic()) {
+ currentScope.tagAsAccessingEnclosingInstanceStateOf((ReferenceBinding)type, false);
+ }
}
manageSyntheticAccessIfNecessary(currentScope, flowInfo);
return flowInfo;
}
+ @Override
+ public boolean checkingPotentialCompatibility() {
+ return this.checkingPotentialCompatibility;
+ }
+
+ @Override
+ public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) {
+ if (this.checkingPotentialCompatibility)
+ this.potentialMethods = methods;
+ }
+
public TypeBinding resolveType(BlockScope scope) {
- if (this.expectedType != null && !this.trialResolution) { // final resolution ? may be not - i.e may be, but only in a non-final universe.
- recordFunctionalType(scope);
- }
-
final CompilerOptions compilerOptions = scope.compilerOptions();
TypeBinding lhsType;
if (this.constant != Constant.NotAConstant) {
this.constant = Constant.NotAConstant;
this.enclosingScope = scope;
- this.lhs.bits |= ASTNode.IgnoreRawTypeCheck;
+ if (this.original == this)
+ recordFunctionalType(scope);
+ this.lhs.bits |= ASTNode.IgnoreRawTypeCheck;
lhsType = this.lhs.resolveType(scope);
this.lhs.computeConversion(scope, lhsType, lhsType);
if (this.typeArguments != null) {
@@ -382,62 +474,104 @@
return this.resolvedType = null;
}
}
+ if (this.typeArgumentsHaveErrors || lhsType == null)
+ return this.resolvedType = null;
+
+ if (lhsType.problemId() == ProblemReasons.AttemptToBypassDirectSuper)
+ lhsType = lhsType.closestMatch(); // improve resolving experience
+ if (lhsType == null || !lhsType.isValidBinding())
+ return this.resolvedType = null; // nope, no useful type found
+
+ this.receiverType = lhsType;
+ this.haveReceiver = true;
+ if (this.lhs instanceof NameReference) {
+ if ((this.lhs.bits & ASTNode.RestrictiveFlagMASK) == Binding.TYPE) {
+ this.haveReceiver = false;
+ } else if (isConstructorReference()) {
+ scope.problemReporter().invalidType(
+ this.lhs,
+ new ProblemReferenceBinding(((NameReference) this.lhs).getName(), null,
+ ProblemReasons.NotFound));
+ return this.resolvedType = null;
+ }
+ } else if (this.lhs instanceof TypeReference) {
+ this.haveReceiver = false;
+ }
+ if (!this.haveReceiver && !this.lhs.isSuper() && !this.isArrayConstructorReference())
+ this.receiverType = lhsType.capture(scope, this.sourceStart, this.sourceEnd);
+
+ if (!lhsType.isRawType()) // RawType::m and RawType::new are not exact method references
+ this.binding = this.exactMethodBinding = isMethodReference() ? scope.getExactMethod(lhsType, this.selector, this) : scope.getExactConstructor(lhsType, this);
+
+ if (isConstructorReference() && !lhsType.canBeInstantiated()) {
+ scope.problemReporter().cannotInstantiate(this.lhs, lhsType);
+ return this.resolvedType = null;
+ }
+
+ if (this.lhs instanceof TypeReference && ((TypeReference)this.lhs).hasNullTypeAnnotation(AnnotationPosition.ANY)) {
+ scope.problemReporter().nullAnnotationUnsupportedLocation((TypeReference) this.lhs);
+ }
+
+ if (isConstructorReference() && lhsType.isArrayType()) {
+ final TypeBinding leafComponentType = lhsType.leafComponentType();
+ if (!leafComponentType.isReifiable()) {
+ scope.problemReporter().illegalGenericArray(leafComponentType, this);
+ return this.resolvedType = null;
+ }
+ if (this.typeArguments != null) {
+ scope.problemReporter().invalidTypeArguments(this.typeArguments);
+ return this.resolvedType = null;
+ }
+ this.binding = this.exactMethodBinding = scope.getExactConstructor(lhsType, this);
+ }
+ if (isMethodReference() && this.haveReceiver && (this.original == this)) {
+ this.receiverVariable = new LocalVariableBinding(
+ (SecretReceiverVariableName + this.nameSourceStart).toCharArray(), this.lhs.resolvedType,
+ ClassFileConstants.AccDefault, false);
+ scope.addLocalVariable(this.receiverVariable);
+ this.receiverVariable.setConstant(Constant.NotAConstant); // not inlinable
+ this.receiverVariable.useFlag = LocalVariableBinding.USED;
+ }
+
+ if (this.expectedType == null && this.expressionContext == INVOCATION_CONTEXT) {
+ return new PolyTypeBinding(this);
+ }
+
} else {
lhsType = this.lhs.resolvedType;
if (this.typeArgumentsHaveErrors || lhsType == null)
return this.resolvedType = null;
}
- if (lhsType != null && !lhsType.isRawType()) // RawType::m and RawType::new are not exact method references
- this.exactMethodBinding = isMethodReference() ? scope.getExactMethod(lhsType, this.selector, this) : scope.getExactConstructor(lhsType, this);
+ super.resolveType(scope);
- if (this.expectedType == null && this.expressionContext == INVOCATION_CONTEXT) {
- return new PolyTypeBinding(this);
- }
- super.resolveType(scope);
+ /* For Reference expressions unlike other call sites, we always have a receiver _type_ since LHS of :: cannot be empty.
+ LHS's resolved type == actual receiver type. All code below only when a valid descriptor is available.
+ */
+ if (this.descriptor == null || !this.descriptor.isValidBinding())
+ return this.resolvedType = null;
+
+ // Convert parameters into argument expressions for look up.
+ TypeBinding[] descriptorParameters = descriptorParametersAsArgumentExpressions();
- if (lhsType == null)
- return this.resolvedType = null; // no hope
- if (lhsType.problemId() == ProblemReasons.AttemptToBypassDirectSuper)
- lhsType = lhsType.closestMatch(); // improve resolving experience
- if (!lhsType.isValidBinding())
- return this.resolvedType = null; // nope, no useful type found
- final TypeBinding[] descriptorParameters = this.descriptor != null ? this.descriptor.parameters : Binding.NO_PARAMETERS;
if (lhsType.isBaseType()) {
scope.problemReporter().errorNoMethodFor(this.lhs, lhsType, this.selector, descriptorParameters);
return this.resolvedType = null;
}
- if (isConstructorReference() && !lhsType.canBeInstantiated()) {
- scope.problemReporter().cannotInstantiate(this.lhs, lhsType);
- return this.resolvedType = null;
- }
-
- if (this.lhs instanceof TypeReference && ((TypeReference)this.lhs).hasNullTypeAnnotation()) {
- scope.problemReporter().nullAnnotationUnsupportedLocation((TypeReference) this.lhs);
- }
-
- /* 15.28: "It is a compile-time error if a method reference of the form super :: NonWildTypeArgumentsopt Identifier or of the form
- TypeName . super :: NonWildTypeArgumentsopt Identifier occurs in a static context.": This is nop since the primary when it resolves
+ /* 15.13: "If a method reference expression has the form super :: [TypeArguments] Identifier or TypeName . super :: [TypeArguments] Identifier,
+ it is a compile-time error if the expression occurs in a static context. ": This is nop since the primary when it resolves
itself will complain automatically.
- 15.28: "The immediately enclosing instance of an inner class instance (15.9.2) must be provided for a constructor reference by a lexically
+ 15.13: "The immediately enclosing instance of an inner class instance (15.9.2) must be provided for a constructor reference by a lexically
enclosing instance of this (8.1.3)", we will actually implement this check in code generation. Emulation path computation will fail if there
is no suitable enclosing instance. While this could be pulled up to here, leaving it to code generation is more consistent with Java 5,6,7
modus operandi.
*/
// handle the special case of array construction first.
- this.receiverType = lhsType;
- if (!this.haveReceiver && !this.lhs.isSuper() && !this.isArrayConstructorReference())
- this.receiverType = lhsType.capture(scope, this.sourceEnd);
final int parametersLength = descriptorParameters.length;
if (isConstructorReference() && lhsType.isArrayType()) {
- final TypeBinding leafComponentType = lhsType.leafComponentType();
- if (!leafComponentType.isReifiable()) {
- scope.problemReporter().illegalGenericArray(leafComponentType, this);
- return this.resolvedType = null;
- }
if (parametersLength != 1 || scope.parameterCompatibilityLevel(descriptorParameters[0], TypeBinding.INT) == Scope.NOT_COMPATIBLE) {
scope.problemReporter().invalidArrayConstructorReference(this, lhsType, descriptorParameters);
return this.resolvedType = null;
@@ -446,43 +580,22 @@
scope.problemReporter().constructedArrayIncompatible(this, lhsType, this.descriptor.returnType);
return this.resolvedType = null;
}
- this.binding = this.exactMethodBinding = scope.getExactConstructor(lhsType, this);
+ checkNullAnnotations(scope);
return this.resolvedType;
}
-
- this.haveReceiver = true;
- if (this.lhs instanceof NameReference) {
- if ((this.lhs.bits & ASTNode.RestrictiveFlagMASK) == Binding.TYPE) {
- this.haveReceiver = false;
- }
- } else if (this.lhs instanceof TypeReference) {
- this.haveReceiver = false;
- }
- /* For Reference expressions unlike other call sites, we always have a receiver _type_ since LHS of :: cannot be empty.
- LHS's resolved type == actual receiver type. All code below only when a valid descriptor is available.
- */
- if (this.descriptor == null || !this.descriptor.isValidBinding())
- return this.resolvedType = null;
-
- // 15.28.1
+ // 15.13.1
final boolean isMethodReference = isMethodReference();
this.depth = 0;
+ this.freeParameters = descriptorParameters;
MethodBinding someMethod = isMethodReference ? scope.getMethod(this.receiverType, this.selector, descriptorParameters, this) :
scope.getConstructor((ReferenceBinding) this.receiverType, descriptorParameters, this);
int someMethodDepth = this.depth, anotherMethodDepth = 0;
if (someMethod != null && someMethod.isValidBinding()) {
- final boolean isStatic = someMethod.isStatic();
- if (isStatic && (this.haveReceiver || this.receiverType.isParameterizedTypeWithActualArguments())) {
+ if (someMethod.isStatic() && (this.haveReceiver || this.receiverType.isParameterizedTypeWithActualArguments())) {
scope.problemReporter().methodMustBeAccessedStatically(this, someMethod);
return this.resolvedType = null;
}
- if (!this.haveReceiver) {
- if (!isStatic && !someMethod.isConstructor()) {
- scope.problemReporter().methodMustBeAccessedWithInstance(this, someMethod);
- return this.resolvedType = null;
- }
- }
}
if (this.lhs.isSuper() && this.lhs.resolvedType.isInterface()) {
@@ -498,7 +611,7 @@
if (this.receiverType.isRawType()) {
TypeBinding superType = potentialReceiver.findSuperTypeOriginatingFrom(this.receiverType);
if (superType != null)
- typeToSearch = superType.capture(scope, this.sourceEnd);
+ typeToSearch = superType.capture(scope, this.sourceStart, this.sourceEnd);
}
TypeBinding [] parameters = Binding.NO_PARAMETERS;
if (parametersLength > 1) {
@@ -506,34 +619,41 @@
System.arraycopy(descriptorParameters, 1, parameters, 0, parametersLength - 1);
}
this.depth = 0;
+ this.freeParameters = parameters;
anotherMethod = scope.getMethod(typeToSearch, this.selector, parameters, this);
anotherMethodDepth = this.depth;
this.depth = 0;
}
- if (anotherMethod != null && anotherMethod.isValidBinding() && anotherMethod.isStatic()) {
- scope.problemReporter().methodMustBeAccessedStatically(this, anotherMethod);
- return this.resolvedType = null;
- }
}
- if (someMethod != null && someMethod.isValidBinding() && anotherMethod != null && anotherMethod.isValidBinding()) {
+ if (someMethod != null && someMethod.isValidBinding() && someMethod.isStatic() && anotherMethod != null && anotherMethod.isValidBinding() && !anotherMethod.isStatic()) {
scope.problemReporter().methodReferenceSwingsBothWays(this, anotherMethod, someMethod);
return this.resolvedType = null;
}
- if (someMethod != null && someMethod.isValidBinding()) {
+ if (someMethod != null && someMethod.isValidBinding() && (anotherMethod == null || !anotherMethod.isValidBinding() || anotherMethod.isStatic())) {
this.binding = someMethod;
this.bits &= ~ASTNode.DepthMASK;
if (someMethodDepth > 0) {
this.bits |= (someMethodDepth & 0xFF) << ASTNode.DepthSHIFT;
}
- } else if (anotherMethod != null && anotherMethod.isValidBinding()) {
+ if (!this.haveReceiver) {
+ if (!someMethod.isStatic() && !someMethod.isConstructor()) {
+ scope.problemReporter().methodMustBeAccessedWithInstance(this, someMethod);
+ return this.resolvedType = null;
+ }
+ }
+ } else if (anotherMethod != null && anotherMethod.isValidBinding() && (someMethod == null || !someMethod.isValidBinding() || !someMethod.isStatic())) {
this.binding = anotherMethod;
this.receiverPrecedesParameters = true; // 0 is receiver, real parameters start at 1
this.bits &= ~ASTNode.DepthMASK;
if (anotherMethodDepth > 0) {
this.bits |= (anotherMethodDepth & 0xFF) << ASTNode.DepthSHIFT;
}
+ if (anotherMethod.isStatic()) {
+ scope.problemReporter().methodMustBeAccessedStatically(this, anotherMethod);
+ return this.resolvedType = null;
+ }
} else {
this.binding = null;
this.bits &= ~ASTNode.DepthMASK;
@@ -582,41 +702,8 @@
}
scope.problemReporter().unhandledException(methodExceptions[i], this);
}
- if (scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
- int len;
- int expectedlen = this.binding.parameters.length;
- int providedLen = this.descriptor.parameters.length;
- if (this.receiverPrecedesParameters)
- providedLen--; // one parameter is 'consumed' as the receiver
- boolean isVarArgs = false;
- if (this.binding.isVarargs()) {
- isVarArgs = (providedLen == expectedlen)
- ? !this.descriptor.parameters[expectedlen-1].isCompatibleWith(this.binding.parameters[expectedlen-1])
- : true;
- len = providedLen; // binding parameters will be padded from InferenceContext18.getParameter()
- } else {
- len = Math.min(expectedlen, providedLen);
- }
- for (int i = 0; i < len; i++) {
- TypeBinding descriptorParameter = this.descriptor.parameters[i + (this.receiverPrecedesParameters ? 1 : 0)];
- TypeBinding bindingParameter = InferenceContext18.getParameter(this.binding.parameters, i, isVarArgs);
- NullAnnotationMatching annotationStatus = NullAnnotationMatching.analyse(bindingParameter, descriptorParameter, FlowInfo.UNKNOWN);
- if (annotationStatus.isAnyMismatch()) {
- // immediate reporting:
- scope.problemReporter().referenceExpressionArgumentNullityMismatch(this, bindingParameter, descriptorParameter, this.descriptor, i, annotationStatus);
- }
- }
- if (!this.binding.isConstructor() && (this.descriptor.returnType.tagBits & TagBits.AnnotationNonNull) != 0) {
- // since constructors never return null we don't have to check those anyway.
- if ((this.binding.returnType.tagBits & TagBits.AnnotationNonNull) == 0) {
- char[][] providedAnnotationName = ((this.binding.returnType.tagBits & TagBits.AnnotationNullable) != 0) ?
- scope.environment().getNullableAnnotationName() : null;
- scope.problemReporter().illegalReturnRedefinition(this, this.descriptor,
- scope.environment().getNonNullAnnotationName(),
- providedAnnotationName, this.binding.returnType);
- }
- }
- }
+ checkNullAnnotations(scope);
+ this.freeParameters = null; // not used after method lookup
if (checkInvocationArguments(scope, null, this.receiverType, this.binding, null, descriptorParameters, false, this))
this.bits |= ASTNode.Unchecked;
@@ -635,7 +722,7 @@
} else {
returnType = this.binding.returnType;
if (returnType != null) {
- returnType = returnType.capture(scope, this.sourceEnd);
+ returnType = returnType.capture(scope, this.sourceStart, this.sourceEnd);
}
}
}
@@ -652,39 +739,116 @@
return this.resolvedType; // Phew !
}
- /** During inference: Try to find an applicable method binding without causing undesired side-effects. */
- public MethodBinding findCompileTimeMethodTargeting(TypeBinding targetType, Scope scope) {
- MethodBinding targetMethod = internalResolveTentatively(targetType, scope);
- if (targetMethod == null || !targetMethod.isValidBinding())
- return null;
- return targetMethod;
+ protected void checkNullAnnotations(BlockScope scope) {
+ if (scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
+ if (this.expectedType == null || !NullAnnotationMatching.hasContradictions(this.expectedType)) { // otherwise assume it has been reported and we can do nothing here
+ // TODO: simplify by using this.freeParameters?
+ int len;
+ int expectedlen = this.binding.parameters.length;
+ int providedLen = this.descriptor.parameters.length;
+ if (this.receiverPrecedesParameters)
+ providedLen--; // one parameter is 'consumed' as the receiver
+ boolean isVarArgs = false;
+ if (this.binding.isVarargs()) {
+ isVarArgs = (providedLen == expectedlen)
+ ? !this.descriptor.parameters[expectedlen-1].isCompatibleWith(this.binding.parameters[expectedlen-1])
+ : true;
+ len = providedLen; // binding parameters will be padded from InferenceContext18.getParameter()
+ } else {
+ len = Math.min(expectedlen, providedLen);
+ }
+ for (int i = 0; i < len; i++) {
+ TypeBinding descriptorParameter = this.descriptor.parameters[i + (this.receiverPrecedesParameters ? 1 : 0)];
+ TypeBinding bindingParameter = InferenceContext18.getParameter(this.binding.parameters, i, isVarArgs);
+ NullAnnotationMatching annotationStatus = NullAnnotationMatching.analyse(bindingParameter, descriptorParameter, FlowInfo.UNKNOWN);
+ if (annotationStatus.isAnyMismatch()) {
+ // immediate reporting:
+ scope.problemReporter().referenceExpressionArgumentNullityMismatch(this, bindingParameter, descriptorParameter, this.descriptor, i, annotationStatus);
+ }
+ }
+ TypeBinding returnType = this.binding.returnType;
+ if (this.binding.isConstructor() || this.binding == scope.environment().arrayClone) {
+ returnType = scope.environment().createAnnotatedType(this.receiverType, new AnnotationBinding[]{ scope.environment().getNonNullAnnotation() });
+ }
+ NullAnnotationMatching annotationStatus = NullAnnotationMatching.analyse(this.descriptor.returnType, returnType, FlowInfo.UNKNOWN);
+ if (annotationStatus.isAnyMismatch()) {
+ scope.problemReporter().illegalReturnRedefinition(this, this.descriptor, annotationStatus.isUnchecked(), returnType);
+ }
+ }
+ }
}
- MethodBinding internalResolveTentatively(TypeBinding targetType, Scope scope) {
- // FIXME: could enclosingScope still be null here??
+ private TypeBinding[] descriptorParametersAsArgumentExpressions() {
+
+ if (this.descriptor == null || this.descriptor.parameters == null || this.descriptor.parameters.length == 0)
+ return Binding.NO_PARAMETERS;
+
+ /* 15.13.1, " ... method reference is treated as if it were an invocation with argument expressions of types P1, ..., Pn;"
+ This implies/requires wildcard capture. This creates interesting complications, we can't just take the descriptor parameters
+ and apply captures - where a single wildcard type got "fanned out" and propagated into multiple locations through type variable
+ substitutions, we will end up creating distinct captures defeating the very idea of capture. We need to first capture and then
+ fan out. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=432759.
+ */
+ if (this.expectedType.isParameterizedType()) {
+ ParameterizedTypeBinding type = (ParameterizedTypeBinding) this.expectedType;
+ MethodBinding method = type.getSingleAbstractMethod(this.enclosingScope, true, this.sourceStart, this.sourceEnd);
+ return method.parameters;
+ }
+ return this.descriptor.parameters;
+ }
+
+ // Cache resolved copies against various target types, so repeat overload resolution and possibly type inference could be avoided.
+ private ReferenceExpression cachedResolvedCopy(TypeBinding targetType) {
+
+ ReferenceExpression copy = this.copiesPerTargetType != null ? this.copiesPerTargetType.get(targetType) : null;
+ if (copy != null)
+ return copy;
+
IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
- ExpressionContext previousContext = this.expressionContext;
- MethodBinding previousBinding = this.binding;
- MethodBinding previousDescriptor = this.descriptor;
- TypeBinding previousResolvedType = this.resolvedType;
try {
- setExpressionContext(INVOCATION_CONTEXT);
- setExpectedType(targetType);
- this.binding = null;
- this.trialResolution = true;
- resolveType(this.enclosingScope);
- return this.binding;
+ copy = copy();
+ if (copy == null) { // should never happen even for code assist.
+ return null;
+ }
+ copy.setExpressionContext(this.expressionContext);
+ copy.setExpectedType(targetType);
+ copy.resolveType(this.enclosingScope);
+
+ if (this.copiesPerTargetType == null)
+ this.copiesPerTargetType = new HashMap<TypeBinding, ReferenceExpression>();
+ this.copiesPerTargetType.put(targetType, copy);
+
+ return copy;
} finally {
this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
- // remove *any relevant* traces of this 'inofficial' resolving:
- this.binding = previousBinding;
- this.descriptor = previousDescriptor;
- this.resolvedType = previousResolvedType;
- setExpressionContext(previousContext);
- this.expectedType = null; // don't call setExpectedType(null), would NPE
- this.trialResolution = false;
}
}
+
+ public void registerInferenceContext(ParameterizedGenericMethodBinding method, InferenceContext18 context) {
+ if (this.inferenceContexts == null)
+ this.inferenceContexts = new HashMap<ParameterizedGenericMethodBinding, InferenceContext18>();
+ this.inferenceContexts.put(method, context);
+ }
+
+ public InferenceContext18 getInferenceContext(ParameterizedMethodBinding method) {
+ if (this.inferenceContexts == null)
+ return null;
+ return this.inferenceContexts.get(method);
+ }
+
+ public ReferenceExpression resolveExpressionExpecting(TypeBinding targetType, Scope scope, InferenceContext18 inferenceContext) {
+ if (this.exactMethodBinding != null) { // We may see inference variables in target type.
+ MethodBinding functionType = targetType.getSingleAbstractMethod(scope, true);
+ if (functionType == null)
+ return null;
+ int n = functionType.parameters.length;
+ int k = this.exactMethodBinding.parameters.length;
+ return (n == k || n == k + 1) ? this : null;
+ }
+ // descriptors parameters should be free of inference variables.
+ ReferenceExpression copy = cachedResolvedCopy(targetType);
+ return copy != null && copy.resolvedType != null && copy.resolvedType.isValidBinding() && copy.binding != null && copy.binding.isValidBinding() ? copy : null;
+ }
public boolean isConstructorReference() {
return CharOperation.equals(this.selector, ConstantPool.Init);
@@ -694,6 +858,10 @@
return this.exactMethodBinding != null;
}
+ public MethodBinding getExactMethod() {
+ return this.exactMethodBinding;
+ }
+
public boolean isMethodReference() {
return !CharOperation.equals(this.selector, ConstantPool.Init);
}
@@ -710,7 +878,11 @@
}
public InferenceContext18 freshInferenceContext(Scope scope) {
- return null; // subject to inference only as an argument to an outer invocation
+ if (this.expressionContext != ExpressionContext.VANILLA_CONTEXT) {
+ Expression[] arguments = createPseudoExpressions(this.freeParameters);
+ return new InferenceContext18(scope, arguments, this, null);
+ }
+ return null; // shouldn't happen, actually
}
public boolean isSuperAccess() {
@@ -770,9 +942,7 @@
}
public Expression[] createPseudoExpressions(TypeBinding[] p) {
- if (this.descriptor == null)
- return null;
- // from 15.28.1:
+ // from 15.13.1:
// ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn
// ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn
// (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod)
@@ -785,31 +955,108 @@
return expressions;
}
- public boolean isCompatibleWith(TypeBinding left, Scope scope) {
- if (this.binding != null && this.binding.isValidBinding() // binding indicates if full resolution has already happened
- && this.resolvedType != null && this.resolvedType.isValidBinding()) {
- return this.resolvedType.isCompatibleWith(left, scope);
+ @Override
+ public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope) {
+
+ final boolean isConstructorRef = isConstructorReference();
+ if (isConstructorRef && this.receiverType.isArrayType()) {
+ final TypeBinding leafComponentType = this.receiverType.leafComponentType();
+ if (!leafComponentType.isReifiable()) {
+ return false;
+ }
}
- // 15.28.2
- left = left.uncapture(this.enclosingScope);
- final MethodBinding sam = left.getSingleAbstractMethod(this.enclosingScope, true);
+
+ // We get here only when the reference expression is NOT pertinent to applicability.
+ if (!super.isPertinentToApplicability(targetType, null))
+ return true;
+ final MethodBinding sam = targetType.getSingleAbstractMethod(this.enclosingScope, true);
if (sam == null || !sam.isValidBinding())
return false;
- boolean isCompatible;
- setExpectedType(left);
- IErrorHandlingPolicy oldPolicy = this.enclosingScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
- try {
- this.binding = null;
- this.trialResolution = true;
- resolveType(this.enclosingScope);
- } finally {
- this.enclosingScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
- isCompatible = this.binding != null && this.binding.isValidBinding();
- this.binding = null;
- setExpectedType(null);
- this.trialResolution = false;
+ if (this.typeArgumentsHaveErrors || this.lhs.resolvedType == null || !this.lhs.resolvedType.isValidBinding())
+ return false;
+
+ int parametersLength = sam.parameters.length;
+ TypeBinding[] descriptorParameters = new TypeBinding[parametersLength];
+ for (int i = 0; i < parametersLength; i++) {
+ descriptorParameters[i] = new ReferenceBinding() {
+ {
+ this.compoundName = CharOperation.NO_CHAR_CHAR;
+ }
+ public boolean isCompatibleWith(TypeBinding otherType, Scope captureScope) {
+ return true;
+ }
+ public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) {
+ return otherType;
+ }
+ public String toString() {
+ return "(wildcard)"; //$NON-NLS-1$
+ }
+ };
}
- return isCompatible;
+
+ // 15.13.1
+ this.freeParameters = descriptorParameters;
+ this.checkingPotentialCompatibility = true;
+ try {
+ MethodBinding compileTimeDeclaration = this.exactMethodBinding != null ? this.exactMethodBinding : isConstructorRef
+ ? scope.getConstructor((ReferenceBinding) this.receiverType, descriptorParameters, this)
+ : scope.getMethod(this.receiverType, this.selector, descriptorParameters, this);
+
+ if (compileTimeDeclaration != null && compileTimeDeclaration.isValidBinding()) // we have the mSMB.
+ this.potentialMethods = new MethodBinding [] { compileTimeDeclaration };
+ else {
+ /* We EITHER have potential methods that are input to Scope.mSMb already captured in this.potentialMethods
+ OR there is no potentially compatible compile time declaration ...
+ */
+ }
+
+ /* 15.12.2.1: A method reference expression (§15.13) is potentially compatible with a functional interface type if, where the type's function type arity is n,
+ there exists at least one potentially applicable method for the method reference expression with arity n (§15.13.1), and one of the following is true:
+ – The method reference expression has the form ReferenceType ::[TypeArguments] Identifier and at least one potentially applicable method is
+ i) static and supports arity n, or ii) not static and supports arity n-1.
+ – The method reference expression has some other form and at least one potentially applicable method is not static.
+ */
+
+ for (int i = 0, length = this.potentialMethods.length; i < length; i++) {
+ if (this.potentialMethods[i].isStatic() || this.potentialMethods[i].isConstructor()) {
+ if (!this.haveReceiver) // form ReferenceType ::[TypeArguments] Identifier
+ return true;
+ } else {
+ if (this.haveReceiver) // some other form.
+ return true;
+ }
+ }
+
+ if (this.haveReceiver || parametersLength == 0)
+ return false;
+
+ System.arraycopy(descriptorParameters, 1, descriptorParameters = new TypeBinding[parametersLength - 1], 0, parametersLength - 1);
+ this.freeParameters = descriptorParameters;
+ compileTimeDeclaration = this.exactMethodBinding != null ? this.exactMethodBinding : scope.getMethod(this.receiverType, this.selector, descriptorParameters, this);
+
+ if (compileTimeDeclaration != null && compileTimeDeclaration.isValidBinding()) // we have the mSMB.
+ this.potentialMethods = new MethodBinding [] { compileTimeDeclaration };
+ else {
+ /* We EITHER have potential methods that are input to Scope.mSMb already captured in this.potentialMethods
+ OR there is no potentially compatible compile time declaration ...
+ */
+ }
+ for (int i = 0, length = this.potentialMethods.length; i < length; i++) {
+ if (!this.potentialMethods[i].isStatic()) {
+ return true;
+ }
+ }
+ } finally {
+ this.checkingPotentialCompatibility = false;
+ this.potentialMethods = Binding.NO_METHODS;
+ this.freeParameters = null; // not used after method lookup
+ }
+ return false;
+ }
+
+ public boolean isCompatibleWith(TypeBinding targetType, Scope scope) {
+ ReferenceExpression copy = cachedResolvedCopy(targetType);
+ return copy != null && copy.resolvedType != null && copy.resolvedType.isValidBinding() && copy.binding != null && copy.binding.isValidBinding();
}
public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) {
@@ -820,7 +1067,7 @@
if (this.exactMethodBinding == null || t.findSuperTypeOriginatingFrom(s) != null)
return false;
- s = s.capture(this.enclosingScope, this.sourceEnd);
+ s = s.capture(this.enclosingScope, this.sourceStart, this.sourceEnd);
MethodBinding sSam = s.getSingleAbstractMethod(this.enclosingScope, true);
if (sSam == null || !sSam.isValidBinding())
return false;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
index 1447511..d723536 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,6 +30,10 @@
* Bug 417758 - [1.8][null] Null safety compromise during array creation.
* Bug 427438 - [1.8][compiler] NPE at org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression.generateCode(ConditionalExpression.java:280)
* Bug 430150 - [1.8][null] stricter checking against type variables
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 455723 - Nonnull argument not correctly inferred in loop
* Jesper S Moller - Contributions for
* bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
*******************************************************************************/
@@ -38,7 +42,6 @@
import static org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExpressionContext.ASSIGNMENT_CONTEXT;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
@@ -170,11 +173,15 @@
flowContext.recordAbruptExit();
return FlowInfo.DEAD_END;
}
+@Override
+public boolean doesNotCompleteNormally() {
+ return true;
+}
void checkAgainstNullAnnotation(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo) {
int nullStatus = this.expression.nullStatus(flowInfo, flowContext);
long tagBits;
MethodBinding methodBinding = null;
- boolean useTypeAnnotations = scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean useTypeAnnotations = scope.environment().usesNullTypeAnnotations();
try {
methodBinding = scope.methodScope().referenceMethodBinding();
tagBits = (useTypeAnnotations) ? methodBinding.returnType.tagBits : methodBinding.tagBits;
@@ -188,7 +195,7 @@
} else if (nullStatus != FlowInfo.NON_NULL) {
// if we can't prove non-null check against declared null-ness of the enclosing method:
if ((tagBits & TagBits.AnnotationNonNull) != 0) {
- flowContext.recordNullityMismatch(scope, this.expression, this.expression.resolvedType, methodBinding.returnType, nullStatus);
+ flowContext.recordNullityMismatch(scope, this.expression, this.expression.resolvedType, methodBinding.returnType, flowInfo, nullStatus, null);
}
}
}
@@ -303,6 +310,9 @@
if (this.expression != null) {
this.expression.setExpressionContext(ASSIGNMENT_CONTEXT);
this.expression.setExpectedType(methodType);
+ if (lambda != null && lambda.argumentsTypeElided() && this.expression instanceof CastExpression) {
+ this.expression.bits |= ASTNode.DisableUnnecessaryCastCheck;
+ }
}
if (methodType == TypeBinding.VOID) {
@@ -343,15 +353,20 @@
if (TypeBinding.notEquals(methodType, expressionType)) // must call before computeConversion() and typeMismatchError()
scope.compilationUnitScope().recordTypeConversion(methodType, expressionType);
if (this.expression.isConstantValueOfTypeAssignableToType(expressionType, methodType)
- || expressionType.isCompatibleWith(methodType)) {
+ || expressionType.isCompatibleWith(methodType, scope)) {
this.expression.computeConversion(scope, methodType, expressionType);
if (expressionType.needsUncheckedConversion(methodType)) {
scope.problemReporter().unsafeTypeConversion(this.expression, expressionType, methodType);
}
- if (this.expression instanceof CastExpression
- && (this.expression.bits & (ASTNode.UnnecessaryCast|ASTNode.DisableUnnecessaryCastCheck)) == 0) {
- CastExpression.checkNeedForAssignedCast(scope, methodType, (CastExpression) this.expression);
+ if (this.expression instanceof CastExpression) {
+ if ((this.expression.bits & (ASTNode.UnnecessaryCast|ASTNode.DisableUnnecessaryCastCheck)) == 0) {
+ CastExpression.checkNeedForAssignedCast(scope, methodType, (CastExpression) this.expression);
+ } else if (lambda != null && lambda.argumentsTypeElided() && (this.expression.bits & ASTNode.UnnecessaryCast) != 0) {
+ if (TypeBinding.equalsEquals(((CastExpression)this.expression).expression.resolvedType, methodType)) {
+ scope.problemReporter().unnecessaryCast((CastExpression)this.expression);
+ }
+ }
}
return;
} else if (isBoxingCompatible(expressionType, methodType, this.expression, scope)) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
index d29206d..2c48e9f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,8 @@
* bug 331649 - [compiler][null] consider null annotations for fields
* bug 383368 - [compiler][null] syntactic null analysis for field references
* Bug 412203 - [compiler] Internal compiler error: java.lang.IllegalArgumentException: info cannot be null
+ * Bug 458396 - NPE in CodeStream.invoke()
+ * Bug 407414 - [compiler][null] Incorrect warning on a primitive type being null
* Jesper S Moller - <jesper@selskabet.org> - Contributions for
* bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
* bug 378674 - "The method can be declared as static" is wrong
@@ -207,7 +209,7 @@
public TypeBinding checkFieldAccess(BlockScope scope) {
FieldBinding fieldBinding = (FieldBinding) this.binding;
- this.constant = fieldBinding.constant();
+ this.constant = fieldBinding.constant(scope);
this.bits &= ~ASTNode.RestrictiveFlagMASK; // clear bits
this.bits |= Binding.FIELD;
@@ -272,14 +274,19 @@
public void computeConversion(Scope scope, TypeBinding runtimeTimeType, TypeBinding compileTimeType) {
if (runtimeTimeType == null || compileTimeType == null)
return;
- if ((this.bits & Binding.FIELD) != 0 && this.binding != null && this.binding.isValidBinding()) {
+ if (this.binding != null && this.binding.isValidBinding()) {
+ TypeBinding originalType = null;
+ if ((this.bits & Binding.FIELD) != 0 && (this.binding instanceof FieldBinding)) { // AspectJ extension - - new guard (ajc_aroundClosure does this) ??
// set the generic cast after the fact, once the type expectation is fully known (no need for strict cast)
- if (this.binding instanceof FieldBinding) { // AspectJ Extension - new guard (ajc_aroundClosure does this) ??
FieldBinding field = (FieldBinding) this.binding;
FieldBinding originalBinding = field.original();
- TypeBinding originalType = originalBinding.type;
- // extra cast needed if field type is type variable
- if (originalType.leafComponentType().isTypeVariable()) {
+ originalType = originalBinding.type;
+ } else if ((this.bits & Binding.LOCAL) != 0) {
+ LocalVariableBinding local = (LocalVariableBinding) this.binding;
+ originalType = local.type;
+ }
+ // extra cast needed if field/local type is type variable
+ if (originalType != null && originalType.leafComponentType().isTypeVariable()) {
TypeBinding targetType = (!compileTimeType.isBaseType() && runtimeTimeType.isBaseType())
? compileTimeType // unboxing: checkcast before conversion
: runtimeTimeType;
@@ -294,7 +301,6 @@
ProblemReasons.NotVisible));
}
}
- }// AspectJ Extension - close the new if()
}
}
super.computeConversion(scope, runtimeTimeType, compileTimeType);
@@ -861,6 +867,8 @@
}
public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) {
+ if ((this.implicitConversion & TypeIds.BOXING) != 0)
+ return FlowInfo.NON_NULL;
LocalVariableBinding local = localVariableBinding();
if (local != null) {
return flowInfo.nullStatus(local);
@@ -1018,7 +1026,7 @@
scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
}
variableType = variable.type;
- this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant() : Constant.NotAConstant;
+ this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant(scope) : Constant.NotAConstant;
} else {
// a field
variableType = checkFieldAccess(scope);
@@ -1026,7 +1034,7 @@
// perform capture conversion if read access
if (variableType != null) {
this.resolvedType = variableType = (((this.bits & ASTNode.IsStrictlyAssigned) == 0)
- ? variableType.capture(scope, this.sourceEnd)
+ ? variableType.capture(scope, this.sourceStart, this.sourceEnd)
: variableType);
if ((variableType.tagBits & TagBits.HasMissingType) != 0) {
if ((this.bits & Binding.LOCAL) == 0) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
index 169bb72..26c748a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
@@ -55,6 +55,12 @@
if (typeVariable.declaringElement instanceof SourceTypeBinding) {
scope.tagAsAccessingEnclosingInstanceStateOf((ReferenceBinding) typeVariable.declaringElement, true /* type variable access */);
}
+ } else if (this.resolvedType instanceof LocalTypeBinding) {
+ LocalTypeBinding localType = (LocalTypeBinding) this.resolvedType;
+ MethodScope methodScope = scope.methodScope();
+ if (methodScope != null && !methodScope.isStatic) {
+ methodScope.tagAsAccessingEnclosingInstanceStateOf(localType, false /* ! type variable access */);
+ }
}
if (scope.kind == Scope.CLASS_SCOPE && this.resolvedType.isValidBinding())
@@ -67,6 +73,20 @@
return new char[][] { this.token };
}
+ @Override
+ public boolean isBaseTypeReference() {
+ return this.token == BYTE ||
+ this.token == SHORT ||
+ this.token == INT ||
+ this.token == LONG ||
+ this.token == FLOAT ||
+ this.token == DOUBLE ||
+ this.token == CHAR ||
+ this.token == BOOLEAN ||
+ this.token == NULL ||
+ this.token == VOID;
+ }
+
public StringBuffer printExpression(int indent, StringBuffer output){
if (this.annotations != null && this.annotations[0] != null) {
printAnnotations(this.annotations[0], output);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.java
index 413e10f..e50c640 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Statement.java
@@ -29,12 +29,17 @@
* Bug 418537 - [1.8][null] Fix null type annotation analysis for poly conditional expressions
* Bug 428352 - [1.8][compiler] Resolution errors don't always surface
* Bug 429430 - [1.8] Lambdas and method reference infer wrong exception type with generics (RuntimeException instead of IOException)
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 455723 - Nonnull argument not correctly inferred in loop
* Andy Clement - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
* Bug 409250 - [1.8][compiler] Various loose ends in 308 code generation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
+import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.*;
@@ -77,6 +82,24 @@
}
public abstract FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo);
+/** Lambda shape analysis: *Assuming* this is reachable, analyze if this completes normally i.e control flow can reach the textually next statement.
+ For blocks, we don't perform intra-reachability analysis. We assume the lambda body is free of intrinsic control flow errors (if such errors
+ exist they will not be flagged by this analysis, but are guaranteed to surface later on.)
+
+ @see Block#doesNotCompleteNormally
+*/
+public boolean doesNotCompleteNormally() {
+ return false;
+}
+
+/** Lambda shape analysis: *Assuming* this is reachable, analyze if this completes by continuing i.e control flow cannot reach the textually next statement.
+ This is necessitated by the fact that continue claims to not complete normally. So this is necessary to discriminate between do { continue; } while (false);
+ which completes normally and do { throw new Exception(); } while (false); which does not complete normally.
+*/
+public boolean completesByContinue() {
+ return false;
+}
+
public static final int NOT_COMPLAINED = 0;
public static final int COMPLAINED_FAKE_REACHABLE = 1;
public static final int COMPLAINED_UNREACHABLE = 2;
@@ -90,8 +113,7 @@
CompilerOptions compilerOptions = currentScope.compilerOptions();
if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_7 && methodBinding.isPolymorphic())
return;
- boolean considerTypeAnnotations = compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8
- && compilerOptions.isAnnotationBasedNullAnalysisEnabled;
+ boolean considerTypeAnnotations = currentScope.environment().usesNullTypeAnnotations();
boolean hasJDK15NullAnnotations = methodBinding.parameterNonNullness != null;
int numParamsToCheck = methodBinding.parameters.length;
int varArgPos = -1;
@@ -136,7 +158,7 @@
Expression argument = arguments[i];
int nullStatus = argument.nullStatus(flowInfo, flowContext); // slight loss of precision: should also use the null info from the receiver.
if (nullStatus != FlowInfo.NON_NULL) // if required non-null is not provided
- flowContext.recordNullityMismatch(currentScope, argument, argument.resolvedType, expectedType, nullStatus);
+ flowContext.recordNullityMismatch(currentScope, argument, argument.resolvedType, expectedType, flowInfo, nullStatus, null);
}
}
}
@@ -147,16 +169,16 @@
if (argument instanceof ConditionalExpression && argument.isPolyExpression()) {
// drill into both branches using existing nullStatus per branch:
ConditionalExpression ce = (ConditionalExpression) argument;
- ce.internalAnalyseOneArgument18(currentScope, flowContext, expectedType, ce.valueIfTrue, ce.ifTrueNullStatus, expectedNonNullness, originalExpected);
- ce.internalAnalyseOneArgument18(currentScope, flowContext, expectedType, ce.valueIfFalse, ce.ifFalseNullStatus, expectedNonNullness, originalExpected);
+ ce.internalAnalyseOneArgument18(currentScope, flowContext, expectedType, ce.valueIfTrue, flowInfo, ce.ifTrueNullStatus, expectedNonNullness, originalExpected);
+ ce.internalAnalyseOneArgument18(currentScope, flowContext, expectedType, ce.valueIfFalse, flowInfo, ce.ifFalseNullStatus, expectedNonNullness, originalExpected);
return;
}
int nullStatus = argument.nullStatus(flowInfo, flowContext);
- internalAnalyseOneArgument18(currentScope, flowContext, expectedType, argument, nullStatus,
- expectedNonNullness, originalExpected);
+ internalAnalyseOneArgument18(currentScope, flowContext, expectedType, argument, flowInfo,
+ nullStatus, expectedNonNullness, originalExpected);
}
void internalAnalyseOneArgument18(BlockScope currentScope, FlowContext flowContext, TypeBinding expectedType,
- Expression argument, int nullStatus, Boolean expectedNonNullness, TypeBinding originalExpected)
+ Expression argument, FlowInfo flowInfo, int nullStatus, Boolean expectedNonNullness, TypeBinding originalExpected)
{
// here we consume special case information generated in the ctor of ParameterizedGenericMethodBinding (see there):
int statusFromAnnotatedNull = expectedNonNullness == Boolean.TRUE ? nullStatus : 0;
@@ -166,11 +188,11 @@
if (!annotationStatus.isAnyMismatch() && statusFromAnnotatedNull != 0)
expectedType = originalExpected; // to avoid reports mentioning '@NonNull null'!
- if (annotationStatus.isDefiniteMismatch() || statusFromAnnotatedNull == FlowInfo.NULL) {
+ if (statusFromAnnotatedNull == FlowInfo.NULL) {
// immediate reporting:
currentScope.problemReporter().nullityMismatchingTypeAnnotation(argument, argument.resolvedType, expectedType, annotationStatus);
- } else if (annotationStatus.isUnchecked() || (statusFromAnnotatedNull & FlowInfo.POTENTIALLY_NULL) != 0) {
- flowContext.recordNullityMismatch(currentScope, argument, argument.resolvedType, expectedType, nullStatus);
+ } else if (annotationStatus.isAnyMismatch() || (statusFromAnnotatedNull & FlowInfo.POTENTIALLY_NULL) != 0) {
+ flowContext.recordNullityMismatch(currentScope, argument, argument.resolvedType, expectedType, flowInfo, nullStatus, annotationStatus);
}
}
@@ -178,20 +200,20 @@
if (expression instanceof ConditionalExpression && expression.isPolyExpression()) {
// drill into both branches using existing nullStatus per branch:
ConditionalExpression ce = (ConditionalExpression) expression;
- internalCheckAgainstNullTypeAnnotation(scope, requiredType, ce.valueIfTrue, ce.ifTrueNullStatus, flowContext);
- internalCheckAgainstNullTypeAnnotation(scope, requiredType, ce.valueIfFalse, ce.ifFalseNullStatus, flowContext);
+ internalCheckAgainstNullTypeAnnotation(scope, requiredType, ce.valueIfTrue, ce.ifTrueNullStatus, flowContext, flowInfo);
+ internalCheckAgainstNullTypeAnnotation(scope, requiredType, ce.valueIfFalse, ce.ifFalseNullStatus, flowContext, flowInfo);
return;
}
int nullStatus = expression.nullStatus(flowInfo, flowContext);
- internalCheckAgainstNullTypeAnnotation(scope, requiredType, expression, nullStatus, flowContext);
+ internalCheckAgainstNullTypeAnnotation(scope, requiredType, expression, nullStatus, flowContext, flowInfo);
}
private void internalCheckAgainstNullTypeAnnotation(BlockScope scope, TypeBinding requiredType, Expression expression,
- int nullStatus, FlowContext flowContext) {
+ int nullStatus, FlowContext flowContext, FlowInfo flowInfo) {
NullAnnotationMatching annotationStatus = NullAnnotationMatching.analyse(requiredType, expression.resolvedType, nullStatus);
if (annotationStatus.isDefiniteMismatch()) {
scope.problemReporter().nullityMismatchingTypeAnnotation(expression, expression.resolvedType, requiredType, annotationStatus);
} else if (annotationStatus.isUnchecked()) {
- flowContext.recordNullityMismatch(scope, expression, expression.resolvedType, requiredType, nullStatus);
+ flowContext.recordNullityMismatch(scope, expression, expression.resolvedType, requiredType, flowInfo, nullStatus, annotationStatus);
}
}
@@ -203,6 +225,52 @@
// do nothing by default
}
+// Inspect AST nodes looking for a break statement, descending into nested control structures only when necessary (looking for a break with a specific label.)
+public boolean breaksOut(final char[] label) {
+ return new ASTVisitor() {
+
+ boolean breaksOut;
+ public boolean visit(TypeDeclaration type, BlockScope skope) { return label != null; }
+ public boolean visit(TypeDeclaration type, ClassScope skope) { return label != null; }
+ public boolean visit(LambdaExpression lambda, BlockScope skope) { return label != null;}
+ public boolean visit(WhileStatement whileStatement, BlockScope skope) { return label != null; }
+ public boolean visit(DoStatement doStatement, BlockScope skope) { return label != null; }
+ public boolean visit(ForeachStatement foreachStatement, BlockScope skope) { return label != null; }
+ public boolean visit(ForStatement forStatement, BlockScope skope) { return label != null; }
+ public boolean visit(SwitchStatement switchStatement, BlockScope skope) { return label != null; }
+
+ public boolean visit(BreakStatement breakStatement, BlockScope skope) {
+ if (label == null || CharOperation.equals(label, breakStatement.label))
+ this.breaksOut = true;
+ return false;
+ }
+
+ public boolean breaksOut() {
+ Statement.this.traverse(this, null);
+ return this.breaksOut;
+ }
+ }.breaksOut();
+}
+
+/* Inspect AST nodes looking for a continue statement with a label, descending into nested control structures.
+ The label is presumed to be NOT attached to this. This condition is certainly true for lambda shape analysis
+ where this analysis triggers only from do {} while (false); situations. See LabeledStatement.continuesAtOuterLabel
+*/
+public boolean continuesAtOuterLabel() {
+ return new ASTVisitor() {
+ boolean continuesToLabel;
+ public boolean visit(ContinueStatement continueStatement, BlockScope skope) {
+ if (continueStatement.label != null)
+ this.continuesToLabel = true;
+ return false;
+ }
+ public boolean continuesAtOuterLabel() {
+ Statement.this.traverse(this, null);
+ return this.continuesToLabel;
+ }
+ }.continuesAtOuterLabel();
+}
+
// Report an error if necessary (if even more unreachable than previously reported
// complaintLevel = 0 if was reachable up until now, 1 if fake reachable (deadcode), 2 if fatal unreachable (error)
public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int previousComplaintLevel, boolean endOfBlock) {
@@ -363,16 +431,4 @@
resolvePolyExpressionArguments(site, ctorBinding, argumentTypes, scope);
return ctorBinding;
}
-/**
- * If an exception-throwing statement is resolved within the scope of a lambda, record the exception type(s).
- * It is likely wrong to do this during resolve, should probably use precise flow information.
- */
-protected void recordExceptionsForEnclosingLambda(BlockScope scope, TypeBinding... thrownExceptions) {
- MethodScope methodScope = scope.methodScope();
- if (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
- LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
- for (int i = 0; i < thrownExceptions.length; i++)
- lambda.throwsException(thrownExceptions[i]);
- }
-}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java
index cacb260..7fca427 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.StringConstant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
public class StringLiteral extends Literal {
@@ -77,34 +78,7 @@
// handle some special char.....
output.append('\"');
for (int i = 0; i < this.source.length; i++) {
- switch (this.source[i]) {
- case '\b' :
- output.append("\\b"); //$NON-NLS-1$
- break;
- case '\t' :
- output.append("\\t"); //$NON-NLS-1$
- break;
- case '\n' :
- output.append("\\n"); //$NON-NLS-1$
- break;
- case '\f' :
- output.append("\\f"); //$NON-NLS-1$
- break;
- case '\r' :
- output.append("\\r"); //$NON-NLS-1$
- break;
- case '\"' :
- output.append("\\\""); //$NON-NLS-1$
- break;
- case '\'' :
- output.append("\\'"); //$NON-NLS-1$
- break;
- case '\\' : //take care not to display the escape as a potential real char
- output.append("\\\\"); //$NON-NLS-1$
- break;
- default :
- output.append(this.source[i]);
- }
+ Util.appendEscapedChar(output, this.source[i], true);
}
output.append('\"');
return output;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
index 63e1637..ebc45e1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
@@ -20,11 +20,24 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.*;
-import org.aspectj.org.eclipse.jdt.internal.compiler.flow.*;
+import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
+import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CaseLabel;
+import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream;
+import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.Opcodes;
+import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowContext;
+import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowInfo;
+import org.aspectj.org.eclipse.jdt.internal.compiler.flow.SwitchFlowContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.*;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
@SuppressWarnings("rawtypes")
@@ -301,10 +314,7 @@
defaultBranchLabel.place();
}
codeStream.recordPositionsFrom(pc, this.sourceStart);
-// } catch (Throwable e) {
-// e.printStackTrace();
- }
- finally {
+ } finally {
if (this.scope != null) this.scope.enclosingCase = null; // no longer inside switch case block
}
}
@@ -639,4 +649,26 @@
label.becomeDelegateFor(this.breakLabel);
}
}
+
+ @Override
+ public boolean doesNotCompleteNormally() {
+ if (this.statements == null || this.statements.length == 0)
+ return false;
+ for (int i = 0, length = this.statements.length; i < length; i++) {
+ if (this.statements[i].breaksOut(null))
+ return false;
+ }
+ return this.statements[this.statements.length - 1].doesNotCompleteNormally();
+ }
+
+ @Override
+ public boolean completesByContinue() {
+ if (this.statements == null || this.statements.length == 0)
+ return false;
+ for (int i = 0, length = this.statements.length; i < length; i++) {
+ if (this.statements[i].completesByContinue())
+ return true;
+ }
+ return false;
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
index 6f36312..55670e6 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java
@@ -213,4 +213,13 @@
}
visitor.endVisit(this, blockScope);
}
+
+@Override
+public boolean doesNotCompleteNormally() {
+ return this.block.doesNotCompleteNormally();
+}
+@Override
+public boolean completesByContinue() {
+ return this.block.completesByContinue();
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java
index 21b56eb..d9ca2fe 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java
@@ -68,7 +68,6 @@
public void resolve(BlockScope scope) {
this.exceptionType = this.exception.resolveType(scope);
- recordExceptionsForEnclosingLambda(scope, this.exceptionType);
if (this.exceptionType != null && this.exceptionType.isValidBinding()) {
if (this.exceptionType == TypeBinding.NULL) {
if (scope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_3){
@@ -87,4 +86,9 @@
this.exception.traverse(visitor, blockScope);
visitor.endVisit(this, blockScope);
}
+
+@Override
+public boolean doesNotCompleteNormally() {
+ return true;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
index c827a92..51e2dd0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,9 @@
* bug 401092 - [compiler][null] Wrong warning "Redundant null check" in outer catch of nested try
* bug 402993 - [null] Follow up of bug 401088: Missing warning about redundant null check
* bug 384380 - False positive on a ?? Potential null pointer access ?? after a continue
+ * Bug 415790 - [compiler][resource]Incorrect potential resource leak warning in for loop with close in try/catch
+ * Bug 371614 - [compiler][resource] Wrong "resource leak" problem on return/throw inside while loop
+ * Bug 444964 - [1.7+][resource] False resource leak warning (try-with-resources for ByteArrayOutputStream - return inside for loop)
* Jesper Steen Moller - Contributions for
* bug 404146 - [1.7][compiler] nested try-catch-finally-blocks leads to unrunnable Java byte code
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
@@ -150,8 +153,8 @@
resourceBinding.useFlag = LocalVariableBinding.USED; // Is implicitly used anyways.
if (resourceBinding.closeTracker != null) {
// this was false alarm, we don't need to track the resource
- this.tryBlock.scope.removeTrackingVar(resourceBinding.closeTracker);
- // keep the tracking variable in the resourceBinding in order to prevent creating a new one while analyzing the try block
+ resourceBinding.closeTracker.withdraw();
+ resourceBinding.closeTracker = null;
}
MethodBinding closeMethod = findCloseMethod(resource, resourceBinding);
if (closeMethod != null && closeMethod.isValidBinding() && closeMethod.returnType.id == TypeIds.T_void) {
@@ -264,7 +267,7 @@
resourceBinding.useFlag = LocalVariableBinding.USED; // Is implicitly used anyways.
if (resourceBinding.closeTracker != null) {
// this was false alarm, we don't need to track the resource
- this.tryBlock.scope.removeTrackingVar(resourceBinding.closeTracker);
+ resourceBinding.closeTracker.withdraw();
// keep the tracking variable in the resourceBinding in order to prevent creating a new one while analyzing the try block
}
MethodBinding closeMethod = findCloseMethod(resource, resourceBinding);
@@ -372,29 +375,14 @@
addNullInfoFrom(handlingContext.initsOnFinally);
} else {
FlowInfo initsOnException = handlingContext.initsOnException(i);
- if ((handlingContext.tagBits & (FlowContext.DEFER_NULL_DIAGNOSTIC | FlowContext.PREEMPT_NULL_DIAGNOSTIC))
- == FlowContext.DEFER_NULL_DIAGNOSTIC)
- {
- // if null diagnostics are being deferred, initsOnException are incomplete,
- // need to start with the more accurate upstream flowInfo
- catchInfo =
- flowInfo.unconditionalCopy()
- .addPotentialInitializationsFrom(initsOnException)
- .addPotentialInitializationsFrom(
- tryInfo.unconditionalCopy())
- .addPotentialInitializationsFrom(
- handlingContext.initsOnReturn.nullInfoLessUnconditionalCopy());
- } else {
- // here initsOnException are precise, so use them as the only source for null information into the catch block:
- catchInfo =
- flowInfo.nullInfoLessUnconditionalCopy()
- .addPotentialInitializationsFrom(initsOnException)
- .addNullInfoFrom(initsOnException)
- .addPotentialInitializationsFrom(
- tryInfo.nullInfoLessUnconditionalCopy())
- .addPotentialInitializationsFrom(
- handlingContext.initsOnReturn.nullInfoLessUnconditionalCopy());
- }
+ catchInfo =
+ flowInfo.nullInfoLessUnconditionalCopy()
+ .addPotentialInitializationsFrom(initsOnException)
+ .addNullInfoFrom(initsOnException) // <<== Null info only from here!
+ .addPotentialInitializationsFrom(
+ tryInfo.nullInfoLessUnconditionalCopy())
+ .addPotentialInitializationsFrom(
+ handlingContext.initsOnReturn.nullInfoLessUnconditionalCopy());
}
// catch var is always set
@@ -1210,4 +1198,34 @@
}
}
}
+@Override
+public boolean doesNotCompleteNormally() {
+ if (!this.tryBlock.doesNotCompleteNormally()) {
+ return (this.finallyBlock != null) ? this.finallyBlock.doesNotCompleteNormally() : false;
+ }
+ if (this.catchBlocks != null) {
+ for (int i = 0; i < this.catchBlocks.length; i++) {
+ if (!this.catchBlocks[i].doesNotCompleteNormally()) {
+ return (this.finallyBlock != null) ? this.finallyBlock.doesNotCompleteNormally() : false;
+ }
+ }
+ }
+ return true;
+}
+@Override
+public boolean completesByContinue() {
+ if (this.tryBlock.completesByContinue()) {
+ return (this.finallyBlock == null) ? true :
+ !this.finallyBlock.doesNotCompleteNormally() || this.finallyBlock.completesByContinue();
+ }
+ if (this.catchBlocks != null) {
+ for (int i = 0; i < this.catchBlocks.length; i++) {
+ if (this.catchBlocks[i].completesByContinue()) {
+ return (this.finallyBlock == null) ? true :
+ !this.finallyBlock.doesNotCompleteNormally() || this.finallyBlock.completesByContinue();
+ }
+ }
+ }
+ return this.finallyBlock != null && this.finallyBlock.completesByContinue();
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 9ac0e41..4c092e4 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
* Bug 416176 - [1.8][compiler][null] null type annotations cause grief on type variables
* Bug 424727 - [compiler][null] NullPointerException in nullAnnotationUnsupportedLocation(ProblemReporter.java:5708)
+ * Bug 457210 - [1.8][compiler][null] Wrong Nullness errors given on full build build but not on incremental build?
* Keigo Imai - Contribution for bug 388903 - Cannot extend inner class as an anonymous class when it extends the outer class
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -1026,14 +1027,7 @@
return;
}
try {
- boolean old = this.staticInitializerScope.insideTypeAnnotation;
- try {
- this.staticInitializerScope.insideTypeAnnotation = true;
- resolveAnnotations(this.staticInitializerScope, this.annotations, sourceType);
- } finally {
- this.staticInitializerScope.insideTypeAnnotation = old;
- }
- // check @Deprecated annotation
+ // resolve annotations and check @Deprecated annotation
long annotationTagBits = sourceType.getAnnotationTagBits();
if ((annotationTagBits & TagBits.AnnotationDeprecated) == 0
&& (sourceType.modifiers & ClassFileConstants.AccDeprecated) != 0
@@ -1045,19 +1039,6 @@
this.scope.problemReporter().notAFunctionalInterface(this);
}
}
- if (this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8) {
- if ((annotationTagBits & TagBits.AnnotationNullMASK) != 0) {
- for (int i = 0; i < this.annotations.length; i++) {
- ReferenceBinding annotationType = this.annotations[i].getCompilerAnnotation().getAnnotationType();
- if (annotationType != null) {
- if (annotationType.id == TypeIds.T_ConfiguredAnnotationNonNull
- || annotationType.id == TypeIds.T_ConfiguredAnnotationNullable)
- this.scope.problemReporter().nullAnnotationUnsupportedLocation(this.annotations[i]);
- sourceType.tagBits &= ~TagBits.AnnotationNullMASK;
- }
- }
- }
- }
if ((this.bits & ASTNode.UndocumentedEmptyBlock) != 0) {
this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
index 8cad7d4..0cc94cf 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,9 @@
* Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 437072 - [compiler][null] Null analysis emits possibly incorrect warning for new int[][] despite @NonNullByDefault
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
* Bug 409236 - [1.8][compiler] Type annotations on intersection cast types dropped by code generator
@@ -33,7 +36,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.CheckMode;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.AnnotationContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.flow.FlowContext;
@@ -59,6 +61,24 @@
@SuppressWarnings({"rawtypes", "unchecked"})
public abstract class TypeReference extends Expression {
public static final TypeReference[] NO_TYPE_ARGUMENTS = new TypeReference[0];
+
+ /**
+ * Simplified specification of where in a (possibly complex) type reference
+ * we are looking for type annotations.
+ * @see TypeReference#hasNullTypeAnnotation(AnnotationPosition)
+ */
+ public static enum AnnotationPosition {
+ /**
+ * For arrays: the outermost dimension, for parameterized types the type, for nested types the innermost type.
+ * This is the level that a declaration annotation would apply to.
+ */
+ MAIN_TYPE,
+ /** For arrays: the leaf component type, else like MAIN_TYPE. */
+ LEAF_TYPE,
+ /** Any position admitting type annotations. */
+ ANY
+ }
+
static class AnnotationCollector extends ASTVisitor {
List annotationContexts;
Expression typeReference;
@@ -659,9 +679,7 @@
}
/** Check all typeArguments against null constraints on their corresponding type variables. */
protected void checkNullConstraints(Scope scope, TypeReference[] typeArguments) {
- CompilerOptions compilerOptions = scope.compilerOptions();
- if (compilerOptions.isAnnotationBasedNullAnalysisEnabled
- && compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8
+ if (scope.environment().usesNullTypeAnnotations()
&& typeArguments != null)
{
TypeVariableBinding[] typeVariables = this.resolvedType.original().typeVariables();
@@ -681,6 +699,9 @@
scope.problemReporter().nullityMismatchTypeArgument(variable, this.resolvedType, this);
}
}
+ if (this.resolvedType.leafComponentType().isBaseType() && hasNullTypeAnnotation(AnnotationPosition.LEAF_TYPE)) {
+ scope.problemReporter().illegalAnnotationForBaseType(this, this.annotations[0], this.resolvedType.tagBits & TagBits.AnnotationNullMASK);
+ }
}
/** Retrieve the null annotation that has been translated to the given nullTagBits. */
public Annotation findAnnotation(long nullTagBits) {
@@ -698,12 +719,18 @@
}
return null;
}
-public boolean hasNullTypeAnnotation() {
+public boolean hasNullTypeAnnotation(AnnotationPosition position) {
if (this.annotations != null) {
+ if (position == AnnotationPosition.MAIN_TYPE) {
Annotation[] innerAnnotations = this.annotations[this.annotations.length-1];
- if (containsNullAnnotation(innerAnnotations))
+ return containsNullAnnotation(innerAnnotations);
+ } else {
+ for (Annotation[] someAnnotations: this.annotations) {
+ if (containsNullAnnotation(someAnnotations))
return true;
}
+ }
+ }
return false;
}
public static boolean containsNullAnnotation(Annotation[] annotations) {
@@ -721,4 +748,8 @@
public TypeReference[] getTypeReferences() {
return new TypeReference [] { this };
}
+
+public boolean isBaseTypeReference() {
+ return false;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
index 14bc4a9..8a39768 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
+ * Bug 415790 - [compiler][resource]Incorrect potential resource leak warning in for loop with close in try/catch
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -145,8 +146,9 @@
}
if (loopingContext.hasEscapingExceptions()) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=321926
FlowInfo loopbackFlowInfo = flowInfo.copy();
- if (this.continueLabel != null) { // we do get to the bottom
- loopbackFlowInfo.mergedWith(actionInfo.unconditionalCopy());
+ if (this.continueLabel != null) { // we do get to the bottom
+ // loopback | (loopback + action):
+ loopbackFlowInfo = loopbackFlowInfo.mergedWith(loopbackFlowInfo.unconditionalCopy().addNullInfoFrom(actionInfo).unconditionalInits());
}
loopingContext.simulateThrowAfterLoopBack(loopbackFlowInfo);
}
@@ -285,4 +287,18 @@
}
visitor.endVisit(this, blockScope);
}
+
+ @Override
+ public boolean doesNotCompleteNormally() {
+ Constant cst = this.condition.constant;
+ boolean isConditionTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
+ cst = this.condition.optimizedBooleanConstant();
+ boolean isConditionOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
+ return (isConditionTrue || isConditionOptimizedTrue) && (this.action == null || !this.action.breaksOut(null));
+ }
+
+ @Override
+ public boolean completesByContinue() {
+ return this.action.continuesAtOuterLabel();
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
index fe78e6b..d2984c8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
@@ -14,6 +14,7 @@
* Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 440462 - [null][compiler]NPE in EJC for erroneous null annotations
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.ast;
@@ -77,7 +78,7 @@
if (((boundType.tagBits | this.resolvedType.tagBits) & TagBits.AnnotationNullMASK) == TagBits.AnnotationNullMASK) { // are both set?
Annotation annotation = this.bound.findAnnotation(boundType.tagBits & TagBits.AnnotationNullMASK);
if (annotation == null) { // false alarm, implicit annotation is no conflict, but should be removed:
- TypeBinding newBound = boundType.unannotated(true);
+ TypeBinding newBound = boundType.withoutToplevelNullAnnotation();
((WildcardBinding)this.resolvedType).bound = newBound;
this.bound.resolvedType = newBound;
} else {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/BatchCompilerRequestor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/BatchCompilerRequestor.java
new file mode 100644
index 0000000..82694ba
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/BatchCompilerRequestor.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gauthier JACQUES - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.compiler.batch;
+
+import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ICompilerRequestor;
+
+public class BatchCompilerRequestor implements ICompilerRequestor {
+
+ private Main compiler;
+ private int lineDelta = 0;
+
+ public BatchCompilerRequestor(Main compiler) {
+ this.compiler = compiler;
+ }
+
+ @Override
+ public void acceptResult(CompilationResult compilationResult) {
+ if (compilationResult.lineSeparatorPositions != null) {
+ int unitLineCount = compilationResult.lineSeparatorPositions.length;
+ this.lineDelta += unitLineCount;
+ if (this.compiler.showProgress && this.lineDelta > 2000) {
+ // in -log mode, dump a dot every 2000 lines compiled
+ this.compiler.logger.logProgress();
+ this.lineDelta = 0;
+ }
+ }
+ this.compiler.logger.startLoggingSource(compilationResult);
+ if (compilationResult.hasProblems() || compilationResult.hasTasks()) {
+ this.compiler.logger.logProblems(compilationResult.getAllProblems(), compilationResult.compilationUnit.getContents(), this.compiler);
+ reportProblems(compilationResult);
+ }
+ this.compiler.outputClassFiles(compilationResult);
+ this.compiler.logger.endLoggingSource();
+ }
+
+ protected void reportProblems(CompilationResult result) {
+ // Nothing to do
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
index e03023a..c24c043 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440687 - [compiler][batch][null] improve command line option for external annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.batch;
@@ -16,12 +18,22 @@
import java.util.Hashtable;
import java.util.List;
+import org.aspectj.org.eclipse.jdt.core.JavaCore;
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.DefaultErrorHandlingPolicies;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
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.classfmt.ExternalAnnotationProvider;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
+import org.aspectj.org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
+import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
@SuppressWarnings({"rawtypes", "unchecked"})
@@ -31,6 +43,7 @@
private String[] missingPackageHolder = new String[1];
private int mode; // ability to only consider one kind of files (source vs. binaries), by default use both
private String encoding; // only useful if referenced in the source path
+private Hashtable<String, Hashtable<String, String>> packageSecondaryTypes = null;
ClasspathDirectory(File directory, String encoding, int mode,
AccessRuleSet accessRuleSet, String destinationPath) {
@@ -135,6 +148,78 @@
}
return null;
}
+public NameEnvironmentAnswer findSecondaryInClass(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName) {
+ boolean sourceExists = isPackage(qualifiedPackageName) && ((this.mode & SOURCE) != 0) && doesFileExist( new String(typeName) + SUFFIX_STRING_java, qualifiedPackageName);
+ return sourceExists ? null : findSourceSecondaryType(typeName, qualifiedPackageName, qualifiedBinaryFileName); /* only secondary types */
+}
+
+@Override
+public boolean hasAnnotationFileFor(String qualifiedTypeName) {
+ int pos = qualifiedTypeName.lastIndexOf('/');
+ if (pos != -1 && (pos + 1 < qualifiedTypeName.length())) {
+ String fileName = qualifiedTypeName.substring(pos + 1) + '.' + ExternalAnnotationProvider.ANNOTION_FILE_EXTENSION;
+ return doesFileExist(fileName, qualifiedTypeName.substring(0, pos));
+ }
+ return false;
+}
+
+
+/**
+ * Add all the secondary types in the package
+ */
+private Hashtable<String, String> getPackageTypes(char[] typeName, String qualifiedPackageName) {
+ Hashtable<String, String> packageEntry = new Hashtable<String, String>();
+
+ String[] dirList = (String[]) this.directoryCache.get(qualifiedPackageName);
+ if (dirList == this.missingPackageHolder // package exists in another classpath directory or jar
+ || dirList == null)
+ return packageEntry;
+
+ File dir = new File(this.path + qualifiedPackageName);
+ File[] listFiles = dir.isDirectory() ? dir.listFiles() : null;
+ if (listFiles == null) return packageEntry;
+
+ for (int i = 0, l = listFiles.length; i < l; ++i) {
+ File f = listFiles[i];
+ if (f.isDirectory()) continue;
+ String s = f.getAbsolutePath();
+ if (s == null) continue;
+ CompilationUnit cu = new CompilationUnit(null, s, this.encoding, this.destinationPath);
+ CompilationResult compilationResult = new CompilationResult(cu.getContents(), 1, 1, 10);
+ ProblemReporter problemReporter =
+ new ProblemReporter(
+ DefaultErrorHandlingPolicies.proceedWithAllProblems(),
+ new CompilerOptions(JavaCore.getOptions()),
+ new DefaultProblemFactory());
+ Parser parser = new Parser(problemReporter, false);
+
+ CompilationUnitDeclaration unit = parser.parse(cu, compilationResult);
+ org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] types = unit != null ? unit.types : null;
+ if (types == null) continue;
+ for (int j = 0, k = types.length; j < k; j++) {
+ TypeDeclaration type = types[j];
+ char[] name = type.isSecondary() ? type.name : null; // add only secondary types
+ if (name != null)
+ packageEntry.put(new String(name), s);
+ }
+ }
+ return packageEntry;
+}
+private NameEnvironmentAnswer findSourceSecondaryType(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName) {
+
+ if (this.packageSecondaryTypes == null) this.packageSecondaryTypes = new Hashtable<String, Hashtable<String,String>>();
+ Hashtable<String, String> packageEntry = this.packageSecondaryTypes.get(qualifiedPackageName);
+ if (packageEntry == null) {
+ packageEntry = getPackageTypes(typeName, qualifiedPackageName);
+ this.packageSecondaryTypes.put(qualifiedPackageName, packageEntry);
+ }
+ String fileName = packageEntry.get(new String(typeName));
+ return fileName != null ? new NameEnvironmentAnswer(new CompilationUnit(null,
+ fileName, this.encoding, this.destinationPath),
+ fetchAccessRestriction(qualifiedBinaryFileName)) : null;
+}
+
+
public char[][][] findTypeNames(String qualifiedPackageName) {
if (!isPackage(qualifiedPackageName)) {
return null; // most common case
@@ -144,7 +229,7 @@
return null;
}
String[] listFiles = dir.list(new FilenameFilter() {
- public boolean accept(File directory, String name) {
+ public boolean accept(File directory1, String name) {
String fileName = name.toLowerCase();
return fileName.endsWith(".class") || fileName.endsWith(".java"); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
index ab2e26a..43f6225 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
+ * Bug 440687 - [compiler][batch][null] improve command line option for external annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.batch;
@@ -28,9 +31,11 @@
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
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.classfmt.ExternalAnnotationProvider;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.ManifestAnalyzer;
+import org.aspectj.org.eclipse.jdt.internal.compiler.util.SuffixConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
@SuppressWarnings({"rawtypes", "unchecked"})
@@ -60,8 +65,10 @@
protected File file;
protected ZipFile zipFile;
+protected ZipFile annotationZipFile;
protected boolean closeZipFileAtEnd;
protected Hashtable packageCache;
+protected List<String> annotationPaths;
// AspectJ Extension
@@ -132,8 +139,21 @@
try {
ensureOpen(); // AspectJ Extension
ClassFileReader reader = ClassFileReader.read(this.zipFile, qualifiedBinaryFileName);
- if (reader != null)
+ if (reader != null) {
+ if (this.annotationPaths != null) {
+ String qualifiedClassName = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length()-SuffixConstants.EXTENSION_CLASS.length()-1);
+ for (String annotationPath : this.annotationPaths) {
+ try {
+ this.annotationZipFile = reader.setExternalAnnotationProvider(annotationPath, qualifiedClassName, this.annotationZipFile, null);
+ if (reader.hasAnnotationProvider())
+ break;
+ } catch (IOException e) {
+ // don't let error on annotations fail class reading
+ }
+ }
+ }
return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName));
+ }
} catch(ClassFormatException e) {
// treat as if class file is missing
} catch (IOException e) {
@@ -141,6 +161,10 @@
}
return null;
}
+@Override
+public boolean hasAnnotationFileFor(String qualifiedTypeName) {
+ return this.zipFile.getEntry(qualifiedTypeName+'.'+ExternalAnnotationProvider.ANNOTION_FILE_EXTENSION) != null;
+}
public char[][][] findTypeNames(String qualifiedPackageName) {
if (!isPackage(qualifiedPackageName))
return null; // most common case
@@ -224,18 +248,28 @@
return this.packageCache.containsKey(qualifiedPackageName);
}
public void reset() {
- if (this.zipFile != null && this.closeZipFileAtEnd) {
+ if (this.closeZipFileAtEnd) {
+ if (this.zipFile != null) {
// AspectJ Extension
- // old code:
- //try {
- // this.zipFile.close(); // AspectJ Extension - dont do this
- //} catch(IOException e) {
- // // ignore
- //}
- //this.zipFile = null;
- // new code:
+ /*old code:{
+ try {
+ this.zipFile.close();
+ } catch(IOException e) {
+ // ignore
+ }
+ this.zipFile = null;
+ */// new code:
close();
// End AspectJ Extension
+ }
+ if (this.annotationZipFile != null) {
+ try {
+ this.annotationZipFile.close();
+ } catch(IOException e) {
+ // ignore
+ }
+ this.annotationZipFile = null;
+ }
}
this.packageCache = null;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
index 6e8c78b..84cec21 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,11 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440687 - [compiler][batch][null] improve command line option for external annotations
*******************************************************************************/
+// AspectJ
+
package org.aspectj.org.eclipse.jdt.internal.compiler.batch;
import java.io.File;
@@ -20,6 +24,7 @@
import java.util.zip.ZipFile;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.AccessRuleSet;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
@@ -69,6 +74,11 @@
* Initialize the entry
*/
void initialize() throws IOException;
+ /**
+ * Can the current location provide an external annotation file for the given type?
+ * @param qualifiedTypeName type name in qualified /-separated notation.
+ */
+ boolean hasAnnotationFileFor(String qualifiedTypeName);
}
public interface ClasspathSectionProblemReporter {
void invalidClasspathSection(String jarFilePath);
@@ -104,6 +114,7 @@
protected Classpath[] classpaths;
Set knownFileNames;
+ protected boolean annotationsFromClasspath; // should annotation files be read from the classpath (vs. explicit separate path)?
/*
classPathNames is a collection is Strings representing the full path of each class path
@@ -128,7 +139,7 @@
}
initializeKnownFileNames(initialFileNames);
}
-protected FileSystem(Classpath[] paths, String[] initialFileNames) {
+protected FileSystem(Classpath[] paths, String[] initialFileNames, boolean annotationsFromClasspath) {
final int length = paths.length;
int counter = 0;
this.classpaths = new FileSystem.Classpath[length];
@@ -146,6 +157,7 @@
System.arraycopy(this.classpaths, 0, (this.classpaths = new FileSystem.Classpath[counter]), 0, counter);
}
initializeKnownFileNames(initialFileNames);
+ this.annotationsFromClasspath = annotationsFromClasspath;
}
public static Classpath getClasspath(String classpathName, String encoding, AccessRuleSet accessRuleSet) {
return getClasspath(classpathName, encoding, false, accessRuleSet, null);
@@ -179,8 +191,7 @@
// New AspectJ Extension
// old code:
// isSourceOnly ? ClasspathLocation.SOURCE :
-// ClasspathLocation.SOURCE |
-// ClasspathLocation.BINARY,
+// ClasspathLocation.SOURCE | ClasspathLocation.BINARY,
// new code:
mode,
// End AspectJ Extension
@@ -295,6 +306,24 @@
: path.replace('/', '\\');
}
private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeName, boolean asBinaryOnly){
+ NameEnvironmentAnswer answer = internalFindClass(qualifiedTypeName, typeName, asBinaryOnly);
+ if (this.annotationsFromClasspath && answer != null && answer.getBinaryType() instanceof ClassFileReader) {
+ for (int i = 0, length = this.classpaths.length; i < length; i++) {
+ Classpath classpathEntry = this.classpaths[i];
+ if (classpathEntry.hasAnnotationFileFor(qualifiedTypeName)) {
+ ZipFile zip = classpathEntry instanceof ClasspathJar ? ((ClasspathJar) classpathEntry).zipFile : null;
+ try {
+ ((ClassFileReader) answer.getBinaryType()).setExternalAnnotationProvider(classpathEntry.getPath(), qualifiedTypeName, zip, null);
+ break;
+ } catch (IOException e) {
+ // ignore broken entry, keep searching
+ }
+ }
+ }
+ }
+ return answer;
+}
+private NameEnvironmentAnswer internalFindClass(String qualifiedTypeName, char[] typeName, boolean asBinaryOnly){
if (this.knownFileNames.contains(qualifiedTypeName)) return null; // looking for a file which we know was provided at the beginning of the compilation
String qualifiedBinaryFileName = qualifiedTypeName + SUFFIX_STRING_class;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.java
index e23a578..3d9c50b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,9 @@
* bug 375366 - ECJ ignores unusedParameterIncludeDocCommentReference unless enableJavadoc option is set
* bug 388281 - [compiler][null] inheritance of null annotations as an option
* bug 381443 - [compiler][null] Allow parameter widening from @NonNull to unannotated
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
+ * Bug 440687 - [compiler][batch][null] improve command line option for external annotations
+ * Bug 408815 - [batch][null] Add CLI option for COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS
* Jesper S Moller - Contributions for
* bug 407297 - [1.8][compiler] Control generation of parameter names by option
* Mat Booth - Contribution for bug 405176
@@ -1293,6 +1296,10 @@
return bundle;
}
}
+
+ // used with -annotationpath to declare that annotations should be read from the classpath:
+ private static final String ANNOTATION_SOURCE_CLASSPATH = "CLASSPATH"; //$NON-NLS-1$
+
// javadoc analysis tuning
boolean enableJavadocOn;
@@ -1303,6 +1310,9 @@
/* Bundle containing messages */
public ResourceBundle bundle;
protected FileSystem.Classpath[] checkedClasspaths;
+ // paths to external annotations:
+ protected List<String> annotationPaths;
+ protected boolean annotationsFromClasspath;
public Locale compilerLocale;
public CompilerOptions compilerOptions; // read-only
@@ -1694,7 +1704,6 @@
* Low-level API performing the actual compilation
*/
public boolean compile(String[] argv) {
-
// decode command line arguments
try {
configure(argv);
@@ -1784,6 +1793,7 @@
final int INSIDE_S_start = 19;
final int INSIDE_CLASS_NAMES = 20;
final int INSIDE_WARNINGS_PROPERTIES = 21;
+ final int INSIDE_ANNOTATIONPATH_start = 22;
final int DEFAULT = 0;
ArrayList bootclasspaths = new ArrayList(DEFAULT_SIZE_CLASSPATH);
@@ -1792,6 +1802,8 @@
ArrayList classpaths = new ArrayList(DEFAULT_SIZE_CLASSPATH);
ArrayList extdirsClasspaths = null;
ArrayList endorsedDirClasspaths = null;
+ this.annotationPaths = null;
+ this.annotationsFromClasspath = false;
int index = -1;
int filesCount = 0;
@@ -2226,6 +2238,13 @@
CompilerOptions.GENERATE);
continue;
}
+ if (currentArg.equals("-genericsignature")) { //$NON-NLS-1$
+ mode = DEFAULT;
+ this.options.put(
+ CompilerOptions.OPTION_LambdaGenericSignature,
+ CompilerOptions.GENERATE);
+ continue;
+ }
if (currentArg.startsWith("-g")) { //$NON-NLS-1$
mode = DEFAULT;
String debugOption = currentArg;
@@ -2470,6 +2489,10 @@
this.options.put(CompilerOptions.OPTION_ReportMissingNonNullByDefaultAnnotation, CompilerOptions.WARNING);
continue;
}
+ if (currentArg.equals("-annotationpath")) { //$NON-NLS-1$
+ mode = INSIDE_ANNOTATIONPATH_start;
+ continue;
+ }
break;
case INSIDE_TARGET :
if (this.didSpecifyTarget) {
@@ -2669,6 +2692,20 @@
initializeWarnings(currentArg);
mode = DEFAULT;
continue;
+ case INSIDE_ANNOTATIONPATH_start:
+ mode = DEFAULT;
+ if (currentArg.isEmpty() || currentArg.charAt(0) == '-')
+ throw new IllegalArgumentException(this.bind("configure.missingAnnotationPath", currentArg)); //$NON-NLS-1$
+ if (ANNOTATION_SOURCE_CLASSPATH.equals(currentArg)) {
+ this.annotationsFromClasspath = true;
+ } else {
+ if (this.annotationPaths == null)
+ this.annotationPaths = new ArrayList<String>();
+ StringTokenizer tokens = new StringTokenizer(currentArg, File.pathSeparator);
+ while (tokens.hasMoreTokens())
+ this.annotationPaths.add(tokens.nextToken());
+ }
+ continue;
}
// default is input directory, if no custom destination path exists
@@ -3030,26 +3067,7 @@
* Answer the component to which will be handed back compilation results from the compiler
*/
public ICompilerRequestor getBatchRequestor() {
- return new ICompilerRequestor() {
- int lineDelta = 0;
- public void acceptResult(CompilationResult compilationResult) {
- if (compilationResult.lineSeparatorPositions != null) {
- int unitLineCount = compilationResult.lineSeparatorPositions.length;
- this.lineDelta += unitLineCount;
- if (Main.this.showProgress && this.lineDelta > 2000) {
- // in -log mode, dump a dot every 2000 lines compiled
- Main.this.logger.logProgress();
- this.lineDelta = 0;
- }
- }
- Main.this.logger.startLoggingSource(compilationResult);
- if (compilationResult.hasProblems() || compilationResult.hasTasks()) {
- Main.this.logger.logProblems(compilationResult.getAllProblems(), compilationResult.compilationUnit.getContents(), Main.this);
- }
- outputClassFiles(compilationResult);
- Main.this.logger.endLoggingSource();
- }
- };
+ return new BatchCompilerRequestor(this);
}
/*
* Build the set of compilation source units
@@ -3118,7 +3136,8 @@
}
public FileSystem getLibraryAccess() {
- return new FileSystem(this.checkedClasspaths, this.filenames);
+ return new FileSystem(this.checkedClasspaths, this.filenames,
+ this.annotationsFromClasspath && CompilerOptions.ENABLED.equals(this.options.get(CompilerOptions.OPTION_AnnotationBasedNullAnalysis)));
}
/*
@@ -3869,6 +3888,11 @@
} else if (token.equals("switchDefault")) { //$NON-NLS-1$
setSeverity(CompilerOptions.OPTION_ReportMissingDefaultCase, severity, isEnabling);
return;
+ } else if (token.equals("syntacticAnalysis")) { //$NON-NLS-1$
+ this.options.put(
+ CompilerOptions.OPTION_SyntacticNullAnalysisForFields,
+ isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED);
+ return;
}
break;
case 't' :
@@ -3901,6 +3925,9 @@
} else if (token.equals("unusedArgument") || token.equals("unusedArguments")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$
setSeverity(CompilerOptions.OPTION_ReportUnusedParameter, severity, isEnabling);
return;
+ } else if (token.equals("unusedExceptionParam")) { //$NON-NLS-1$
+ setSeverity(CompilerOptions.OPTION_ReportUnusedExceptionParameter, severity, isEnabling);
+ return;
} else if (token.equals("unusedImport") || token.equals("unusedImports")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$
setSeverity(CompilerOptions.OPTION_ReportUnusedImport, severity, isEnabling);
return;
@@ -4633,6 +4660,13 @@
this.checkedClasspaths = new FileSystem.Classpath[classpaths.size()];
classpaths.toArray(this.checkedClasspaths);
this.logger.logClasspath(this.checkedClasspaths);
+
+ if (this.annotationPaths != null && CompilerOptions.ENABLED.equals(this.options.get(CompilerOptions.OPTION_AnnotationBasedNullAnalysis))) {
+ for (FileSystem.Classpath cp : this.checkedClasspaths) {
+ if (cp instanceof ClasspathJar)
+ ((ClasspathJar) cp).annotationPaths = this.annotationPaths;
+ }
+ }
}
private static boolean shouldIgnoreOptionalProblems(char[][] folderNames, char[] fileName) {
if (folderNames == null || fileName == null) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties
index 61a6306..1c362ea 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2013 IBM Corporation and others.
+# Copyright (c) 2000, 2015 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
# bug 365208 - [compiler][batch] command line options for annotation based null analysis
# bug 374605 - Unreasonable warning for enum-based switch statements
# bug 388281 - [compiler][null] inheritance of null annotations as an option
+# bug 440687 - [compiler][batch][null] improve command line option for external annotations
+# Bug 408815 - [batch][null] Add CLI option for COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS
# Alan Moraes <alan@kelon.org> - Contribution for bug 383644
# Jesper S Moller - Contribution for bug 407297 - [1.8][compiler] Control generation of parameter names by option
###############################################################################
@@ -24,8 +26,8 @@
#Format: compiler.name = word1 word2 word3
compiler.name = Eclipse Compiler for Java(TM)
#Format: compiler.version = (The place holders will be automatically filled. Do not remove or alter it)
-compiler.version = BETA_JAVA8_LUNA_8661797, 3.9.2
-compiler.copyright = Copyright IBM Corp 2000, 2013. All rights reserved.
+compiler.version = MARS_1007a0215, 3.10.0
+compiler.copyright = Copyright IBM Corp 2000, 2015. All rights reserved.
### progress
progress.compiling = Compiling
@@ -111,6 +113,7 @@
### null annotations
configure.invalidNullAnnot = Token {0} is not in the expected format "nullAnnot(<non null annotation name> | <nullable annotation name> | <non-null by default annotation name>)"
+configure.missingAnnotationPath = Missing argument to -annotationpath at ''{0}''
### requestor
requestor.error = {0}. ERROR in {1}
@@ -259,9 +262,15 @@
\ -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n\
\ -enableJavadoc consider references in javadoc\n\
\ -parameters generate method parameters attribute (for target >= 1.8)\n\
+\ -genericsignature generate generic signature for lambda expressions\n\
\ -Xemacs used to enable emacs-style output in the console.\n\
\ It does not affect the xml log output\n\
\ -missingNullDefault report missing default nullness annotation\n\
+\ -annotationpath <directories and ZIP archives separated by {0}>\n\
+\ specify locations where to find external annotations\n\
+\ to support annotation-based null analysis.\n\
+\ The special name CLASSPATH will cause lookup of\n\
+\ external annotations from the classpath and sourcepath.\n\
\ \n\
\ -? -help print this help message\n\
\ -v -version print compiler version\n\
@@ -376,6 +385,7 @@
\ errors and warnings\n\
\ switchDefault + switch statement lacking a default case\n\
\ syncOverride missing synchronized in synchr. method override\n\
+\ syntacticAnalysis perform syntax-based null analysis for fields\n\
\ syntheticAccess synthetic access for innerclass\n\
\ tasks(<tags separated by |>) tasks identified by tags inside comments\n\
\ typeHiding + type parameter hiding another type\n\
@@ -386,9 +396,11 @@
\ unqualifiedField unqualified reference to field\n\
\ unused macro for unusedAllocation, unusedArgument,\n\
\ unusedImport, unusedLabel, unusedLocal,\n\
-\ unusedPrivate, unusedThrown, and unusedTypeArgs\n\
+\ unusedPrivate, unusedThrown, and unusedTypeArgs,\n\
+\ unusedExceptionParam\n\
\ unusedAllocation allocating an object that is not used\n\
\ unusedArgument unread method parameter\n\
+\ unusedExceptionParam unread exception parameter\n\
\ unusedImport + unused import declaration\n\
\ unusedLabel + unused label\n\
\ unusedLocal + unread local variable\n\
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
index 4364ef3..fac479d 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
@@ -108,6 +108,7 @@
int MAJOR_VERSION_1_6 = 50;
int MAJOR_VERSION_1_7 = 51;
int MAJOR_VERSION_1_8 = 52;
+ int MAJOR_VERSION_1_9 = 53; // This might change
int MINOR_VERSION_0 = 0;
int MINOR_VERSION_1 = 1;
@@ -115,7 +116,7 @@
int MINOR_VERSION_3 = 3;
int MINOR_VERSION_4 = 4;
- // JDK 1.1 -> 1.8, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0
+ // JDK 1.1 -> 1.9, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0
// 16 unsigned bits for major, then 16 bits for minor
long JDK1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_3; // 1.1. is 45.3
long JDK1_2 = ((long)ClassFileConstants.MAJOR_VERSION_1_2 << 16) + ClassFileConstants.MINOR_VERSION_0;
@@ -125,6 +126,7 @@
long JDK1_6 = ((long)ClassFileConstants.MAJOR_VERSION_1_6 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK1_7 = ((long)ClassFileConstants.MAJOR_VERSION_1_7 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK1_8 = ((long)ClassFileConstants.MAJOR_VERSION_1_8 << 16) + ClassFileConstants.MINOR_VERSION_0;
+ long JDK1_9 = ((long)ClassFileConstants.MAJOR_VERSION_1_9 << 16) + ClassFileConstants.MINOR_VERSION_0;
/*
* cldc1.1 is 45.3, but we modify it to be different from JDK1_1.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
index af9f837..ac98cdf 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,22 +7,31 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contribution for bug 365992 - [builder] [null] Change of nullness for a parameter doesn't trigger a build for the files that call the method
+ * Stephan Herrmann - Contribution for
+ * Bug 365992 - [builder] [null] Change of nullness for a parameter doesn't trigger a build for the files that call the method
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
+ * Bug 440687 - [compiler][batch][null] improve command line option for external annotations
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* bug 407191 - [1.8] Binary access support for type annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.classfmt;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
@@ -56,6 +65,7 @@
private char[][][] missingTypeNames;
private int enclosingNameAndTypeIndex;
private char[] enclosingMethod;
+ private ExternalAnnotationProvider annotationProvider;
private static String printTypeModifiers(int modifiers) {
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
@@ -396,6 +406,78 @@
}
}
+/** Auxiliary interface for {@link #setExternalAnnotationProvider(String,String,ZipFile,ZipFileProducer)}. */
+public interface ZipFileProducer { ZipFile produce() throws IOException; }
+
+/**
+ * Create and remember a provider for external annotations using the given basePath,
+ * which is either a directory holding .eea text files, or a zip file of entries of the same format.
+ * @param basePath resolved filesystem path of either directory or zip file
+ * @param qualifiedBinaryTypeName slash-separated type name
+ * @param zipFile an existing zip file for the same basePath, or null.
+ * Output: wl be filled with
+ * @param producer an optional helper to produce the zipFile when needed.
+ * @return the client provided zip file;
+ * or else a fresh new zip file, to let clients cache it, if desired;
+ * or null to signal that basePath is not a zip file, but a directory.
+ * @throws IOException any unexpected errors during file access. File not found while
+ * accessing an individual file if basePath is a directory <em>is</em> expected,
+ * and simply answered with null. If basePath is neither a directory nor a zip file,
+ * this is unexpected.
+ */
+public ZipFile setExternalAnnotationProvider(String basePath, String qualifiedBinaryTypeName, ZipFile zipFile, ZipFileProducer producer) throws IOException {
+ String qualifiedBinaryFileName = qualifiedBinaryTypeName + ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX;
+ if (zipFile == null) {
+ File annotationBase = new File(basePath);
+ if (annotationBase.isDirectory()) {
+ try {
+ String filePath = annotationBase.getAbsolutePath()+'/'+qualifiedBinaryFileName;
+ this.annotationProvider = new ExternalAnnotationProvider(new FileInputStream(filePath), String.valueOf(getName()));
+ } catch (FileNotFoundException e) {
+ // expected, no need to report an error here
+ }
+ return null; // no zipFile
+ }
+ if (!annotationBase.exists())
+ return null; // no zipFile, treat as not-yet-created directory
+ zipFile = (producer != null ? producer.produce() : new ZipFile(annotationBase));
+ }
+ ZipEntry entry = zipFile.getEntry(qualifiedBinaryFileName);
+ if (entry != null)
+ this.annotationProvider = new ExternalAnnotationProvider(zipFile.getInputStream(entry), String.valueOf(getName()));
+ return zipFile;
+}
+public boolean hasAnnotationProvider() {
+ return this.annotationProvider != null;
+}
+
+/**
+ * Conditionally add external annotations to the mix.
+ * If 'member' is given it must be either of IBinaryField or IBinaryMethod, in which case we're seeking annotations for that member.
+ * Otherwise we're seeking annotations for top-level elements of a type (type parameters & super types).
+ */
+@Override
+public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member, LookupEnvironment environment) {
+ if (walker == ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER && this.annotationProvider != null) {
+ if (member == null) {
+ return this.annotationProvider.forTypeHeader(environment);
+ } else if (member instanceof IBinaryField) {
+ IBinaryField field = (IBinaryField) member;
+ char[] fieldSignature = field.getGenericSignature();
+ if (fieldSignature == null)
+ fieldSignature = field.getTypeName();
+ return this.annotationProvider.forField(field.getName(), fieldSignature, environment);
+ } else if (member instanceof IBinaryMethod) {
+ IBinaryMethod method = (IBinaryMethod) member;
+ char[] methodSignature = method.getGenericSignature();
+ if (methodSignature == null)
+ methodSignature = method.getMethodDescriptor();
+ return this.annotationProvider.forMethod(method.isConstructor() ? TypeConstants.INIT : method.getSelector(), methodSignature, environment);
+ }
+ }
+ return walker;
+}
+
/**
* Answer the receiver's access flags. The value of the access_flags
* item is a mask of modifiers used with class and interface declarations.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java
new file mode 100644
index 0000000..2927829
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/ExternalAnnotationProvider.java
@@ -0,0 +1,668 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 GK Software AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Stephan Herrmann - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.compiler.classfmt;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryElementValuePair;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SignatureWrapper;
+import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
+
+public class ExternalAnnotationProvider {
+
+ public static final String ANNOTION_FILE_EXTENSION= "eea"; //$NON-NLS-1$
+ public static final String CLASS_PREFIX = "class "; //$NON-NLS-1$
+ public static final String SUPER_PREFIX = "super "; //$NON-NLS-1$
+
+ /** Representation of a 'nullable' annotation, independent of the concrete annotation name used in Java sources. */
+ public static final char NULLABLE = '0';
+
+ /** Representation of a 'nonnull' annotation, independent of the concrete annotation name used in Java sources. */
+ public static final char NONNULL = '1';
+
+ /**
+ * Represents absence of a null annotation. Useful for removing an existing null annotation.
+ * This character is used only internally, it is not part of the Eclipse External Annotation file format.
+ */
+ public static final char NO_ANNOTATION = '@';
+
+ static final String ANNOTATION_FILE_SUFFIX = ".eea"; //$NON-NLS-1$
+
+ private static final String TYPE_PARAMETER_PREFIX = " <"; //$NON-NLS-1$
+
+
+ private String typeName;
+ String typeParametersAnnotationSource;
+ Map<String,String> supertypeAnnotationSources;
+ private Map<String,String> methodAnnotationSources;
+ private Map<String,String> fieldAnnotationSources;
+
+ /**
+ * Create and initialize.
+ * @param input open input stream to read the annotations from, will be closed by the constructor.
+ * @param typeName slash-separated qualified name of a type
+ * @throws IOException various issues when accessing the annotation file
+ */
+ public ExternalAnnotationProvider(InputStream input, String typeName) throws IOException {
+ this.typeName = typeName;
+ initialize(input);
+ }
+
+ private void initialize(InputStream input) throws IOException {
+ LineNumberReader reader = new LineNumberReader(new InputStreamReader(input));
+ try {
+ assertClassHeader(reader.readLine(), this.typeName);
+
+ String line;
+ if ((line = reader.readLine()) == null) {
+ return;
+ }
+ if (line.startsWith(TYPE_PARAMETER_PREFIX)) {
+ if ((line = reader.readLine()) == null) // skip first line, second line may contain type parameter annotations
+ return;
+ if (line.startsWith(TYPE_PARAMETER_PREFIX)) {
+ this.typeParametersAnnotationSource = line.substring(TYPE_PARAMETER_PREFIX.length());
+ if ((line = reader.readLine()) == null)
+ return;
+ }
+ }
+ String pendingLine;
+ do {
+ pendingLine = null;
+ line = line.trim();
+ if (line.isEmpty()) continue;
+ String rawSig = null, annotSig = null;
+ // selector:
+ String selector = line;
+ boolean isSuper = selector.startsWith(SUPER_PREFIX);
+ if (isSuper)
+ selector = selector.substring(SUPER_PREFIX.length());
+ int errLine = -1;
+ try {
+ // raw signature:
+ line = reader.readLine();
+ if (line != null && !line.isEmpty() && line.charAt(0) == ' ') // first signature line is mandatory
+ rawSig = line.substring(1);
+ else
+ errLine = reader.getLineNumber();
+ // annotated signature:
+ line = reader.readLine();
+ if (line == null || line.isEmpty())
+ continue; // skip since optional line with annotations is missing
+ if (line.charAt(0) != ' ') {
+ pendingLine = line; // push back what appears to be the next selector, not a signature
+ continue;
+ }
+ annotSig = line.substring(1);
+ } catch (Exception ex) {
+ // continue to escalate below
+ }
+ if (rawSig == null || annotSig == null) {
+ if (errLine == -1) errLine = reader.getLineNumber();
+ throw new IOException("Illegal format for annotation file at line "+errLine); //$NON-NLS-1$
+ }
+ // discard optional meta data (separated by whitespace):
+ annotSig = trimTail(annotSig);
+ if (isSuper) {
+ if (this.supertypeAnnotationSources == null)
+ this.supertypeAnnotationSources = new HashMap<String, String>();
+ this.supertypeAnnotationSources.put('L'+selector+rawSig+';', annotSig);
+ } else if (rawSig.contains("(")) { //$NON-NLS-1$
+ if (this.methodAnnotationSources == null)
+ this.methodAnnotationSources = new HashMap<String, String>();
+ this.methodAnnotationSources.put(selector+rawSig, annotSig);
+ } else {
+ if (this.fieldAnnotationSources == null)
+ this.fieldAnnotationSources = new HashMap<String, String>();
+ this.fieldAnnotationSources.put(selector+':'+rawSig, annotSig);
+ }
+ } while (((line = pendingLine) != null) || (line = reader.readLine()) != null);
+ } finally {
+ reader.close();
+ }
+ }
+
+ /**
+ * Assert that the given line is a class header for 'typeName' (slash-separated qualified name).
+ */
+ public static void assertClassHeader(String line, String typeName) throws IOException {
+ if (line.startsWith(CLASS_PREFIX)) {
+ line = line.substring(CLASS_PREFIX.length());
+ } else {
+ throw new IOException("missing class header in annotation file"); //$NON-NLS-1$
+ }
+ if (!trimTail(line).equals(typeName)) {
+ throw new IOException("mismatching class name in annotation file, expected "+typeName+", but header said "+line); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * Extract the signature from a line of an external annotation file.
+ * Answers null if line is not in the expected format.
+ */
+ public static String extractSignature(String line) {
+ if (line == null || line.isEmpty() || line.charAt(0) != ' ')
+ return null;
+ return trimTail(line.substring(1));
+ }
+
+ /** Lines may contain arbitrary trailing data, separated by white space. */
+ protected static String trimTail(String line) {
+ int tail = line.indexOf(' ');
+ if (tail == -1)
+ tail = line.indexOf('\t');
+ if (tail != -1)
+ return line.substring(0, tail);
+ return line;
+ }
+
+ public ITypeAnnotationWalker forTypeHeader(LookupEnvironment environment) {
+ if (this.typeParametersAnnotationSource != null || this.supertypeAnnotationSources != null)
+ return new DispatchingAnnotationWalker(environment);
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ public ITypeAnnotationWalker forMethod(char[] selector, char[] signature, LookupEnvironment environment) {
+ Map<String, String> sources = this.methodAnnotationSources;
+ if (sources != null) {
+ String source = sources.get(String.valueOf(CharOperation.concat(selector, signature)));
+ if (source != null)
+ return new MethodAnnotationWalker(source.toCharArray(), 0, environment);
+ }
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ public ITypeAnnotationWalker forField(char[] selector, char[] signature, LookupEnvironment environment) {
+ if (this.fieldAnnotationSources != null) {
+ String source = this.fieldAnnotationSources.get(String.valueOf(CharOperation.concat(selector, signature, ':')));
+ if (source != null)
+ return new FieldAnnotationWalker(source.toCharArray(), 0, environment);
+ }
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("External Annotations for ").append(this.typeName).append('\n'); //$NON-NLS-1$
+ sb.append("Methods:\n"); //$NON-NLS-1$
+ if (this.methodAnnotationSources != null)
+ for (Entry<String,String> e : this.methodAnnotationSources.entrySet())
+ sb.append('\t').append(e.getKey()).append('\n');
+ return sb.toString();
+ }
+
+ abstract class SingleMarkerAnnotation implements IBinaryAnnotation {
+ @Override
+ public IBinaryElementValuePair[] getElementValuePairs() {
+ return ElementValuePairInfo.NoMembers;
+ }
+ protected char[] getBinaryTypeName(char[][] name) {
+ return CharOperation.concat('L', CharOperation.concatWith(name, '/'), ';');
+ }
+ }
+
+ SingleMarkerAnnotation NULLABLE_ANNOTATION, NONNULL_ANNOTATION;
+
+ void initAnnotations(final LookupEnvironment environment) {
+ if (this.NULLABLE_ANNOTATION == null) {
+ this.NULLABLE_ANNOTATION = new SingleMarkerAnnotation() {
+ @Override public char[] getTypeName() { return getBinaryTypeName(environment.getNullableAnnotationName()); }
+ };
+ }
+ if (this.NONNULL_ANNOTATION == null) {
+ this.NONNULL_ANNOTATION = new SingleMarkerAnnotation() {
+ @Override public char[] getTypeName() { return getBinaryTypeName(environment.getNonNullAnnotationName()); }
+ };
+ }
+ }
+
+ /**
+ * Walker for top-level elements of a type (type parameters & super types),
+ * which dispatches to specialized walkers for those details.
+ */
+ class DispatchingAnnotationWalker implements ITypeAnnotationWalker {
+
+ private LookupEnvironment environment;
+ private TypeParametersAnnotationWalker typeParametersWalker;
+
+ public DispatchingAnnotationWalker(LookupEnvironment environment) {
+ this.environment = environment;
+ }
+ public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
+ String source = ExternalAnnotationProvider.this.typeParametersAnnotationSource;
+ if (source != null) {
+ if (this.typeParametersWalker == null)
+ this.typeParametersWalker = new TypeParametersAnnotationWalker(source.toCharArray(), 0, 0, null, this.environment);
+ return this.typeParametersWalker.toTypeParameter(isClassTypeParameter, rank);
+ }
+ return this;
+ }
+ public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
+ if (this.typeParametersWalker != null)
+ return this.typeParametersWalker.toTypeParameterBounds(isClassTypeParameter, parameterRank);
+ return this;
+ }
+ public ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature) {
+ Map<String, String> sources = ExternalAnnotationProvider.this.supertypeAnnotationSources;
+ if (sources != null) {
+ String source = sources.get(String.valueOf(superTypeSignature));
+ if (source != null)
+ return new SuperTypesAnnotationWalker(source.toCharArray(), this.environment);
+ }
+ return this;
+ }
+ // the rest is borrowed from EMPTY_ANNOTATION_WALKER:
+ public ITypeAnnotationWalker toField() { return this; }
+ public ITypeAnnotationWalker toThrows(int rank) { return this; }
+ public ITypeAnnotationWalker toTypeArgument(int rank) { return this; }
+ public ITypeAnnotationWalker toMethodParameter(short index) { return this; }
+ public ITypeAnnotationWalker toTypeBound(short boundIndex) { return this; }
+ public ITypeAnnotationWalker toMethodReturn() { return this; }
+ public ITypeAnnotationWalker toReceiver() { return this; }
+ public ITypeAnnotationWalker toWildcardBound() { return this; }
+ public ITypeAnnotationWalker toNextArrayDimension() { return this; }
+ public ITypeAnnotationWalker toNextNestedType() { return this; }
+ public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId) { return NO_ANNOTATIONS; }
+ }
+
+ abstract class BasicAnnotationWalker implements ITypeAnnotationWalker {
+
+ char[] source;
+ SignatureWrapper wrapper;
+ int pos;
+ int prevTypeArgStart;
+ int currentTypeBound;
+ LookupEnvironment environment;
+
+ BasicAnnotationWalker(char[] source, int pos, LookupEnvironment environment) {
+ this.source = source;
+ this.pos = pos;
+ this.environment = environment;
+ initAnnotations(environment);
+ }
+
+ SignatureWrapper wrapperWithStart(int start) {
+ if (this.wrapper == null)
+ this.wrapper = new SignatureWrapper(this.source);
+ this.wrapper.start = start;
+ return this.wrapper;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toReceiver() {
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeBound(short boundIndex) {
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature) {
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeArgument(int rank) {
+ if (rank == 0) {
+ int start = CharOperation.indexOf('<', this.source, this.pos) + 1;
+ this.prevTypeArgStart = start;
+ return new MethodAnnotationWalker(this.source, start, this.environment);
+ }
+ int next = this.prevTypeArgStart;
+ switch (this.source[next]) {
+ case '*':
+ break;
+ case '-':
+ case '+':
+ next++;
+ //$FALL-THROUGH$
+ default:
+ next = wrapperWithStart(next).computeEnd();
+ }
+ next++;
+ this.prevTypeArgStart = next;
+ return new MethodAnnotationWalker(this.source, next, this.environment);
+ }
+
+ @Override
+ public ITypeAnnotationWalker toWildcardBound() {
+ switch (this.source[this.pos]) {
+ case '-':
+ case '+':
+ return new MethodAnnotationWalker(this.source, this.pos+1, this.environment);
+ default: // includes unbounded '*'
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+ }
+
+ @Override
+ public ITypeAnnotationWalker toNextArrayDimension() {
+ if (this.source[this.pos] == '[') {
+ int newPos = this.pos+1;
+ switch (this.source[newPos]) {
+ case NULLABLE: case NONNULL: newPos++; break;
+ }
+ return new MethodAnnotationWalker(this.source, newPos, this.environment);
+ }
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toNextNestedType() {
+ return this; // FIXME(stephan)
+ }
+
+ @Override
+ public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId) {
+ if (this.pos != -1 && this.pos < this.source.length-2) {
+ switch (this.source[this.pos]) {
+ case 'T':
+ case 'L':
+ case '[':
+ case '*':
+ case '+':
+ case '-':
+ switch (this.source[this.pos+1]) {
+ case NULLABLE:
+ return new IBinaryAnnotation[]{ ExternalAnnotationProvider.this.NULLABLE_ANNOTATION };
+ case NONNULL:
+ return new IBinaryAnnotation[]{ ExternalAnnotationProvider.this.NONNULL_ANNOTATION };
+ }
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Walker that may serve the annotations on type parameters of the current class or method.
+ */
+ public class TypeParametersAnnotationWalker extends BasicAnnotationWalker {
+
+ int[] rankStarts; // indices of start positions for type parameters per rank
+ int currentRank;
+
+ TypeParametersAnnotationWalker(char[] source, int pos, int rank, int[] rankStarts, LookupEnvironment environment) {
+ super(source, pos, environment);
+ this.currentRank = rank;
+ if (rankStarts != null) {
+ this.rankStarts = rankStarts;
+ } else {
+ // eagerly scan all type parameters:
+ int length = source.length;
+ rankStarts = new int[length];
+ int curRank = 0;
+ // next block cf. BinaryTypeBinding.createTypeVariables():
+ int depth = 0;
+ boolean pendingVariable = true;
+ scanVariables: {
+ for (int i = pos; i < length; i++) {
+ switch(this.source[i]) {
+ case Util.C_GENERIC_START :
+ depth++;
+ break;
+ case Util.C_GENERIC_END :
+ if (--depth < 0)
+ break scanVariables;
+ break;
+ case Util.C_NAME_END :
+ if ((depth == 0) && (i +1 < length) && (this.source[i+1] != Util.C_COLON))
+ pendingVariable = true;
+ break;
+ default:
+ if (pendingVariable) {
+ pendingVariable = false;
+ rankStarts[curRank++] = i;
+ }
+ }
+ }
+ }
+ System.arraycopy(rankStarts, 0, this.rankStarts = new int[curRank], 0, curRank);
+ }
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
+ if (rank == this.currentRank)
+ return this;
+ if (rank < this.rankStarts.length)
+ return new TypeParametersAnnotationWalker(this.source, this.rankStarts[rank], rank, this.rankStarts, this.environment);
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
+ return new TypeParametersAnnotationWalker(this.source, this.rankStarts[parameterRank], parameterRank, this.rankStarts, this.environment);
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeBound(short boundIndex) {
+ // assume we are positioned either at the start of the bounded type parameter
+ // or at the start of a previous type bound
+ int p = this.pos;
+ int i = this.currentTypeBound;
+ while(true) {
+ // each bound is prefixed with ':'
+ int colon = CharOperation.indexOf(Util.C_COLON, this.source, p);
+ if (colon != -1)
+ p = colon + 1;
+ if (++i > boundIndex) break;
+ // skip next type:
+ p = wrapperWithStart(p).computeEnd()+1;
+ }
+ this.pos = p;
+ this.currentTypeBound = boundIndex;
+ return this;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toField() {
+ throw new UnsupportedOperationException("Cannot navigate to fields"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodReturn() {
+ throw new UnsupportedOperationException("Cannot navigate to method return"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodParameter(short index) {
+ throw new UnsupportedOperationException("Cannot navigate to method parameter"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toThrows(int index) {
+ throw new UnsupportedOperationException("Cannot navigate to throws"); //$NON-NLS-1$
+ }
+
+ @Override
+ public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId) {
+ if (this.pos != -1 && this.pos < this.source.length-1) {
+ switch (this.source[this.pos]) {
+ case NULLABLE:
+ return new IBinaryAnnotation[]{ ExternalAnnotationProvider.this.NULLABLE_ANNOTATION };
+ case NONNULL:
+ return new IBinaryAnnotation[]{ ExternalAnnotationProvider.this.NONNULL_ANNOTATION };
+ }
+ }
+ return super.getAnnotationsAtCursor(currentTypeId);
+ }
+ }
+
+ /** Walker serving type annotations on a type's supertypes. */
+ class SuperTypesAnnotationWalker extends BasicAnnotationWalker {
+
+ SuperTypesAnnotationWalker(char[] source, LookupEnvironment environment) {
+ super(source, 0, environment);
+ }
+
+ // actual implementation is inherited, main entries: toTypeArgument & getAnnotationsAtCursor
+
+ @Override
+ public ITypeAnnotationWalker toField() {
+ throw new UnsupportedOperationException("Supertype has no field annotations"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodReturn() {
+ throw new UnsupportedOperationException("Supertype has no method return"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodParameter(short index) {
+ throw new UnsupportedOperationException("Supertype has no method parameter"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toThrows(int index) {
+ throw new UnsupportedOperationException("Supertype has no throws"); //$NON-NLS-1$
+ }
+ }
+
+ public interface IMethodAnnotationWalker extends ITypeAnnotationWalker {
+ int getParameterCount();
+ }
+ class MethodAnnotationWalker extends BasicAnnotationWalker implements IMethodAnnotationWalker {
+
+ int prevParamStart;
+ TypeParametersAnnotationWalker typeParametersWalker;
+
+ MethodAnnotationWalker(char[] source, int pos, LookupEnvironment environment) {
+ super(source, pos, environment);
+ }
+
+ int typeEnd(int start) {
+ while (this.source[start] == '[') {
+ start++;
+ char an = this.source[start];
+ if (an == NULLABLE || an == NONNULL)
+ start++;
+ }
+ int end = wrapperWithStart(start).computeEnd();
+ return end;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
+ if (this.source[0] == '<') {
+ if (this.typeParametersWalker == null)
+ return this.typeParametersWalker = new TypeParametersAnnotationWalker(this.source, this.pos+1, rank, null, this.environment);
+ return this.typeParametersWalker.toTypeParameter(isClassTypeParameter, rank);
+ }
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
+ if (this.typeParametersWalker != null)
+ return this.typeParametersWalker.toTypeParameterBounds(isClassTypeParameter, parameterRank);
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodReturn() {
+ int close = CharOperation.indexOf(')', this.source);
+ if (close != -1) {
+ // optimization, see toMethodParameter.
+ this.pos = close+1;
+ return this;
+ }
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodParameter(short index) {
+ if (index == 0) {
+ int start = CharOperation.indexOf('(', this.source) + 1;
+ this.prevParamStart = start;
+ // optimization: normally we should create a new walker with pos=start,
+ // but since we know the order how BTB/LE call us, we can safely use one walker for all parameters:
+ this.pos = start;
+ return this;
+ }
+ int end = typeEnd(this.prevParamStart); // leverage the fact that all parameters are evaluated in order
+ end++;
+ this.prevParamStart = end;
+ // optimization, see above.
+ this.pos = end;
+ return this;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toThrows(int index) {
+ return this;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toField() {
+ throw new UnsupportedOperationException("Methods have no fields"); //$NON-NLS-1$
+ }
+
+ @Override
+ public int getParameterCount() {
+ int count = 0;
+ int start = CharOperation.indexOf('(', this.source) + 1;
+ while (start < this.source.length && this.source[start] != ')') {
+ start = typeEnd(start) + 1;
+ count++;
+ }
+ return count;
+ }
+ }
+
+ class FieldAnnotationWalker extends BasicAnnotationWalker {
+ public FieldAnnotationWalker(char[] source, int pos, LookupEnvironment environment) {
+ super(source, pos, environment);
+ }
+
+ @Override
+ public ITypeAnnotationWalker toField() {
+ return this;
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodReturn() {
+ throw new UnsupportedOperationException("Field has no method return"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toMethodParameter(short index) {
+ throw new UnsupportedOperationException("Field has no method parameter"); //$NON-NLS-1$
+ }
+
+ @Override
+ public ITypeAnnotationWalker toThrows(int index) {
+ throw new UnsupportedOperationException("Field has no throws"); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java
index db18317..1227f01 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/NonNullDefaultAwareTypeAnnotationWalker.java
@@ -14,6 +14,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryElementValuePair;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeIds;
@@ -30,6 +31,7 @@
private boolean nextIsTypeBound;
private boolean isEmpty;
IBinaryAnnotation nonNullAnnotation;
+ LookupEnvironment environment;
/** Create initial walker with non-empty type annotations. */
public NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations,
@@ -37,31 +39,36 @@
super(typeAnnotations);
this.nonNullAnnotation = getNonNullAnnotation(environment);
this.defaultNullness = defaultNullness;
+ this.environment = environment;
}
/** Create an initial walker without 'real' type annotations, but with a nonnull default. */
public NonNullDefaultAwareTypeAnnotationWalker(int defaultNullness, LookupEnvironment environment) {
- this(defaultNullness, getNonNullAnnotation(environment), false, false);
+ this(defaultNullness, getNonNullAnnotation(environment), false, false, environment);
}
/** Get restricted walker, still with non-empty type annotations. */
NonNullDefaultAwareTypeAnnotationWalker(IBinaryTypeAnnotation[] typeAnnotations, long newMatches, int newPathPtr,
- int defaultNullness, IBinaryAnnotation nonNullAnnotation, boolean atDefaultLocation, boolean atTypeBound) {
+ int defaultNullness, IBinaryAnnotation nonNullAnnotation, boolean atDefaultLocation, boolean atTypeBound,
+ LookupEnvironment environment) {
super(typeAnnotations, newMatches, newPathPtr);
this.defaultNullness = defaultNullness;
this.nonNullAnnotation = nonNullAnnotation;
this.atDefaultLocation = atDefaultLocation;
this.atTypeBound = atTypeBound;
+ this.environment = environment;
}
/** Create a restricted walker without 'real' type annotations, but with a nonnull default. */
- NonNullDefaultAwareTypeAnnotationWalker(int defaultNullness, IBinaryAnnotation nonNullAnnotation, boolean atDefaultLocation, boolean atTypeBound) {
+ NonNullDefaultAwareTypeAnnotationWalker(int defaultNullness, IBinaryAnnotation nonNullAnnotation,
+ boolean atDefaultLocation, boolean atTypeBound, LookupEnvironment environment) {
super(null, 0, 0);
this.nonNullAnnotation = nonNullAnnotation;
this.defaultNullness = defaultNullness;
this.atDefaultLocation = atDefaultLocation;
this.atTypeBound = atTypeBound;
this.isEmpty = true;
+ this.environment = environment;
}
private static IBinaryAnnotation getNonNullAnnotation(LookupEnvironment environment) {
@@ -90,10 +97,11 @@
// are we running out of real type annotations?
if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0)
return new NonNullDefaultAwareTypeAnnotationWalker(this.defaultNullness, this.nonNullAnnotation,
- this.nextIsDefaultLocation, this.nextIsTypeBound);
+ this.nextIsDefaultLocation, this.nextIsTypeBound, this.environment);
// proceed as normal, but pass on our specific fields, too:
return new NonNullDefaultAwareTypeAnnotationWalker(this.typeAnnotations, newMatches, newPathPtr,
- this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation, this.nextIsTypeBound);
+ this.defaultNullness, this.nonNullAnnotation, this.nextIsDefaultLocation,
+ this.nextIsTypeBound, this.environment);
} finally {
this.nextIsDefaultLocation = false; // expire
this.nextIsTypeBound = false;
@@ -101,21 +109,21 @@
}
@Override
- public TypeAnnotationWalker toMethodParameter(short index) {
+ public ITypeAnnotationWalker toMethodParameter(short index) {
// don't set nextIsDefaultLocation, because signature-level nullness is handled by ImplicitNullAnnotationVerifier
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
return super.toMethodParameter(index);
}
@Override
- public TypeAnnotationWalker toMethodReturn() {
+ public ITypeAnnotationWalker toMethodReturn() {
// don't set nextIsDefaultLocation, because signature-level nullness is handled by ImplicitNullAnnotationVerifier
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
return super.toMethodReturn();
}
@Override
- public TypeAnnotationWalker toTypeBound(short boundIndex) {
+ public ITypeAnnotationWalker toTypeBound(short boundIndex) {
this.nextIsDefaultLocation = (this.defaultNullness & Binding.DefaultLocationTypeBound) != 0;
this.nextIsTypeBound = true;
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
@@ -123,7 +131,7 @@
}
@Override
- public TypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
+ public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
this.nextIsDefaultLocation = (this.defaultNullness & Binding.DefaultLocationTypeBound) != 0;
this.nextIsTypeBound = true;
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
@@ -131,7 +139,7 @@
}
@Override
- public TypeAnnotationWalker toTypeArgument(int rank) {
+ public ITypeAnnotationWalker toTypeArgument(int rank) {
this.nextIsDefaultLocation = (this.defaultNullness & Binding.DefaultLocationTypeArgument) != 0;
this.nextIsTypeBound = false;
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
@@ -139,7 +147,7 @@
}
@Override
- public TypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
+ public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
this.nextIsDefaultLocation = (this.defaultNullness & Binding.DefaultLocationTypeParameter) != 0;
this.nextIsTypeBound = false;
if (this.isEmpty) return restrict(this.matches, this.pathPtr);
@@ -149,16 +157,23 @@
@Override
public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId) {
IBinaryAnnotation[] normalAnnotations = this.isEmpty ? null : super.getAnnotationsAtCursor(currentTypeId);
- if (this.atDefaultLocation &&
+ if (this.atDefaultLocation &&
+ !(currentTypeId == -1) && // never apply default on type variable use or wildcard
!(this.atTypeBound && currentTypeId == TypeIds.T_JavaLangObject)) // for CLIMB-to-top consider a j.l.Object type bound as no explicit type bound
{
if (normalAnnotations == null || normalAnnotations.length == 0)
return new IBinaryAnnotation[] { this.nonNullAnnotation };
- int len = normalAnnotations.length;
- IBinaryAnnotation[] newAnnots = new IBinaryAnnotation[len+1];
- System.arraycopy(normalAnnotations, 0, newAnnots, 0, len);
- newAnnots[len] = this.nonNullAnnotation;
- return newAnnots;
+ if (this.environment.containsNullTypeAnnotation(normalAnnotations)) {
+ // no default annotation if explicit annotation exists
+ return normalAnnotations;
+ } else {
+ // merge:
+ int len = normalAnnotations.length;
+ IBinaryAnnotation[] newAnnots = new IBinaryAnnotation[len+1];
+ System.arraycopy(normalAnnotations, 0, newAnnots, 0, len);
+ newAnnots[len] = this.nonNullAnnotation;
+ return newAnnots;
+ }
}
return normalAnnotations;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java
index 3544c65..7cc0930 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/classfmt/TypeAnnotationWalker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2015 GK Software AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,37 +13,11 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
-/**
- * A TypeAnnotationWalker is initialized with all type annotations found at a given element.
- * It can be used to walk into the types at the given element and finally answer the
- * actual annotations at any node of the walk.
- *
- * The walker is implemented as immutable objects. During the walk either new instances
- * are created, or the current instance is shared if no difference is encountered.
- */
-public class TypeAnnotationWalker {
+/** Type annotation walker implementation based an actual annotations decoded from a .class file. */
+public class TypeAnnotationWalker implements ITypeAnnotationWalker {
- public static final IBinaryAnnotation[] NO_ANNOTATIONS = new IBinaryAnnotation[0];
-
- /**
- * A no-effect annotation walker, all walking methods are implemented as identity-functions.
- * At the end of any walk an empty array of annotations is returned.
- */
- public static final TypeAnnotationWalker EMPTY_ANNOTATION_WALKER = new TypeAnnotationWalker(new IBinaryTypeAnnotation[0], 0L) {
- public TypeAnnotationWalker toField() { return this; }
- public TypeAnnotationWalker toTarget(int targetType) { return this; }
- public TypeAnnotationWalker toThrows(int rank) { return this; }
- public TypeAnnotationWalker toTypeArgument(int rank) { return this; }
- public TypeAnnotationWalker toMethodParameter(short index) { return this; }
- public TypeAnnotationWalker toSupertype(short index) { return this; }
- public TypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) { return this; }
- public TypeAnnotationWalker toTypeBound(short boundIndex) { return this; }
- public TypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) { return this; }
- public TypeAnnotationWalker toNextDetail(int detailKind) { return this; }
- public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId) { return NO_ANNOTATIONS; }
- };
-
final protected IBinaryTypeAnnotation[] typeAnnotations; // the actual material we're managing here
final protected long matches; // bit mask of indices into typeAnnotations, 1 means active, 0 is filtered during the walk
final protected int pathPtr; // pointer into the typePath
@@ -61,7 +35,7 @@
this.pathPtr = pathPtr;
}
- protected TypeAnnotationWalker restrict(long newMatches, int newPathPtr) {
+ protected ITypeAnnotationWalker restrict(long newMatches, int newPathPtr) {
if (this.matches == newMatches && this.pathPtr == newPathPtr) return this;
if (newMatches == 0 || this.typeAnnotations == null || this.typeAnnotations.length == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -70,28 +44,25 @@
// ==== filter by top-level targetType: ====
- /** Walk to a field. */
- public TypeAnnotationWalker toField() {
+ @Override
+ public ITypeAnnotationWalker toField() {
return toTarget(AnnotationTargetTypeConstants.FIELD);
}
- /** Walk to the return type of a method. */
- public TypeAnnotationWalker toMethodReturn() {
+ @Override
+ public ITypeAnnotationWalker toMethodReturn() {
return toTarget(AnnotationTargetTypeConstants.METHOD_RETURN);
}
- /**
- * Walk to the receiver type of a method.
- * Note: Type annotations on receiver are not currently used by the compiler.
- */
- public TypeAnnotationWalker toReceiver() {
+ @Override
+ public ITypeAnnotationWalker toReceiver() {
return toTarget(AnnotationTargetTypeConstants.METHOD_RECEIVER);
}
/*
* Implementation for walking to methodReturn, receiver type or field.
*/
- protected TypeAnnotationWalker toTarget(int targetType) {
+ protected ITypeAnnotationWalker toTarget(int targetType) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -104,12 +75,8 @@
return restrict(newMatches, 0);
}
- /**
- * Walk to the type parameter of the given rank.
- * @param isClassTypeParameter whether we are looking for a class type parameter (else: method type type parameter)
- * @param rank rank of the type parameter
- */
- public TypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
+ @Override
+ public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -125,13 +92,8 @@
return restrict(newMatches, 0);
}
- /**
- * Walk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter).
- * Clients must then call {@link #toTypeBound(short)} on the resulting walker.
- * @param isClassTypeParameter whether we are looking at a class type parameter (else: method type type parameter)
- * @param parameterRank rank of the type parameter.
- */
- public TypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
+ @Override
+ public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -147,12 +109,9 @@
}
return restrict(newMatches, 0);
}
- /**
- * Detail of {@link #toTypeParameterBounds(boolean, int)}: walk to the bounds
- * of the previously selected type parameter.
- * @param boundIndex
- */
- public TypeAnnotationWalker toTypeBound(short boundIndex) {
+
+ @Override
+ public ITypeAnnotationWalker toTypeBound(short boundIndex) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -168,8 +127,12 @@
}
- /** Walk to the specified supertype: -1 is superclass, else the superinterface at the given index. */
- public TypeAnnotationWalker toSupertype(short index) {
+ /**
+ * {@inheritDoc}
+ * <p>(superTypesSignature is ignored in this implementation).</p>
+ */
+ @Override
+ public ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -184,8 +147,8 @@
return restrict(newMatches, 0);
}
- /** Walk to the index'th visible formal method parameter (i.e., not counting synthetic args). */
- public TypeAnnotationWalker toMethodParameter(short index) {
+ @Override
+ public ITypeAnnotationWalker toMethodParameter(short index) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -200,10 +163,8 @@
return restrict(newMatches, 0);
}
- /**
- * Walk to the throws type at the given index.
- */
- public TypeAnnotationWalker toThrows(int index) {
+ @Override
+ public ITypeAnnotationWalker toThrows(int index) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -220,8 +181,8 @@
// ==== descending into details: ====
- /** Walk to the type argument of the given rank. */
- public TypeAnnotationWalker toTypeArgument(int rank) {
+ @Override
+ public ITypeAnnotationWalker toTypeArgument(int rank) {
// like toNextDetail() but also checking byte 2 against rank
long newMatches = this.matches;
if (newMatches == 0)
@@ -240,8 +201,8 @@
return restrict(newMatches, this.pathPtr+2);
}
- /** Walk to the bound of a wildcard. */
- public TypeAnnotationWalker toWildcardBound() {
+ @Override
+ public ITypeAnnotationWalker toWildcardBound() {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -258,25 +219,20 @@
return restrict(newMatches, this.pathPtr+2);
}
- /**
- * Descend down one level of array dimensions.
- */
- public TypeAnnotationWalker toNextArrayDimension() {
+ @Override
+ public ITypeAnnotationWalker toNextArrayDimension() {
return toNextDetail(AnnotationTargetTypeConstants.NEXT_ARRAY_DIMENSION);
}
- /**
- * Descend down one level of type nesting.
- */
- public TypeAnnotationWalker toNextNestedType() {
+ @Override
+ public ITypeAnnotationWalker toNextNestedType() {
return toNextDetail(AnnotationTargetTypeConstants.NEXT_NESTED_TYPE);
}
/*
* Implementation for walking along the type_path for array dimensions & nested types.
- * FIXME(stephan): support wildcard bounds.
*/
- protected TypeAnnotationWalker toNextDetail(int detailKind) {
+ protected ITypeAnnotationWalker toNextDetail(int detailKind) {
long newMatches = this.matches;
if (newMatches == 0)
return EMPTY_ANNOTATION_WALKER;
@@ -294,10 +250,7 @@
// ==== leaves: the actual annotations: ====
- /**
- * Retrieve the type annotations at the current position
- * reached by invocations of toXYZ() methods.
- */
+ @Override
public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId) {
int length = this.typeAnnotations.length;
IBinaryAnnotation[] filtered = new IBinaryAnnotation[length];
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
index 80d4adb..116a2ec 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java
@@ -19,6 +19,9 @@
* Bug 409236 - [1.8][compiler] Type annotations on intersection cast types dropped by code generator
* Bug 409250 - [1.8][compiler] Various loose ends in 308 code generation
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
+ * Bug 449467 - [1.8][compiler] Invalid lambda deserialization with anonymous class
+ * Olivier Tardieu (tardieu@us.ibm.com) - Contributions for
+ * Bug 442418 - $deserializeLambda$ off-by-one error when deserializing the captured arguments of a lambda that also capture this
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.codegen;
@@ -2651,8 +2654,8 @@
ConstantPool.GetFunctionalInterfaceClass, ConstantPool.GetFunctionalInterfaceClassSignature);
String functionalInterface = null;
final TypeBinding expectedType = lambdaEx.expectedType();
- if (expectedType instanceof IntersectionCastTypeBinding) {
- functionalInterface = new String(((IntersectionCastTypeBinding)expectedType).getSAMType(scope).constantPoolName());
+ if (expectedType instanceof IntersectionTypeBinding18) {
+ functionalInterface = new String(((IntersectionTypeBinding18)expectedType).getSAMType(scope).constantPoolName());
} else {
functionalInterface = new String(expectedType.constantPoolName());
}
@@ -2680,7 +2683,7 @@
aload_0();
invoke(Opcodes.OPC_invokevirtual, 1, 1, ConstantPool.JavaLangInvokeSerializedLambdaConstantPoolName,
ConstantPool.GetImplClass, ConstantPool.GetImplClassSignature);
- ldc(new String(CharOperation.concatWith(mb.declaringClass.compoundName,'/'))); // e.g. "com/foo/X"
+ ldc(new String(mb.declaringClass.constantPoolName())); // e.g. "com/foo/X"
invokeObjectEquals();
ifeq(errorLabel);
@@ -2707,7 +2710,7 @@
SyntheticArgumentBinding[] outerLocalVariables = lambdaEx.outerLocalVariables;
for (int p=0,max=outerLocalVariables.length;p<max;p++) {
aload_0();
- loadInt(p);
+ loadInt(index);
invoke(Opcodes.OPC_invokevirtual, 1, 1, ConstantPool.JavaLangInvokeSerializedLambdaConstantPoolName,
ConstantPool.GetCapturedArg, ConstantPool.GetCapturedArgSignature);
TypeBinding varType = outerLocalVariables[p].type;
@@ -2724,8 +2727,8 @@
sig.append(varType.signature());
}
sig.append(")"); //$NON-NLS-1$
- if (lambdaEx.resolvedType instanceof IntersectionCastTypeBinding) {
- sig.append(((IntersectionCastTypeBinding)lambdaEx.resolvedType).getSAMType(scope).signature());
+ if (lambdaEx.resolvedType instanceof IntersectionTypeBinding18) {
+ sig.append(((IntersectionTypeBinding18)lambdaEx.resolvedType).getSAMType(scope).signature());
} else {
sig.append(lambdaEx.resolvedType.signature());
}
@@ -3382,7 +3385,7 @@
&& (options.complianceLevel >= ClassFileConstants.JDK1_4 || !(isImplicitThisReceiver && codegenBinding.isStatic()))
&& codegenBinding.declaringClass.id != TypeIds.T_JavaLangObject) // no change for Object methods
|| !codegenBinding.declaringClass.canBeSeenBy(currentScope)) {
- if (!actualReceiverType.isIntersectionCastType()) // no constant pool representation. FIXME, visibility issue not handled.
+ if (!actualReceiverType.isIntersectionType18()) // no constant pool representation. FIXME, visibility issue not handled.
constantPoolDeclaringClass = actualReceiverType.erasure();
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
index e8eaffe..c3ec093 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java
@@ -260,7 +260,7 @@
public static final char[] JAVA_LANG_ANNOTATION_INHERITED = "Ljava/lang/annotation/Inherited;".toCharArray(); //$NON-NLS-1$
// java 7 java.lang.SafeVarargs
public static final char[] JAVA_LANG_SAFEVARARGS = "Ljava/lang/SafeVarargs;".toCharArray(); //$NON-NLS-1$
- // java 7 java.lang.invoke.MethodHandle.invokeExact(..)/invokeGeneric(..)
+ // java 7 java.lang.invoke.MethodHandle.invokeExact(..)/invoke(..)
public static final char[] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = "Ljava/lang/invoke/MethodHandle$PolymorphicSignature;".toCharArray(); //$NON-NLS-1$
// Java 8 lambda support
public static final char[] METAFACTORY = "metafactory".toCharArray(); //$NON-NLS-1$
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
index 0b39b7c..7116b78 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,10 +9,13 @@
* IBM Corporation - initial API and implementation
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* bug 407191 - [1.8] Binary access support for type annotations
+ * Stephan Herrmann - Contribution for
+ * Bug 440474 - [null] textual encoding of external null annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.env;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
public interface IBinaryType extends IGenericType {
@@ -148,4 +151,13 @@
char[] sourceFileName();
+/**
+ * Answer a type annotation walker that takes into consideration also external annotations.
+ * @param walker previous walker, may be empty, otherwise it will be returned unchanged
+ * @param member if either a IBinaryField or a IBinaryMethod is provided, answer a walker specifically for that member
+ * @param environment for use by the walker
+ * @return either a matching walker with data from external annotations or the walker provided via argument 'walker'.
+ */
+ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member, LookupEnvironment environment);
+
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java
new file mode 100644
index 0000000..edc42fd
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/env/ITypeAnnotationWalker.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2015 GK Software AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Stephan Herrmann - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.compiler.env;
+
+
+/**
+ * A TypeAnnotationWalker is initialized with all type annotations found at a given element.
+ * It can be used to walk into the types at the given element and finally answer the
+ * actual annotations at any node of the walk.
+ *
+ * The walker is implemented as immutable objects. During the walk either new instances
+ * are created, or the current instance is shared if no difference is encountered.
+ */
+public interface ITypeAnnotationWalker {
+
+ public static final IBinaryAnnotation[] NO_ANNOTATIONS = new IBinaryAnnotation[0];
+ /**
+ * A no-effect annotation walker, all walking methods are implemented as identity-functions.
+ * At the end of any walk an empty array of annotations is returned.
+ */
+ public static final ITypeAnnotationWalker EMPTY_ANNOTATION_WALKER = new ITypeAnnotationWalker() {
+ public ITypeAnnotationWalker toField() { return this; }
+ public ITypeAnnotationWalker toThrows(int rank) { return this; }
+ public ITypeAnnotationWalker toTypeArgument(int rank) { return this; }
+ public ITypeAnnotationWalker toMethodParameter(short index) { return this; }
+ public ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature) { return this; }
+ public ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank) { return this; }
+ public ITypeAnnotationWalker toTypeBound(short boundIndex) { return this; }
+ public ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank) { return this; }
+ public ITypeAnnotationWalker toMethodReturn() { return this; }
+ public ITypeAnnotationWalker toReceiver() { return this; }
+ public ITypeAnnotationWalker toWildcardBound() { return this; }
+ public ITypeAnnotationWalker toNextArrayDimension() { return this; }
+ public ITypeAnnotationWalker toNextNestedType() { return this; }
+ public IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId) { return NO_ANNOTATIONS; }
+ };
+
+ /** Walk to a field. */
+ public abstract ITypeAnnotationWalker toField();
+
+
+ /** Walk to the return type of a method. */
+ public abstract ITypeAnnotationWalker toMethodReturn();
+
+ /**
+ * Walk to the receiver type of a method.
+ * Note: Type annotations on receiver are not currently used by the compiler.
+ */
+ public abstract ITypeAnnotationWalker toReceiver();
+
+ /**
+ * Walk to the type parameter of the given rank.
+ * @param isClassTypeParameter whether we are looking for a class type parameter (else: method type parameter)
+ * @param rank rank of the type parameter
+ */
+ public abstract ITypeAnnotationWalker toTypeParameter(boolean isClassTypeParameter, int rank);
+
+ /**
+ * Walk to the bounds of a type parameter of either a class or a method (signaled by isClassTypeParameter).
+ * Clients must then call {@link #toTypeBound(short)} on the resulting walker.
+ * @param isClassTypeParameter whether we are looking at a class type parameter (else: method type parameter)
+ * @param parameterRank rank of the type parameter.
+ */
+ public abstract ITypeAnnotationWalker toTypeParameterBounds(boolean isClassTypeParameter, int parameterRank);
+
+ /**
+ * Detail of {@link #toTypeParameterBounds(boolean, int)}: walk to the bounds
+ * of the previously selected type parameter.
+ * @param boundIndex
+ */
+ public abstract ITypeAnnotationWalker toTypeBound(short boundIndex);
+
+ /** Walk to the specified supertype either index based or name based:
+ * @param index -1 is superclass, else index into the list of superinterfaces
+ * @param superTypeSignature name and type arguments of the super type to visit
+ */
+ public abstract ITypeAnnotationWalker toSupertype(short index, char[] superTypeSignature);
+
+ /** Walk to the index'th visible formal method parameter (i.e., not counting synthetic args). */
+ public abstract ITypeAnnotationWalker toMethodParameter(short index);
+
+ /**
+ * Walk to the throws type at the given index.
+ */
+ public abstract ITypeAnnotationWalker toThrows(int index);
+
+ /** Walk to the type argument of the given rank. */
+ public abstract ITypeAnnotationWalker toTypeArgument(int rank);
+
+ /** Walk to the bound of a wildcard. */
+ public abstract ITypeAnnotationWalker toWildcardBound();
+
+ /**
+ * Descend down one level of array dimensions.
+ */
+ public abstract ITypeAnnotationWalker toNextArrayDimension();
+
+ /**
+ * Descend down one level of type nesting.
+ */
+ public abstract ITypeAnnotationWalker toNextNestedType();
+
+ /**
+ * Retrieve the type annotations at the current position
+ * reached by invocations of toXYZ() methods.
+ * @param currentTypeId the id of the type being annotated; 0 signals don't care / unknown;
+ * -1 signals if annotating a wildcard or a use of a type variable.
+ */
+ public abstract IBinaryAnnotation[] getAnnotationsAtCursor(int currentTypeId);
+
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
index 4ed6d16..d142333 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,8 @@
* Stephan Herrmann - Contribution for
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 402993 - [null] Follow up of bug 401088: Missing warning about redundant null check
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 421035 - [resource] False alarm of resource leak warning when casting a closeable in its assignment
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.flow;
@@ -79,7 +81,11 @@
FlowInfo flowInfo) {
this(parent, tryStatement, handledExceptions, exceptionToCatchBlockMap,
tryStatement.catchArguments, initializationParent, scope, flowInfo.unconditionalInits());
- this.initsOnFinally = flowInfo.unconditionalCopy();
+ UnconditionalFlowInfo unconditionalCopy = flowInfo.unconditionalCopy();
+ unconditionalCopy.iNBit = -1L;
+ unconditionalCopy.iNNBit = -1L;
+ unconditionalCopy.tagBits |= FlowInfo.UNROOTED;
+ this.initsOnFinally = unconditionalCopy;
}
ExceptionHandlingFlowContext(
FlowContext parent,
@@ -196,7 +202,10 @@
return node;
}
-
+@Override
+public FlowContext getInitializationContext() {
+ return this.initializationParent;
+}
public String individualToString() {
StringBuffer buffer = new StringBuffer("Exception flow context"); //$NON-NLS-1$
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionInferenceFlowContext.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionInferenceFlowContext.java
new file mode 100644
index 0000000..5d5244f
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/ExceptionInferenceFlowContext.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.compiler.flow;
+
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+/**
+ * Reflects the context of code analysis, keeping track of enclosing
+ * try statements, exception handlers, etc...
+ */
+
+public class ExceptionInferenceFlowContext extends ExceptionHandlingFlowContext {
+ public ExceptionInferenceFlowContext(
+ FlowContext parent,
+ ASTNode associatedNode,
+ ReferenceBinding[] handledExceptions,
+ FlowContext initializationParent,
+ BlockScope scope,
+ UnconditionalFlowInfo flowInfo) {
+ super(parent, associatedNode, handledExceptions, initializationParent, scope, flowInfo);
+}
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java
index 14f057a..308fd64 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,8 @@
* bug 385626 - @NonNull fails across loop boundaries
* bug 388996 - [compiler][resource] Incorrect 'potential resource leak'
* bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 455723 - Nonnull argument not correctly inferred in loop
* Jesper S Moller - Contributions for
* bug 404657 - [1.8][compiler] Analysis for effectively final variables fails to consider loops
*******************************************************************************/
@@ -111,7 +113,7 @@
int nullStatus = flowInfo.nullStatus(this.nullLocals[i]);
if (nullStatus != FlowInfo.NON_NULL) {
this.parent.recordNullityMismatch(scope, (Expression) location,
- this.providedExpectedTypes[i][0], this.providedExpectedTypes[i][1], nullStatus);
+ this.providedExpectedTypes[i][0], this.providedExpectedTypes[i][1], flowInfo, nullStatus, null);
}
break;
case IN_UNBOXING:
@@ -423,7 +425,7 @@
// never happens
}
}
- recordNullReference(local, location, checkType);
+ recordNullReference(local, location, checkType, flowInfo);
// prepare to re-check with try/catch flow info
}
}
@@ -439,7 +441,7 @@
}
protected void recordNullReference(LocalVariableBinding local,
- ASTNode expression, int checkType) {
+ ASTNode expression, int checkType, FlowInfo nullInfo) {
if (this.nullCount == 0) {
this.nullLocals = new LocalVariableBinding[5];
this.nullReferences = new ASTNode[5];
@@ -465,14 +467,14 @@
if (nullStatus == FlowInfo.NULL)
super.recordUnboxing(scope, expression, nullStatus, flowInfo);
else // defer checking:
- recordNullReference(null, expression, IN_UNBOXING);
+ recordNullReference(null, expression, IN_UNBOXING, flowInfo);
}
-protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, int nullStatus, TypeBinding expectedType, int checkType) {
+protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, FlowInfo flowInfo, int nullStatus, TypeBinding expectedType, int checkType) {
// cf. decision structure inside FinallyFlowContext.recordUsingNullReference(..)
if (nullStatus == FlowInfo.UNKNOWN ||
((this.tagBits & FlowContext.DEFER_NULL_DIAGNOSTIC) != 0 && nullStatus != FlowInfo.NULL)) {
recordProvidedExpectedTypes(providedType, expectedType, this.nullCount);
- recordNullReference(expression.localVariableBinding(), expression, checkType);
+ recordNullReference(expression.localVariableBinding(), expression, checkType, flowInfo);
return true;
}
return false;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
index b4b324a..9eff068 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,10 @@
* bug 402993 - [null] Follow up of bug 401088: Missing warning about redundant null check
* bug 403086 - [compiler][null] include the effect of 'assert' in syntactic null analysis for fields
* bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 455723 - Nonnull argument not correctly inferred in loop
+ * Bug 415790 - [compiler][resource]Incorrect potential resource leak warning in for loop with close in try/catch
+ * Bug 446691 - [1.8][null][compiler] NullPointerException in SingleNameReference.analyseCode
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.flow;
@@ -29,6 +33,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FakedTrackingVariable;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LabeledStatement;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Reference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SubRoutineStatement;
@@ -251,20 +256,22 @@
caughtIndex < caughtCount;
caughtIndex++) {
ReferenceBinding caughtException = caughtExceptions[caughtIndex];
+ FlowInfo exceptionFlow = flowInfo;
int state = caughtException == null
? Scope.EQUAL_OR_MORE_SPECIFIC /* any exception */
: Scope.compareTypes(raisedException, caughtException);
if (abruptlyExitedLoops != null && caughtException != null && state != Scope.NOT_RELATED) {
for (int i = 0, abruptlyExitedLoopsCount = abruptlyExitedLoops.size(); i < abruptlyExitedLoopsCount; i++) {
LoopingFlowContext loop = (LoopingFlowContext) abruptlyExitedLoops.get(i);
- loop.recordCatchContextOfEscapingException(exceptionContext, caughtException);
+ loop.recordCatchContextOfEscapingException(exceptionContext, caughtException, flowInfo);
}
+ exceptionFlow = FlowInfo.DEAD_END; // don't use flow info on first round, flow info will be evaluated during loopback simulation
}
switch (state) {
case Scope.EQUAL_OR_MORE_SPECIFIC :
exceptionContext.recordHandlingException(
caughtException,
- flowInfo.unconditionalInits(),
+ exceptionFlow.unconditionalInits(),
raisedException,
raisedException, // precise exception that will be caught
location,
@@ -275,7 +282,7 @@
case Scope.MORE_GENERIC :
exceptionContext.recordHandlingException(
caughtException,
- flowInfo.unconditionalInits(),
+ exceptionFlow.unconditionalInits(),
raisedException,
caughtException,
location,
@@ -290,16 +297,18 @@
if (exceptionContext.isMethodContext) {
if (raisedException.isUncheckedException(false))
return;
+ boolean shouldMergeUnhandledExceptions = exceptionContext instanceof ExceptionInferenceFlowContext;
// anonymous constructors are allowed to throw any exceptions (their thrown exceptions
// clause will be fixed up later as per JLS 8.6).
if (exceptionContext.associatedNode instanceof AbstractMethodDeclaration){
AbstractMethodDeclaration method = (AbstractMethodDeclaration)exceptionContext.associatedNode;
- if (method.isConstructor() && method.binding.declaringClass.isAnonymousType()){
-
- exceptionContext.mergeUnhandledException(raisedException);
- return; // no need to complain, will fix up constructor exceptions
+ if (method.isConstructor() && method.binding.declaringClass.isAnonymousType())
+ shouldMergeUnhandledExceptions = true;
}
+ if (shouldMergeUnhandledExceptions) {
+ exceptionContext.mergeUnhandledException(raisedException);
+ return; // no need to complain, will fix up constructor/lambda exceptions
}
break; // not handled anywhere, thus jump to error handling
}
@@ -383,20 +392,22 @@
for (int raisedIndex = 0; raisedIndex < raisedCount; raisedIndex++) {
TypeBinding raisedException;
if ((raisedException = raisedExceptions[raisedIndex]) != null) {
+ FlowInfo exceptionFlow = flowInfo;
int state = caughtException == null
? Scope.EQUAL_OR_MORE_SPECIFIC /* any exception */
: Scope.compareTypes(raisedException, caughtException);
if (abruptlyExitedLoops != null && caughtException != null && state != Scope.NOT_RELATED) {
for (int i = 0, abruptlyExitedLoopsCount = abruptlyExitedLoops.size(); i < abruptlyExitedLoopsCount; i++) {
LoopingFlowContext loop = (LoopingFlowContext) abruptlyExitedLoops.get(i);
- loop.recordCatchContextOfEscapingException(exceptionContext, caughtException);
+ loop.recordCatchContextOfEscapingException(exceptionContext, caughtException, flowInfo);
}
+ exceptionFlow = FlowInfo.DEAD_END; // don't use flow info on first round, flow info will be evaluated during loopback simulation
}
switch (state) {
case Scope.EQUAL_OR_MORE_SPECIFIC :
exceptionContext.recordHandlingException(
caughtException,
- flowInfo.unconditionalInits(),
+ exceptionFlow.unconditionalInits(),
raisedException,
raisedException, // precise exception that will be caught
location,
@@ -411,7 +422,7 @@
case Scope.MORE_GENERIC :
exceptionContext.recordHandlingException(
caughtException,
- flowInfo.unconditionalInits(),
+ exceptionFlow.unconditionalInits(),
raisedException,
caughtException,
location,
@@ -439,20 +450,22 @@
}
}
}
+ boolean shouldMergeUnhandledException = exceptionContext instanceof ExceptionInferenceFlowContext;
// anonymous constructors are allowed to throw any exceptions (their thrown exceptions
// clause will be fixed up later as per JLS 8.6).
if (exceptionContext.associatedNode instanceof AbstractMethodDeclaration){
AbstractMethodDeclaration method = (AbstractMethodDeclaration)exceptionContext.associatedNode;
- if (method.isConstructor() && method.binding.declaringClass.isAnonymousType()){
-
+ if (method.isConstructor() && method.binding.declaringClass.isAnonymousType())
+ shouldMergeUnhandledException = true;
+ }
+ if (shouldMergeUnhandledException) {
for (int i = 0; i < raisedCount; i++) {
TypeBinding raisedException;
if ((raisedException = raisedExceptions[i]) != null) {
exceptionContext.mergeUnhandledException(raisedException);
}
}
- return; // no need to complain, will fix up constructor exceptions
- }
+ return; // no need to complain, will fix up constructor/lambda exceptions
}
break; // not handled anywhere, thus jump to error handling
}
@@ -511,7 +524,7 @@
current = initializationContext.initializationParent;
} else if (current instanceof ExceptionHandlingFlowContext) {
ExceptionHandlingFlowContext exceptionContext = (ExceptionHandlingFlowContext) current;
- current = exceptionContext.initializationParent == null ? exceptionContext.getLocalParent() : exceptionContext.initializationParent;
+ current = exceptionContext.initializationParent == null ? exceptionContext.parent : exceptionContext.initializationParent;
} else {
current = current.getLocalParent();
}
@@ -620,6 +633,13 @@
}
/**
+ * Answer flow context that corresponds to initialization. Suitably override in subtypes.
+ */
+public FlowContext getInitializationContext() {
+ return null;
+}
+
+/**
* Answer the parent flow context but be careful not to cross the boundary of a nested type,
* or null if no such parent exists.
*/
@@ -775,9 +795,10 @@
* {@link #IN_COMPARISON_NON_NULL}, {@link #IN_ASSIGNMENT} or {@link #IN_INSTANCEOF}).
* <br>
* Alternatively, a {@link #IN_UNBOXING} check can e requested.
+ * @param nullInfo the null flow info observed at this first visit of location.
*/
protected void recordNullReference(LocalVariableBinding local,
- ASTNode location, int checkType) {
+ ASTNode location, int checkType, FlowInfo nullInfo) {
// default implementation: do nothing
}
@@ -988,9 +1009,11 @@
* @param expression the expression violating the specification
* @param providedType the type of the provided value, i.e., either expression or an element thereof (in ForeachStatements)
* @param expectedType the declared type of the spec'ed variable, for error reporting.
+ * @param flowInfo the flowInfo observed when visiting expression
* @param nullStatus the null status of expression at the current location
+ * @param annotationStatus status from type annotation analysis, or null
*/
-public void recordNullityMismatch(BlockScope currentScope, Expression expression, TypeBinding providedType, TypeBinding expectedType, int nullStatus) {
+public void recordNullityMismatch(BlockScope currentScope, Expression expression, TypeBinding providedType, TypeBinding expectedType, FlowInfo flowInfo, int nullStatus, NullAnnotationMatching annotationStatus) {
if (providedType == null) {
return; // assume type error was already reported
}
@@ -1003,16 +1026,19 @@
if ((this.tagBits & FlowContext.HIDE_NULL_COMPARISON_WARNING) != 0) {
isInsideAssert = FlowContext.HIDE_NULL_COMPARISON_WARNING;
}
- if (currentContext.internalRecordNullityMismatch(expression, providedType, nullStatus, expectedType, ASSIGN_TO_NONNULL | isInsideAssert))
+ if (currentContext.internalRecordNullityMismatch(expression, providedType, flowInfo, nullStatus, expectedType, ASSIGN_TO_NONNULL | isInsideAssert))
return;
currentContext = currentContext.parent;
}
}
// no reason to defer, so report now:
- char[][] annotationName = currentScope.environment().getNonNullAnnotationName();
- currentScope.problemReporter().nullityMismatch(expression, providedType, expectedType, nullStatus, annotationName);
+ if (annotationStatus != null)
+ currentScope.problemReporter().nullityMismatchingTypeAnnotation(expression, providedType, expectedType, annotationStatus);
+ else
+ currentScope.problemReporter().nullityMismatch(expression, providedType, expectedType, nullStatus,
+ currentScope.environment().getNonNullAnnotationName());
}
-protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, int nullStatus, TypeBinding expectedType, int checkType) {
+protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, FlowInfo flowInfo, int nullStatus, TypeBinding expectedType, int checkType) {
// nop, to be overridden in subclasses
return false; // not recorded
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
index 3edd333..fafcdfb 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
* bug 332637 - Dead Code detection removing code that isn't dead
* bug 394768 - [compiler][resource] Incorrect resource leak warning when creating stream in conditional
* Bug 411964 - [1.8][null] leverage null type annotation in foreach statement
+ * Bug 421035 - [resource] False alarm of resource leak warning when casting a closeable in its assignment
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.flow;
@@ -50,6 +51,8 @@
public final static int POTENTIALLY_NULL = 16;
public final static int POTENTIALLY_NON_NULL = 32;
+ public final static int UNROOTED = 64; // marks a flowInfo that may be appended to another flowInfo (accepting incoming nulls/nonnulls, see UFI.iNBit/iNNBit).
+
public static final UnconditionalFlowInfo DEAD_END; // Represents a dead branch status of initialization
static {
DEAD_END = new UnconditionalFlowInfo();
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java
index d6c147d..4f489df 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java
@@ -51,6 +51,11 @@
}
}
+ @Override
+ public FlowContext getInitializationContext() {
+ return this;
+ }
+
public String individualToString() {
StringBuffer buffer = new StringBuffer("Initialization flow context"); //$NON-NLS-1$
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
index 55a85e3..845193d 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,11 @@
* bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking
* bug 406384 - Internal error with I20130413
* Bug 415413 - [compiler][null] NullpointerException in Null Analysis caused by interaction of LoopingFlowContext and FinallyFlowContext
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 455557 - [jdt] NPE LoopingFlowContext.recordNullReference
+ * Bug 455723 - Nonnull argument not correctly inferred in loop
+ * Bug 415790 - [compiler][resource]Incorrect potential resource leak warning in for loop with close in try/catch
+ * Bug 421035 - [resource] False alarm of resource leak warning when casting a closeable in its assignment
* Jesper S Moller - contributions for
* bug 404657 - [1.8][compiler] Analysis for effectively final variables fails to consider loops
*******************************************************************************/
@@ -66,6 +71,7 @@
ASTNode[] nullReferences; // Expressions for null checking, Statements for resource analysis
// cast to Expression is safe if corresponding nullCheckType != EXIT_RESOURCE
int[] nullCheckTypes;
+ UnconditionalFlowInfo[] nullInfos; // detailed null info observed during the first visit of nullReferences[i], or null
int nullCount;
// see also the related field FlowContext#expectedTypes
@@ -73,13 +79,16 @@
static private class EscapingExceptionCatchSite {
final ReferenceBinding caughtException;
final ExceptionHandlingFlowContext catchingContext;
- public EscapingExceptionCatchSite(ExceptionHandlingFlowContext catchingContext, ReferenceBinding caughtException) {
+ final FlowInfo exceptionInfo; // flow leading to the location of throwing
+ public EscapingExceptionCatchSite(ExceptionHandlingFlowContext catchingContext, ReferenceBinding caughtException, FlowInfo exceptionInfo) {
this.catchingContext = catchingContext;
this.caughtException = caughtException;
+ this.exceptionInfo = exceptionInfo;
}
void simulateThrowAfterLoopBack(FlowInfo flowInfo) {
this.catchingContext.recordHandlingException(this.caughtException,
- flowInfo.unconditionalInits(), null, // raised exception, irrelevant here,
+ flowInfo.unconditionalCopy().addNullInfoFrom(this.exceptionInfo).unconditionalInits(),
+ null, // raised exception, irrelevant here,
null, null, /* invocation site, irrelevant here */ true // we have no business altering the needed status.
);
}
@@ -160,13 +169,16 @@
}
this.innerFlowContextsCount = 0;
FlowInfo upstreamCopy = this.upstreamNullFlowInfo.copy();
- UnconditionalFlowInfo flowInfo = this.upstreamNullFlowInfo.
+ UnconditionalFlowInfo incomingInfo = this.upstreamNullFlowInfo.
addPotentialNullInfoFrom(callerFlowInfo.unconditionalInitsWithoutSideEffect());
if ((this.tagBits & FlowContext.DEFER_NULL_DIAGNOSTIC) != 0) {
// check only immutable null checks on innermost looping context
for (int i = 0; i < this.nullCount; i++) {
LocalVariableBinding local = this.nullLocals[i];
ASTNode location = this.nullReferences[i];
+ FlowInfo flowInfo = (this.nullInfos[i] != null)
+ ? incomingInfo.copy().addNullInfoFrom(this.nullInfos[i])
+ : incomingInfo;
// final local variable
switch (this.nullCheckTypes[i] & ~HIDE_NULL_COMPARISON_WARNING_MASK) {
case CAN_ONLY_NON_NULL | IN_COMPARISON_NULL:
@@ -268,7 +280,7 @@
case ASSIGN_TO_NONNULL:
int nullStatus = flowInfo.nullStatus(local);
if (nullStatus != FlowInfo.NON_NULL) {
- this.parent.recordNullityMismatch(scope, (Expression)location, this.providedExpectedTypes[i][0], this.providedExpectedTypes[i][1], nullStatus);
+ this.parent.recordNullityMismatch(scope, (Expression)location, this.providedExpectedTypes[i][0], this.providedExpectedTypes[i][1], flowInfo, nullStatus, null);
}
continue; // no more delegation to parent
case EXIT_RESOURCE:
@@ -306,6 +318,9 @@
ASTNode location = this.nullReferences[i];
// final local variable
LocalVariableBinding local = this.nullLocals[i];
+ FlowInfo flowInfo = (this.nullInfos[i] != null)
+ ? incomingInfo.copy().addNullInfoFrom(this.nullInfos[i])
+ : incomingInfo;
switch (this.nullCheckTypes[i] & ~HIDE_NULL_COMPARISON_WARNING_MASK) {
case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
@@ -403,7 +418,7 @@
}
nullStatus = closeTracker.findMostSpecificStatus(flowInfo, scope, null);
closeTracker.recordErrorLocation(this.nullReferences[i], nullStatus);
- closeTracker.reportRecordedErrors(scope, nullStatus);
+ closeTracker.reportRecordedErrors(scope, nullStatus, flowInfo.reachMode() != FlowInfo.REACHABLE);
this.nullReferences[i] = null;
continue;
}
@@ -418,9 +433,9 @@
}
}
// propagate breaks
- this.initsOnBreak.addPotentialNullInfoFrom(flowInfo);
+ this.initsOnBreak.addPotentialNullInfoFrom(incomingInfo);
for (int i = 0; i < this.breakTargetsCount; i++) {
- this.breakTargetContexts[i].initsOnBreak.addPotentialNullInfoFrom(flowInfo);
+ this.breakTargetContexts[i].initsOnBreak.addPotentialNullInfoFrom(incomingInfo);
}
}
@@ -534,11 +549,12 @@
}
protected void recordNullReference(LocalVariableBinding local,
- ASTNode expression, int checkType) {
+ ASTNode expression, int checkType, FlowInfo nullInfo) {
if (this.nullCount == 0) {
this.nullLocals = new LocalVariableBinding[5];
this.nullReferences = new ASTNode[5];
this.nullCheckTypes = new int[5];
+ this.nullInfos = new UnconditionalFlowInfo[5];
}
else if (this.nullCount == this.nullLocals.length) {
System.arraycopy(this.nullLocals, 0,
@@ -547,16 +563,19 @@
this.nullReferences = new ASTNode[this.nullCount * 2], 0, this.nullCount);
System.arraycopy(this.nullCheckTypes, 0,
this.nullCheckTypes = new int[this.nullCount * 2], 0, this.nullCount);
+ System.arraycopy(this.nullInfos, 0,
+ this.nullInfos = new UnconditionalFlowInfo[this.nullCount * 2], 0, this.nullCount);
}
this.nullLocals[this.nullCount] = local;
this.nullReferences[this.nullCount] = expression;
- this.nullCheckTypes[this.nullCount++] = checkType;
+ this.nullCheckTypes[this.nullCount] = checkType;
+ this.nullInfos[this.nullCount++] = nullInfo != null ? nullInfo.unconditionalCopy() : null;
}
public void recordUnboxing(Scope scope, Expression expression, int nullStatus, FlowInfo flowInfo) {
if (nullStatus == FlowInfo.NULL)
super.recordUnboxing(scope, expression, nullStatus, flowInfo);
else // defer checking:
- recordNullReference(null, expression, IN_UNBOXING);
+ recordNullReference(null, expression, IN_UNBOXING, flowInfo);
}
/** Record the fact that we see an early exit (in 'reference') while 'trackingVar' is in scope and may be unclosed. */
@@ -573,7 +592,7 @@
scope.problemReporter().potentiallyUnclosedCloseable(trackingVar, reference);
return true; // handled
}
- recordNullReference(trackingVar.binding, reference, EXIT_RESOURCE);
+ recordNullReference(trackingVar.binding, reference, EXIT_RESOURCE, flowInfo);
return true; // handled
}
@@ -612,20 +631,20 @@
}
} else if (this.upstreamNullFlowInfo.isDefinitelyNonNull(local) && !flowInfo.isPotentiallyNull(local) && !flowInfo.isPotentiallyUnknown(local)) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=291418
+ recordNullReference(local, reference, checkType, flowInfo);
flowInfo.markAsDefinitelyNonNull(local);
- recordNullReference(local, reference, checkType);
} else if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) {
return; // no reason to complain, since there is definitely some uncertainty making the comparison relevant.
} else {
// note: pot non-null & pot null is already captured by cannotBeDefinitelyNullOrNonNull()
if (flowInfo.isPotentiallyNonNull(local)) {
// knowing 'local' can be non-null, we're only interested in seeing whether it can *only* be non-null
- recordNullReference(local, reference, CAN_ONLY_NON_NULL | checkType & (CONTEXT_MASK|HIDE_NULL_COMPARISON_WARNING_MASK));
+ recordNullReference(local, reference, CAN_ONLY_NON_NULL | checkType & (CONTEXT_MASK|HIDE_NULL_COMPARISON_WARNING_MASK), flowInfo);
} else if (flowInfo.isPotentiallyNull(local)) {
// knowing 'local' can be null, we're only interested in seeing whether it can *only* be null
- recordNullReference(local, reference, CAN_ONLY_NULL | checkType & (CONTEXT_MASK|HIDE_NULL_COMPARISON_WARNING_MASK));
+ recordNullReference(local, reference, CAN_ONLY_NULL | checkType & (CONTEXT_MASK|HIDE_NULL_COMPARISON_WARNING_MASK), flowInfo);
} else {
- recordNullReference(local, reference, checkType);
+ recordNullReference(local, reference, checkType, flowInfo);
}
}
return;
@@ -684,7 +703,7 @@
break;
}
}
- recordNullReference(local, reference, checkType);
+ recordNullReference(local, reference, checkType, flowInfo);
return;
case MAY_NULL :
if (flowInfo.isDefinitelyNonNull(local)) {
@@ -698,7 +717,7 @@
scope.problemReporter().localVariablePotentialNullReference(local, location);
return;
}
- recordNullReference(local, location, checkType);
+ recordNullReference(local, location, checkType, flowInfo);
return;
default:
// never happens
@@ -731,20 +750,20 @@
is caught by an outer catch block. This is used to propagate data flow
along the edge back to the next iteration. See simulateThrowAfterLoopBack
*/
- public void recordCatchContextOfEscapingException(ExceptionHandlingFlowContext catchingContext, ReferenceBinding caughtException) {
+ public void recordCatchContextOfEscapingException(ExceptionHandlingFlowContext catchingContext, ReferenceBinding caughtException, FlowInfo exceptionInfo) {
if (this.escapingExceptionCatchSites == null) {
this.escapingExceptionCatchSites = new ArrayList(5);
}
- this.escapingExceptionCatchSites.add(new EscapingExceptionCatchSite(catchingContext, caughtException));
+ this.escapingExceptionCatchSites.add(new EscapingExceptionCatchSite(catchingContext, caughtException, exceptionInfo));
}
public boolean hasEscapingExceptions() {
return this.escapingExceptionCatchSites != null;
}
- protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, int nullStatus, TypeBinding expectedType, int checkType) {
+ protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, FlowInfo flowInfo, int nullStatus, TypeBinding expectedType, int checkType) {
recordProvidedExpectedTypes(providedType, expectedType, this.nullCount);
- recordNullReference(expression.localVariableBinding(), expression, checkType);
+ recordNullReference(expression.localVariableBinding(), expression, checkType, flowInfo);
return true;
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
index d06cef6..b98441c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
+ * Stephan Herrmann - Contributions for
* bug 325755 - [compiler] wrong initialization state after conditional expression
* bug 320170 - [compiler] [null] Whitebox issues in null analysis
* bug 292478 - Report potentially null across variable assignment
@@ -17,9 +17,14 @@
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 386181 - [compiler][null] wrong transition in UnconditionalFlowInfo.mergedWith()
* bug 394768 - [compiler][resource] Incorrect resource leak warning when creating stream in conditional
+ * Bug 453483 - [compiler][null][loop] Improve null analysis for loops
+ * Bug 454031 - [compiler][null][loop] bug in null analysis; wrong "dead code" detection
+ * Bug 421035 - [resource] False alarm of resource leak warning when casting a closeable in its assignment
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.flow;
+import java.util.Arrays;
+
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
@@ -80,12 +85,18 @@
1110 prot. null
1111 prot. non null
*/
+ public long
+ iNBit, // can an incoming null value reach the current point?
+ iNNBit; // can an incoming nonnull value reach the current point?
// extra segments
- public static final int extraLength = 6;
+ public static final int extraLength = 8;
public long extra[][];
// extra bit fields for larger numbers of fields/variables
// extra[0] holds definiteInits values, extra[1] potentialInits, etc.
+ // extra[1+1]... corresponds to nullBits1 ...
+ // extra[IN] is iNBit
+ // extra[INN] is iNNBit
// lifecycle is extra == null or else all extra[]'s are allocated
// arrays which have the same size
@@ -93,6 +104,8 @@
// Constants
public static final int BitCacheSize = 64; // 64 bits in a long.
+ public static final int IN = 6;
+ public static final int INN = 7;
/* fakeInitializedFlowInfo: For Lambda expressions tentative analysis during overload resolution.
We presume that any and all outer locals touched by the lambda are definitely assigned and
@@ -133,6 +146,8 @@
// combine null information
boolean thisHadNulls = (this.tagBits & NULL_FLAG_MASK) != 0,
otherHasNulls = (otherInits.tagBits & NULL_FLAG_MASK) != 0;
+// if ((otherInits.iNNBit | otherInits.iNBit) == 0)
+// thisHadNulls = false; // suppress incoming null info, if none shines through in other
long
a1, a2, a3, a4,
na1, na2, na3, na4,
@@ -144,6 +159,8 @@
this.nullBit2 = otherInits.nullBit2;
this.nullBit3 = otherInits.nullBit3;
this.nullBit4 = otherInits.nullBit4;
+ this.iNBit = otherInits.iNBit;
+ this.iNNBit = otherInits.iNNBit;
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 1) {
this.nullBit4 = ~0;
@@ -151,12 +168,33 @@
}
}
else {
+ a1 = this.nullBit1;
+ a2 = this.nullBit2;
+ a3 = this.nullBit3;
+ a4 = this.nullBit4;
+
+ // state that breaks the correlation between bits and n or nn, used below:
+ long protNN1111 = a1&a2&a3&a4;
+
+ // filter 'a' using iNBit,iNNBit from otherInits:
+ // this implements that otherInit does not accept certain bits which are known to be superseded by info in otherInits.
+ long acceptNonNull = otherInits.iNNBit;
+ long acceptNull = otherInits.iNBit
+ | protNN1111; // for 1111 don't bother suppressing incoming null, logic operation would produce wrong result
+ long dontResetToStart = ~protNN1111 | acceptNonNull; // for 1111 & ~acceptNonNull we reset all bits to 0000
+
+ a1 &= dontResetToStart;
+ a2 = dontResetToStart & acceptNull & a2;
+ a3 = dontResetToStart & acceptNonNull & a3;
+ a4 &= dontResetToStart;
+ a1 &= (a2 | a3 | a4); // translate 1000 (undefined state) to 0000
+
this.nullBit1 = (b1 = otherInits.nullBit1)
- | (a1 = this.nullBit1) & ((a3 = this.nullBit3)
- & (a4 = this.nullBit4) & (nb2 = ~(b2 = otherInits.nullBit2))
+ | a1 & (a3
+ & a4 & (nb2 = ~(b2 = otherInits.nullBit2))
& (nb4 = ~(b4 = otherInits.nullBit4))
| ((na4 = ~a4) | (na3 = ~a3))
- & ((na2 = ~(a2 = this.nullBit2)) & nb2
+ & ((na2 = ~a2) & nb2
| a2 & (nb3 = ~(b3 = otherInits.nullBit3)) & nb4));
this.nullBit2 = b2 & (nb4 | nb3)
| na3 & na4 & b2
@@ -179,6 +217,10 @@
| na1 & (b4 | (a4 | a2) & b2 & b3))
| (na1 & (na3 & nb3 | na2 & nb2)
| a1 & (nb2 & nb3 | a2 & a3)) & b4;
+
+ // unconditional sequence, must shine through both to shine through in the end:
+ this.iNBit &= otherInits.iNBit;
+ this.iNNBit &= otherInits.iNNBit;
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 2) {
this.nullBit4 = ~0;
@@ -243,6 +285,8 @@
for (int j = 2; j < extraLength; j++) {
this.extra[j] = new long[otherLength];
}
+ System.arraycopy(otherInits.extra[IN], 0, this.extra[IN], 0, otherLength);
+ System.arraycopy(otherInits.extra[INN], 0, this.extra[INN], 0, otherLength);
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 6) {
throw new AssertionFailedException("COVERAGE 6"); //$NON-NLS-1$
@@ -275,14 +319,34 @@
mergeLimit = 0;
}
for (i = 0; i < mergeLimit; i++) {
+ a1 = this.extra[1 + 1][i];
+ a2 = this.extra[2 + 1][i];
+ a3 = this.extra[3 + 1][i];
+ a4 = this.extra[4 + 1][i];
+ // state that breaks the correlation between bits and n or nn, used below:
+ long protNN1111 = a1&a2&a3&a4;
+
+ // filter 'a' using iNBit,iNNBit from otherInits:
+ // this implements that otherInit does not accept certain bits which are known to be superseded by info in otherInits.
+ long acceptNonNull = otherInits.extra[INN][i];
+ long acceptNull = otherInits.extra[IN][i]
+ | protNN1111; // for 1111 don't bother suppressing incoming null, logic operation would produce wrong result
+ long dontResetToStart = ~protNN1111 | acceptNonNull; // for 1111 & ~acceptNonNull we reset all bits to 0000
+
+ a1 &= dontResetToStart;
+ a2 = dontResetToStart & acceptNull & a2;
+ a3 = dontResetToStart & acceptNonNull & a3;
+ a4 &= dontResetToStart;
+ a1 &= (a2 | a3 | a4); // translate 1000 (undefined state) to 0000
+
this.extra[1 + 1][i] = (b1 = otherInits.extra[1 + 1][i])
- | (a1 = this.extra[1 + 1][i]) & ((a3 = this.extra[3 + 1][i])
- & (a4 = this.extra[4 + 1][i]) & (nb2 = ~(b2 = otherInits.extra[2 + 1][i]))
+ | a1 & (a3
+ & a4 & (nb2 = ~(b2 = otherInits.extra[2 + 1][i]))
& (nb4 = ~(b4 = otherInits.extra[4 + 1][i]))
| ((na4 = ~a4) | (na3 = ~a3))
- & ((na2 = ~(a2 = this.extra[2 + 1][i])) & nb2
+ & ((na2 = ~a2) & nb2
| a2 & (nb3 = ~(b3 = otherInits.extra[3 + 1][i])) & nb4));
- this.extra[2 + 1][i] = b2 & (nb4 | nb3)
+ this.extra[2 + 1][i] = b2 & (nb4 | nb3)
| na3 & na4 & b2
| a2 & (nb3 & nb4
| (nb1 = ~b1) & (na3 | (na1 = ~a1))
@@ -303,6 +367,11 @@
| na1 & (b4 | (a4 | a2) & b2 & b3))
| (na1 & (na3 & nb3 | na2 & nb2)
| a1 & (nb2 & nb3 | a2 & a3)) & b4;
+
+ // unconditional sequence, must shine through both to shine through in the end:
+ this.extra[IN][i] &= otherInits.extra[IN][i];
+ this.extra[INN][i] &= otherInits.extra[INN][i];
+
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 7) {
this.extra[5][i] = ~0;
@@ -362,10 +431,7 @@
else if (otherInits.extra != null) {
// no storage here, but other has extra storage.
int otherLength = otherInits.extra[0].length;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[otherLength];
- }
+ createExtraSpace(otherLength);
System.arraycopy(otherInits.extra[1], 0, this.extra[1], 0,
otherLength);
}
@@ -420,6 +486,7 @@
| nb2 & (na3 & b1 & nb3 | na2 & (nb1 & b4 | b1 & nb3 | a4))
| a3 & (a4 & (nb2 | b1 & b3)
| a1 & a2 & (nb1 & b4 | na4 & (b2 | b1) & nb3));
+ // this and then pot.other: leave iNBit & iNNBit untouched
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 9) {
this.nullBit4 = ~0;
@@ -435,6 +502,7 @@
(nb1 = ~(b1 = otherInits.nullBit1)));
this.nullBit3 = b3 & (nb1 | (nb2 = ~b2));
this.nullBit4 = ~b1 & ~b3 & (b4 = otherInits.nullBit4) | ~b2 & (b1 & ~b3 | ~b1 & b4);
+ // this and then pot.other: leave iNBit & iNNBit untouched
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 10) {
this.nullBit4 = ~0;
@@ -448,10 +516,7 @@
if (otherInits.extra != null) {
int mergeLimit = 0, copyLimit = otherInits.extra[0].length;
if (this.extra == null) {
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[copyLimit];
- }
+ createExtraSpace(copyLimit);
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 11) {
throw new AssertionFailedException("COVERAGE 11"); //$NON-NLS-1$
@@ -501,6 +566,7 @@
| nb2 & (na3 & b1 & nb3 | na2 & (nb1 & b4 | b1 & nb3 | a4))
| a3 & (a4 & (nb2 | b1 & b3)
| a1 & a2 & (nb1 & b4 | na4 & (b2 | b1) & nb3));
+ // this and then pot.other: leave iNBit & iNNBit untouched
if ((this.extra[2 + 1][i] | this.extra[3 + 1][i] | this.extra[4 + 1][i]) != 0) { // bit1 is redundant
thisHasNulls = true;
}
@@ -517,6 +583,7 @@
(nb1 = ~(b1 = otherInits.extra[1 + 1][i])));
this.extra[3 + 1][i] = b3 & (nb1 | (nb2 = ~b2));
this.extra[4 + 1][i] = ~b1 & ~b3 & (b4 = otherInits.extra[4 + 1][i]) | ~b2 & (b1 & ~b3 | ~b1 & b4);
+ // this and then pot.other: leave iNBit & iNNBit untouched
if ((this.extra[2 + 1][i] | this.extra[3 + 1][i] | this.extra[4 + 1][i]) != 0) { // bit1 is redundant
thisHasNulls = true;
}
@@ -636,6 +703,8 @@
copy.nullBit3 = this.nullBit3;
copy.nullBit4 = this.nullBit4;
}
+ copy.iNBit = this.iNBit;
+ copy.iNNBit = this.iNNBit;
copy.tagBits = this.tagBits;
copy.maxFieldCount = this.maxFieldCount;
if (this.extra != null) {
@@ -694,6 +763,8 @@
this.nullBit2 &= mask;
this.nullBit3 &= mask;
this.nullBit4 &= mask;
+ this.iNBit &= mask;
+ this.iNNBit &= mask;
}
// use extra vector
if (this.extra == null) {
@@ -1078,6 +1149,8 @@
}
this.nullBit1 |= mask;
this.nullBit3 |= mask;
+ // it was not null;
+ this.iNBit &= ~mask;
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 15) {
this.nullBit4 = ~0;
@@ -1089,10 +1162,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 16) {
throw new AssertionFailedException("COVERAGE 16"); //$NON-NLS-1$
@@ -1136,6 +1206,8 @@
}
this.extra[1 + 1][vectorIndex] |= mask;
this.extra[3 + 1][vectorIndex] |= mask;
+ // it was not null;
+ this.extra[IN][vectorIndex] &= ~mask;
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 18) {
this.extra[5][vectorIndex] = ~0;
@@ -1172,6 +1244,8 @@
}
this.nullBit1 |= mask;
this.nullBit2 |= mask;
+ // it was null;
+ this.iNNBit &= ~mask;
if (COVERAGE_TEST_FLAG) {
if (CoverageTestId == 19) {
this.nullBit4 = ~0;
@@ -1184,10 +1258,7 @@
mask = 1L << (position % BitCacheSize);
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length ];
- }
+ createExtraSpace(length);
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 20) {
throw new AssertionFailedException("COVERAGE 20"); //$NON-NLS-1$
@@ -1228,6 +1299,8 @@
}
this.extra[1 + 1][vectorIndex] |= mask;
this.extra[2 + 1][vectorIndex] |= mask;
+ // it was null;
+ this.extra[INN][vectorIndex] &= ~mask;
}
}
}
@@ -1250,10 +1323,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
}
else {
int oldLength; // might need to grow the arrays
@@ -1297,6 +1367,9 @@
// clear others
this.nullBit2 &= (mask = ~mask);
this.nullBit4 &= mask;
+ // old value no longer shining through
+ this.iNBit &= mask;
+ this.iNNBit &= mask;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 22) {
this.nullBit1 = 0;
@@ -1308,10 +1381,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
}
else {
int oldLength; // might need to grow the arrays
@@ -1328,6 +1398,9 @@
this.extra[4][vectorIndex] |= mask;
this.extra[3][vectorIndex] &= (mask = ~mask);
this.extra[5][vectorIndex] &= mask;
+ // old value no longer shining through
+ this.extra[IN][vectorIndex] &= mask;
+ this.extra[INN][vectorIndex] &= mask;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 23) {
this.extra[2][vectorIndex] = 0;
@@ -1351,6 +1424,9 @@
// clear others
this.nullBit3 &= (mask = ~mask);
this.nullBit4 &= mask;
+ // old value no longer shining through
+ this.iNBit &= mask;
+ this.iNNBit &= mask;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 24) {
this.nullBit4 = ~0;
@@ -1362,10 +1438,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
}
else {
int oldLength; // might need to grow the arrays
@@ -1382,6 +1455,9 @@
this.extra[3][vectorIndex] |= mask;
this.extra[4][vectorIndex] &= (mask = ~mask);
this.extra[5][vectorIndex] &= mask;
+ // old value no longer shining through
+ this.extra[IN][vectorIndex] &= mask;
+ this.extra[INN][vectorIndex] &= mask;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 25) {
this.extra[5][vectorIndex] = ~0;
@@ -1412,6 +1488,9 @@
// clear others
this.nullBit2 &= (mask = ~mask);
this.nullBit3 &= mask;
+ // old value no longer shining through
+ this.iNBit &= mask;
+ this.iNNBit &= mask;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 26) {
this.nullBit4 = 0;
@@ -1423,10 +1502,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
}
else {
int oldLength; // might need to grow the arrays
@@ -1443,6 +1519,9 @@
this.extra[5][vectorIndex] |= mask;
this.extra[3][vectorIndex] &= (mask = ~mask);
this.extra[4][vectorIndex] &= mask;
+ // old value no longer shining through
+ this.extra[IN][vectorIndex] &= mask;
+ this.extra[INN][vectorIndex] &= mask;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 27) {
this.extra[5][vectorIndex] = 0;
@@ -1463,6 +1542,8 @@
this.nullBit2 &= mask;
this.nullBit3 &= mask;
this.nullBit4 &= mask;
+ this.iNBit &= mask;
+ this.iNNBit &= mask;
} else {
// use extra vector
int vectorIndex = (position / BitCacheSize) - 1;
@@ -1476,6 +1557,8 @@
this.extra[3][vectorIndex] &= mask;
this.extra[4][vectorIndex] &= mask;
this.extra[5][vectorIndex] &= mask;
+ this.extra[IN][vectorIndex] &= mask;
+ this.extra[INN][vectorIndex] &= mask;
}
}
}
@@ -1505,10 +1588,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
}
else {
int oldLength; // might need to grow the arrays
@@ -1555,10 +1635,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
}
else {
int oldLength; // might need to grow the arrays
@@ -1605,10 +1682,7 @@
int vectorIndex = (position / BitCacheSize) - 1;
if (this.extra == null) {
int length = vectorIndex + 1;
- this.extra = new long[extraLength][];
- for (int j = 0; j < extraLength; j++) {
- this.extra[j] = new long[length];
- }
+ createExtraSpace(length);
}
else {
int oldLength; // might need to grow the arrays
@@ -1675,6 +1749,8 @@
this.nullBit2 = otherInits.nullBit2;
this.nullBit3 = otherInits.nullBit3;
this.nullBit4 = otherInits.nullBit4;
+ this.iNBit = otherInits.iNBit;
+ this.iNNBit = otherInits.iNNBit;
thisHadNulls = false;
thisHasNulls = otherHasNulls;
this.tagBits = otherInits.tagBits;
@@ -1719,11 +1795,15 @@
}
}
}
+ this.iNBit |= otherInits.iNBit;
+ this.iNNBit |= otherInits.iNNBit;
} else if (otherHasNulls) { // only other had nulls
this.nullBit1 = 0;
this.nullBit2 = (b2 = otherInits.nullBit2) & (nb3 = ~(b3 = otherInits.nullBit3) | (nb1 = ~(b1 = otherInits.nullBit1)));
this.nullBit3 = b3 & ((nb2 = ~b2) & (b4 = otherInits.nullBit4) | nb1) | b1 & nb2 & ~b4;
this.nullBit4 = (nb3 | nb2) & nb1 & b4 | b1 & nb3 & nb2;
+ this.iNBit |= otherInits.iNBit;
+ this.iNNBit |= otherInits.iNNBit;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 32) {
this.nullBit4 = ~0;
@@ -1788,6 +1868,8 @@
}
System.arraycopy(otherInits.extra[1], 0,
this.extra[1], 0, otherLength);
+ System.arraycopy(otherInits.extra[IN], 0, this.extra[IN], 0, otherLength);
+ System.arraycopy(otherInits.extra[INN], 0, this.extra[INN], 0, otherLength);
copyLimit = otherLength;
if (COVERAGE_TEST_FLAG) {
if(CoverageTestId == 36) {
@@ -1841,6 +1923,8 @@
| na2 & b3 & b4
| a2 & (nb1 & b4 | a3 & na4 & b1) & nb3)
|nb1 & b2 & b3 & b4;
+ this.extra[IN][i] |= otherInits.extra[IN][i];
+ this.extra[INN][i] |= otherInits.extra[INN][i];
thisHasNulls = thisHasNulls ||
this.extra[3][i] != 0 ||
this.extra[4][i] != 0 ||
@@ -1856,6 +1940,8 @@
this.extra[2 + 1][i] = (b2 = otherInits.extra[2 + 1][i]) & (nb3 = ~(b3 = otherInits.extra[3 + 1][i]) | (nb1 = ~(b1 = otherInits.extra[1 + 1][i])));
this.extra[3 + 1][i] = b3 & ((nb2 = ~b2) & (b4 = otherInits.extra[4 + 1][i]) | nb1) | b1 & nb2 & ~b4;
this.extra[4 + 1][i] = (nb3 | nb2) & nb1 & b4 | b1 & nb3 & nb2;
+ this.extra[IN][i] |= otherInits.extra[IN][i];
+ this.extra[INN][i] |= otherInits.extra[INN][i];
thisHasNulls = thisHasNulls ||
this.extra[3][i] != 0 ||
this.extra[4][i] != 0 ||
@@ -1912,7 +1998,11 @@
UnconditionalFlowInfo copy = new UnconditionalFlowInfo();
copy.definiteInits = this.definiteInits;
copy.potentialInits = this.potentialInits;
+ // no nullness known means: any previous nullness could shine through:
+ copy.iNBit = -1L;
+ copy.iNNBit = -1L;
copy.tagBits = this.tagBits & ~NULL_FLAG_MASK;
+ copy.tagBits |= UNROOTED;
copy.maxFieldCount = this.maxFieldCount;
if (this.extra != null) {
int length;
@@ -1925,6 +2015,9 @@
for (int j = 2; j < extraLength; j++) {
copy.extra[j] = new long[length];
}
+ // no nullness known means: any previous nullness could shine through:
+ Arrays.fill(copy.extra[IN], -1L);
+ Arrays.fill(copy.extra[INN], -1L);
}
return copy;
}
@@ -1970,6 +2063,7 @@
+ ", reachable:" + ((this.tagBits & UNREACHABLE) == 0) //$NON-NLS-1$
+", null: " + this.nullBit1 //$NON-NLS-1$
+ this.nullBit2 + this.nullBit3 + this.nullBit4
+ +", incoming: " + this.iNBit + this.iNNBit //$NON-NLS-1$
+">"; //$NON-NLS-1$
}
else {
@@ -1985,7 +2079,8 @@
def += "," + this.extra[0][i]; //$NON-NLS-1$
pot += "," + this.extra[1][i]; //$NON-NLS-1$
nullS += "," + this.extra[2][i] //$NON-NLS-1$
- + this.extra[3][i] + this.extra[4][i] + this.extra[5][i];
+ + this.extra[3][i] + this.extra[4][i] + this.extra[5][i]
+ +", incoming: " + this.extra[IN][i] + this.extra[INN]; //$NON-NLS-1$
}
if (ceil < this.extra[0].length) {
def += ",..."; //$NON-NLS-1$
@@ -2045,6 +2140,8 @@
copy.nullBit2 = this.nullBit2 & mask;
copy.nullBit3 = this.nullBit3 & mask;
copy.nullBit4 = this.nullBit4 & mask;
+ copy.iNBit = this.iNBit & mask;
+ copy.iNNBit = this.iNNBit & mask;
}
// use extra vector
if (this.extra == null) {
@@ -2066,9 +2163,7 @@
}
}
else if (vectorIndex >= 0) {
- for (int j = 0; j < extraLength; j++) {
- copy.extra[j] = new long[length];
- }
+ copy.createExtraSpace(length);
}
if (vectorIndex >= 0) {
mask = ~((1L << (limit % BitCacheSize))-1);
@@ -2112,5 +2207,16 @@
}
}
}
+
+private void createExtraSpace(int length) {
+ this.extra = new long[extraLength][];
+ for (int j = 0; j < extraLength; j++) {
+ this.extra[j] = new long[length];
+ }
+ if ((this.tagBits & UNROOTED) != 0) {
+ Arrays.fill(this.extra[IN], -1L);
+ Arrays.fill(this.extra[INN], -1L);
+ }
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index c86a3da..ae09e04 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@
* bug 388281 - [compiler][null] inheritance of null annotations as an option
* bug 381443 - [compiler][null] Allow parameter widening from @NonNull to unannotated
* bug 383368 - [compiler][null] syntactic null analysis for field references
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
* Jesper Steen Moller - Contributions for
* bug 404146 - [1.7][compiler] nested try-catch-finally-blocks leads to unrunnable Java byte code
* bug 407297 - [1.8][compiler] Control generation of parameter names by option
@@ -50,6 +51,7 @@
public static final String OPTION_SourceFileAttribute = "org.eclipse.jdt.core.compiler.debug.sourceFile"; //$NON-NLS-1$
public static final String OPTION_PreserveUnusedLocal = "org.eclipse.jdt.core.compiler.codegen.unusedLocal"; //$NON-NLS-1$
public static final String OPTION_MethodParametersAttribute = "org.eclipse.jdt.core.compiler.codegen.methodParameters"; //$NON-NLS-1$
+ public static final String OPTION_LambdaGenericSignature = "org.eclipse.jdt.core.compiler.codegen.lambda.genericSignature"; //$NON-NLS-1$
public static final String OPTION_DocCommentSupport= "org.eclipse.jdt.core.compiler.doc.comment.support"; //$NON-NLS-1$
public static final String OPTION_ReportMethodWithConstructorName = "org.eclipse.jdt.core.compiler.problem.methodWithConstructorName"; //$NON-NLS-1$
public static final String OPTION_ReportOverridingPackageDefaultMethod = "org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod"; //$NON-NLS-1$
@@ -59,6 +61,7 @@
public static final String OPTION_ReportHiddenCatchBlock = "org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock"; //$NON-NLS-1$
public static final String OPTION_ReportUnusedLocal = "org.eclipse.jdt.core.compiler.problem.unusedLocal"; //$NON-NLS-1$
public static final String OPTION_ReportUnusedParameter = "org.eclipse.jdt.core.compiler.problem.unusedParameter"; //$NON-NLS-1$
+ public static final String OPTION_ReportUnusedExceptionParameter = "org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter"; //$NON-NLS-1$
public static final String OPTION_ReportUnusedParameterWhenImplementingAbstract = "org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"; //$NON-NLS-1$
public static final String OPTION_ReportUnusedParameterWhenOverridingConcrete = "org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"; //$NON-NLS-1$
public static final String OPTION_ReportUnusedParameterIncludeDocCommentReference = "org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference"; //$NON-NLS-1$
@@ -146,7 +149,6 @@
// OPTION_Store_Annotations: undocumented option for testing purposes
public static final String OPTION_Store_Annotations = "org.eclipse.jdt.core.compiler.storeAnnotations"; //$NON-NLS-1$
public static final String OPTION_EmulateJavacBug8031744 = "org.eclipse.jdt.core.compiler.emulateJavacBug8031744"; //$NON-NLS-1$
- public static final String OPTION_PostResolutionRawTypeCompatibilityCheck = "org.eclipse.jdt.core.compiler.postResolutionRawTypeCompatibilityCheck"; //$NON-NLS-1$
public static final String OPTION_ReportRedundantSuperinterface = "org.eclipse.jdt.core.compiler.problem.redundantSuperinterface"; //$NON-NLS-1$
public static final String OPTION_ReportComparingIdentical = "org.eclipse.jdt.core.compiler.problem.comparingIdentical"; //$NON-NLS-1$
public static final String OPTION_ReportMissingSynchronizedOnInheritedMethod = "org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"; //$NON-NLS-1$
@@ -196,6 +198,7 @@
public static final String VERSION_1_6 = "1.6"; //$NON-NLS-1$
public static final String VERSION_1_7 = "1.7"; //$NON-NLS-1$
public static final String VERSION_1_8 = "1.8"; //$NON-NLS-1$
+ public static final String VERSION_1_9 = "1.9"; //$NON-NLS-1$
public static final String ERROR = "error"; //$NON-NLS-1$
public static final String WARNING = "warning"; //$NON-NLS-1$
public static final String IGNORE = "ignore"; //$NON-NLS-1$
@@ -294,10 +297,11 @@
public static final int MissingDefaultCase = IrritantSet.GROUP2 | ASTNode.Bit16;
public static final int UnusedTypeParameter = IrritantSet.GROUP2 | ASTNode.Bit17;
public static final int NonnullParameterAnnotationDropped = IrritantSet.GROUP2 | ASTNode.Bit18;
+ public static final int UnusedExceptionParameter = IrritantSet.GROUP2 | ASTNode.Bit19;
// AspectJ Extension
public static final String OPTION_ReportSwallowedExceptionInCatchBlock = "org.eclipse.jdt.core.compiler.problem.swallowedExceptionInCatchBlock"; //$NON-NLS-1$
- public static final int SwallowedExceptionInCatchBlock = IrritantSet.GROUP2 | ASTNode.Bit19;
+ public static final int SwallowedExceptionInCatchBlock = IrritantSet.GROUP2 | ASTNode.Bit20;
// when picking up a later version of this class, if new constants have been added to
// the above list, then AjCompilerOptions will need updating also.
// End AspectJ Extension
@@ -322,6 +326,8 @@
public int produceDebugAttributes;
/** Classfile method patameters information as per JEP 118... */
public boolean produceMethodParameters;
+ /** Indicates whether generic signature should be generated for lambda expressions */
+ public boolean generateGenericSignatureForLambdaExpressions;
/** Compliance level for the compiler, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} */
public long complianceLevel;
/** Original compliance level for the compiler, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4},
@@ -467,6 +473,9 @@
public boolean complainOnUninternedIdentityComparison;
public boolean emulateJavacBug8031744 = true;
+ /** Not directly configurable, derived from other options by LookupEnvironment.usesNullTypeAnnotations() */
+ public Boolean useNullTypeAnnotations = null;
+
// keep in sync with warningTokenToIrritant and warningTokenFromIrritant
public final static String[] warningTokens = {
"all", //$NON-NLS-1$
@@ -542,6 +551,8 @@
return OPTION_ReportUnusedLocal;
case UnusedArgument :
return OPTION_ReportUnusedParameter;
+ case UnusedExceptionParameter :
+ return OPTION_ReportUnusedExceptionParameter;
case NoImplicitStringConversion :
return OPTION_ReportNoImplicitStringConversion;
case AccessEmulation :
@@ -718,6 +729,10 @@
if (jdkLevel == ClassFileConstants.JDK1_8)
return VERSION_1_8;
break;
+ case ClassFileConstants.MAJOR_VERSION_1_9 :
+ if (jdkLevel == ClassFileConstants.JDK1_9)
+ return VERSION_1_9;
+ break;
}
return Util.EMPTY_STRING; // unknown version
}
@@ -744,6 +759,8 @@
return ClassFileConstants.JDK1_7;
case '8':
return ClassFileConstants.JDK1_8;
+ case '9':
+ return ClassFileConstants.JDK1_9;
default:
return 0; // unknown
}
@@ -844,6 +861,7 @@
OPTION_ReportUnusedLocal,
OPTION_ReportUnusedObjectAllocation,
OPTION_ReportUnusedParameter,
+ OPTION_ReportUnusedExceptionParameter,
OPTION_ReportUnusedParameterIncludeDocCommentReference,
OPTION_ReportUnusedParameterWhenImplementingAbstract,
OPTION_ReportUnusedParameterWhenOverridingConcrete,
@@ -917,6 +935,7 @@
case RedundantSuperinterface :
case UnusedLocalVariable :
case UnusedArgument :
+ case UnusedExceptionParameter :
case UnusedImport :
case UnusedPrivateMember :
case UnusedDeclaredThrownException :
@@ -1047,6 +1066,7 @@
optionsMap.put(OPTION_LineNumberAttribute, (this.produceDebugAttributes & ClassFileConstants.ATTR_LINES) != 0 ? GENERATE : DO_NOT_GENERATE);
optionsMap.put(OPTION_SourceFileAttribute, (this.produceDebugAttributes & ClassFileConstants.ATTR_SOURCE) != 0 ? GENERATE : DO_NOT_GENERATE);
optionsMap.put(OPTION_MethodParametersAttribute, this.produceMethodParameters ? GENERATE : DO_NOT_GENERATE);
+ optionsMap.put(OPTION_LambdaGenericSignature, this.generateGenericSignatureForLambdaExpressions ? GENERATE : DO_NOT_GENERATE);
optionsMap.put(OPTION_PreserveUnusedLocal, this.preserveAllLocalVariables ? PRESERVE : OPTIMIZE_OUT);
optionsMap.put(OPTION_DocCommentSupport, this.docCommentSupport ? ENABLED : DISABLED);
optionsMap.put(OPTION_ReportMethodWithConstructorName, getSeverityString(MethodWithConstructorName));
@@ -1057,6 +1077,7 @@
optionsMap.put(OPTION_ReportHiddenCatchBlock, getSeverityString(MaskedCatchBlock));
optionsMap.put(OPTION_ReportUnusedLocal, getSeverityString(UnusedLocalVariable));
optionsMap.put(OPTION_ReportUnusedParameter, getSeverityString(UnusedArgument));
+ optionsMap.put(OPTION_ReportUnusedExceptionParameter, getSeverityString(UnusedExceptionParameter));
optionsMap.put(OPTION_ReportUnusedImport, getSeverityString(UnusedImport));
optionsMap.put(OPTION_ReportSyntheticAccessEmulation, getSeverityString(AccessEmulation));
optionsMap.put(OPTION_ReportNoEffectAssignment, getSeverityString(NoEffectAssignment));
@@ -1144,7 +1165,6 @@
optionsMap.put(OPTION_Process_Annotations, this.processAnnotations ? ENABLED : DISABLED);
optionsMap.put(OPTION_Store_Annotations, this.storeAnnotations ? ENABLED : DISABLED);
optionsMap.put(OPTION_EmulateJavacBug8031744, this.emulateJavacBug8031744 ? ENABLED : DISABLED);
- optionsMap.put(OPTION_PostResolutionRawTypeCompatibilityCheck, this.postResolutionRawTypeCompatibilityCheck ? ENABLED : DISABLED);
optionsMap.put(OPTION_ReportRedundantSuperinterface, getSeverityString(RedundantSuperinterface));
optionsMap.put(OPTION_ReportComparingIdentical, getSeverityString(ComparingIdentical));
optionsMap.put(OPTION_ReportMissingSynchronizedOnInheritedMethod, getSeverityString(MissingSynchronizedModifierInInheritedMethod));
@@ -1543,6 +1563,13 @@
this.produceMethodParameters = false;
}
}
+ if ((optionValue = optionsMap.get(OPTION_LambdaGenericSignature)) != null) {
+ if (GENERATE.equals(optionValue)) {
+ this.generateGenericSignatureForLambdaExpressions = true;
+ } else if (DO_NOT_GENERATE.equals(optionValue)) {
+ this.generateGenericSignatureForLambdaExpressions = false;
+ }
+ }
if ((optionValue = optionsMap.get(OPTION_SuppressWarnings)) != null) {
if (ENABLED.equals(optionValue)) {
this.suppressWarnings = true;
@@ -1584,6 +1611,7 @@
if ((optionValue = optionsMap.get(OPTION_ReportHiddenCatchBlock)) != null) updateSeverity(MaskedCatchBlock, optionValue);
if ((optionValue = optionsMap.get(OPTION_ReportUnusedLocal)) != null) updateSeverity(UnusedLocalVariable, optionValue);
if ((optionValue = optionsMap.get(OPTION_ReportUnusedParameter)) != null) updateSeverity(UnusedArgument, optionValue);
+ if ((optionValue = optionsMap.get(OPTION_ReportUnusedExceptionParameter)) != null) updateSeverity(UnusedExceptionParameter, optionValue);
if ((optionValue = optionsMap.get(OPTION_ReportUnusedImport)) != null) updateSeverity(UnusedImport, optionValue);
if ((optionValue = optionsMap.get(OPTION_ReportUnusedPrivateMember)) != null) updateSeverity(UnusedPrivateMember, optionValue);
if ((optionValue = optionsMap.get(OPTION_ReportUnusedDeclaredThrownException)) != null) updateSeverity(UnusedDeclaredThrownException, optionValue);
@@ -1824,13 +1852,6 @@
this.emulateJavacBug8031744 = false;
}
}
- if ((optionValue = optionsMap.get(OPTION_PostResolutionRawTypeCompatibilityCheck)) != null) {
- if (ENABLED.equals(optionValue)) {
- this.postResolutionRawTypeCompatibilityCheck = true;
- } else if (DISABLED.equals(optionValue)) {
- this.postResolutionRawTypeCompatibilityCheck = false;
- }
- }
if ((optionValue = optionsMap.get(OPTION_ReportUninternedIdentityComparison)) != null) {
if (ENABLED.equals(optionValue)) {
this.complainOnUninternedIdentityComparison = true;
@@ -1845,6 +1866,7 @@
buf.append("\n\t- line number debug attributes: ").append((this.produceDebugAttributes & ClassFileConstants.ATTR_LINES) != 0 ? "ON" : " OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
buf.append("\n\t- source debug attributes: ").append((this.produceDebugAttributes & ClassFileConstants.ATTR_SOURCE) != 0 ? "ON" : " OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
buf.append("\n\t- MethodParameters attributes: ").append(this.produceMethodParameters ? GENERATE : DO_NOT_GENERATE); //$NON-NLS-1$
+ buf.append("\n\t- Generic signature for lambda expressions: ").append(this.generateGenericSignatureForLambdaExpressions ? GENERATE : DO_NOT_GENERATE); //$NON-NLS-1$
buf.append("\n\t- preserve all local variables: ").append(this.preserveAllLocalVariables ? "ON" : " OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
buf.append("\n\t- method with constructor name: ").append(getSeverityString(MethodWithConstructorName)); //$NON-NLS-1$
buf.append("\n\t- overridden package default method: ").append(getSeverityString(OverriddenPackageDefaultMethod)); //$NON-NLS-1$
@@ -1852,6 +1874,7 @@
buf.append("\n\t- masked catch block: ").append(getSeverityString(MaskedCatchBlock)); //$NON-NLS-1$
buf.append("\n\t- unused local variable: ").append(getSeverityString(UnusedLocalVariable)); //$NON-NLS-1$
buf.append("\n\t- unused parameter: ").append(getSeverityString(UnusedArgument)); //$NON-NLS-1$
+ buf.append("\n\t- unused exception parameter: ").append(getSeverityString(UnusedExceptionParameter)); //$NON-NLS-1$
buf.append("\n\t- unused import: ").append(getSeverityString(UnusedImport)); //$NON-NLS-1$
buf.append("\n\t- synthetic access emulation: ").append(getSeverityString(AccessEmulation)); //$NON-NLS-1$
buf.append("\n\t- assignment with no effect: ").append(getSeverityString(NoEffectAssignment)); //$NON-NLS-1$
@@ -1962,4 +1985,14 @@
this.warningThreshold.clear(irritant);
}
}
+
+ /**
+ * Note, if you have a LookupEnvironment you should instead ask
+ * {@link org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment#usesNullTypeAnnotations()}. */
+ public boolean usesNullTypeAnnotations() {
+ if (this.useNullTypeAnnotations != null)
+ return this.useNullTypeAnnotations;
+ return this.isAnnotationBasedNullAnalysisEnabled
+ && this.sourceLevel >= ClassFileConstants.JDK1_8;
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
index f4cc742..488b0ef 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@
* bug 265744 - Enum switch should warn about missing default
* bug 374605 - Unreasonable warning for enum-based switch statements
* bug 381443 - [compiler][null] Allow parameter widening from @NonNull to unannotated
+ * Bug 441208 - [1.8][null]SuppressWarnings("null") does not suppress / marked Unnecessary
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.impl;
@@ -131,12 +132,14 @@
.set(CompilerOptions.NullAnnotationInferenceConflict)
.set(CompilerOptions.NullUncheckedConversion)
.set(CompilerOptions.RedundantNullAnnotation)
- .set(CompilerOptions.NonnullParameterAnnotationDropped);
+ .set(CompilerOptions.NonnullParameterAnnotationDropped)
+ .set(CompilerOptions.MissingNonNullByDefaultAnnotation);
RESTRICTION.set(CompilerOptions.DiscouragedReference);
STATIC_ACCESS.set(CompilerOptions.NonStaticAccessToStatic);
UNUSED
.set(CompilerOptions.UnusedArgument)
+ .set(CompilerOptions.UnusedExceptionParameter)
.set(CompilerOptions.UnusedPrivateMember)
.set(CompilerOptions.UnusedDeclaredThrownException)
.set(CompilerOptions.UnusedLabel)
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java
index fe0e229..c96ff45 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/AnnotatableTypeSystem.java
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* Bug 432977 - [1.8][null] Incorrect 'type is not visible' compiler error
+ * Bug 446434 - [1.8][null] Enable interned captures also when analysing null type annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -27,7 +28,6 @@
public class AnnotatableTypeSystem extends TypeSystem {
- private LookupEnvironment environment;
private boolean isAnnotationBasedNullAnalysisEnabled;
public AnnotatableTypeSystem(LookupEnvironment environment) {
@@ -60,9 +60,20 @@
/* This method replaces the version that used to sit in LE. The parameter `annotations' is a flattened sequence of annotations,
where each dimension's annotations end with a sentinel null. Leaf type can be an already annotated type.
+
+ See ArrayBinding.swapUnresolved for further special case handling if incoming leafType is a URB that would resolve to a raw
+ type later.
*/
public ArrayBinding getArrayType(TypeBinding leafType, int dimensions, AnnotationBinding [] annotations) {
-
+ if (leafType instanceof ArrayBinding) { // substitution attempts can cause this, don't create array of arrays.
+ dimensions += leafType.dimensions();
+ AnnotationBinding[] leafAnnotations = leafType.getTypeAnnotations();
+ leafType = leafType.leafComponentType();
+ AnnotationBinding [] allAnnotations = new AnnotationBinding[leafAnnotations.length + annotations.length + 1];
+ System.arraycopy(annotations, 0, allAnnotations, 0, annotations.length);
+ System.arraycopy(leafAnnotations, 0, allAnnotations, annotations.length + 1 /* leave a null */, leafAnnotations.length);
+ annotations = allAnnotations;
+ }
ArrayBinding nakedType = null;
TypeBinding[] derivedTypes = getDerivedTypes(leafType);
for (int i = 0, length = derivedTypes.length; i < length; i++) {
@@ -101,31 +112,20 @@
if (genericType.hasTypeAnnotations()) // @NonNull (List<String>) and not (@NonNull List)<String>
throw new IllegalStateException();
-
- ParameterizedTypeBinding nakedType = null;
- TypeBinding[] derivedTypes = getDerivedTypes(genericType);
- for (int i = 0, length = derivedTypes.length; i < length; i++) {
- TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null)
- break;
- if (!derivedType.isParameterizedType() || derivedType.actualType() != genericType) //$IDENTITY-COMPARISON$
- continue;
- if (derivedType.enclosingType() != enclosingType || !Util.effectivelyEqual(derivedType.typeArguments(), typeArguments)) //$IDENTITY-COMPARISON$
- continue;
- if (Util.effectivelyEqual(annotations, derivedType.getTypeAnnotations()))
- return (ParameterizedTypeBinding) derivedType;
- if (!derivedType.hasTypeAnnotations())
- nakedType = (ParameterizedTypeBinding) derivedType;
- }
- if (nakedType == null)
- nakedType = super.getParameterizedType(genericType, typeArguments, enclosingType);
+
+ ParameterizedTypeBinding parameterizedType = this.parameterizedTypes.get(genericType, typeArguments, enclosingType, annotations);
+ if (parameterizedType != null)
+ return parameterizedType;
+
+ ParameterizedTypeBinding nakedType = super.getParameterizedType(genericType, typeArguments, enclosingType);
if (!haveTypeAnnotations(genericType, enclosingType, typeArguments, annotations))
return nakedType;
- TypeBinding parameterizedType = new ParameterizedTypeBinding(genericType, typeArguments, enclosingType, this.environment);
+ parameterizedType = new ParameterizedTypeBinding(genericType, typeArguments, enclosingType, this.environment);
parameterizedType.id = nakedType.id;
parameterizedType.setTypeAnnotations(annotations, this.isAnnotationBasedNullAnalysisEnabled);
+ this.parameterizedTypes.put(genericType, typeArguments, enclosingType, parameterizedType);
return (ParameterizedTypeBinding) cacheDerivedType(genericType, nakedType, parameterizedType);
}
@@ -229,7 +229,7 @@
case Binding.TYPE_PARAMETER:
case Binding.WILDCARD_TYPE:
case Binding.INTERSECTION_TYPE:
- case Binding.INTERSECTION_CAST_TYPE:
+ case Binding.INTERSECTION_TYPE18:
/* Taking the binding of QTR as an example, there could be different annotatable components, but we come in a with a single binding, e.g:
@T Z; type => Z annotations => [[@T]]
@T Y.@T Z type => Z annotations => [[@T][@T]]
@@ -281,6 +281,9 @@
Likewise so the bindings for @Readonly List<@NonNull String> != @Readonly List<@Nullable String> != @Readonly List<@Interned String>
*/
private TypeBinding getAnnotatedType(TypeBinding type, TypeBinding enclosingType, AnnotationBinding[] annotations) {
+ if (type.kind() == Binding.PARAMETERIZED_TYPE) {
+ return getParameterizedType(type.actualType(), type.typeArguments(), (ReferenceBinding) enclosingType, annotations);
+ }
TypeBinding nakedType = null;
TypeBinding[] derivedTypes = getDerivedTypes(type);
for (int i = 0, length = derivedTypes.length; i < length; i++) {
@@ -295,14 +298,11 @@
if (!derivedType.isArrayType() || derivedType.dimensions() != type.dimensions() || derivedType.leafComponentType() != type.leafComponentType()) //$IDENTITY-COMPARISON$
continue;
break;
- case Binding.PARAMETERIZED_TYPE:
- if (!derivedType.isParameterizedType() || derivedType.actualType() != type.actualType()) //$IDENTITY-COMPARISON$
- continue;
- break;
case Binding.RAW_TYPE:
if (!derivedType.isRawType() || derivedType.actualType() != type.actualType()) //$IDENTITY-COMPARISON$
continue;
break;
+ case Binding.INTERSECTION_TYPE:
case Binding.WILDCARD_TYPE:
if (!derivedType.isWildcard() || derivedType.actualType() != type.actualType() || derivedType.rank() != type.rank() || derivedType.boundKind() != type.boundKind()) //$IDENTITY-COMPARISON$
continue;
@@ -312,19 +312,15 @@
default:
switch(derivedType.kind()) {
case Binding.ARRAY_TYPE:
- case Binding.PARAMETERIZED_TYPE:
case Binding.RAW_TYPE:
case Binding.WILDCARD_TYPE:
- case Binding.INTERSECTION_CAST_TYPE:
+ case Binding.INTERSECTION_TYPE18:
case Binding.INTERSECTION_TYPE:
continue;
}
break;
}
if (Util.effectivelyEqual(derivedType.getTypeAnnotations(), annotations)) {
- // point-fix for https://bugs.eclipse.org/432977
- if (!type.isUnresolvedType() && derivedType.isUnresolvedType())
- return ((UnresolvedReferenceBinding)derivedType).resolve(this.environment, false);
return derivedType;
}
if (!derivedType.hasTypeAnnotations())
@@ -339,12 +335,15 @@
TypeBinding annotatedType = type.clone(enclosingType);
annotatedType.id = nakedType.id;
annotatedType.setTypeAnnotations(annotations, this.isAnnotationBasedNullAnalysisEnabled);
+ if (this.isAnnotationBasedNullAnalysisEnabled && (annotatedType.tagBits & TagBits.AnnotationNullMASK) == 0) {
+ // propagate nullness unless overridden in 'annotations':
+ annotatedType.tagBits |= type.tagBits & TagBits.AnnotationNullMASK;
+ }
TypeBinding keyType;
switch (type.kind()) {
case Binding.ARRAY_TYPE:
keyType = type.leafComponentType();
break;
- case Binding.PARAMETERIZED_TYPE:
case Binding.RAW_TYPE:
case Binding.WILDCARD_TYPE:
keyType = type.actualType();
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
index 871b3da..5534595 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
@@ -22,6 +22,7 @@
* Bug 428019 - [1.8][compiler] Type inference failure with nested generic invocation.
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 440759 - [1.8][null] @NonNullByDefault should never affect wildcards and uses of a type variable
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -443,7 +444,14 @@
/* Leaf component type is the key in the type system. If it undergoes change, the array has to be rehashed.
We achieve by creating a fresh array with the new component type and equating this array's id with that.
This means this array can still be found under the old key, but that is harmless (since the component type
- is always consulted (see TypeSystem.getArrayType())
+ is always consulted (see TypeSystem.getArrayType()).
+
+ This also means that this array type is not a fully interned singleton: There is `this' object and there is
+ the array that is being created down below that gets cached by the type system and doled out for all further
+ array creations against the same (raw) component type, dimensions and annotations. This again is harmless,
+ since TypeBinding.id is consulted for (in)equality checks.
+
+ See https://bugs.eclipse.org/bugs/show_bug.cgi?id=430425 for details and a test case.
*/
if (this.leafComponentType != resolvedType) //$IDENTITY-COMPARISON$
this.id = env.createArrayType(this.leafComponentType, this.dimensions, this.typeAnnotations).id;
@@ -453,17 +461,15 @@
public String toString() {
return this.leafComponentType != null ? debugName() : "NULL TYPE ARRAY"; //$NON-NLS-1$
}
-public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
- if (!hasTypeAnnotations())
+public TypeBinding unannotated() {
+ return this.hasTypeAnnotations() ? this.environment.getUnannotatedType(this) : this;
+}
+@Override
+public TypeBinding withoutToplevelNullAnnotation() {
+ if (!hasNullTypeAnnotations())
return this;
- if (removeOnlyNullAnnotations) {
- if (!hasNullTypeAnnotations())
- return this;
- AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
- if (newAnnotations.length > 0)
- return this.environment.createArrayType(this.leafComponentType.unannotated(false), this.dimensions, newAnnotations);
- }
- return this.environment.getUnannotatedType(this);
+ AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
+ return this.environment.createArrayType(this.leafComponentType, this.dimensions, newAnnotations);
}
@Override
public TypeBinding uncapture(Scope scope) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
index f6d4e60..fd551bf 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BaseTypeBinding.java
@@ -173,7 +173,7 @@
super.setTypeAnnotations(annotations, false); // never set nullTagBits on base types
}
- public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
+ public TypeBinding unannotated() {
if (!this.hasTypeAnnotations())
return this;
switch (this.id) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index 639bdd7..811e81a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,6 +29,11 @@
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
* Bug 434602 - Possible error with inferred null annotations leading to contradictory null annotations
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 453475 - [1.8][null] Contradictory null annotations (4.5 M3 edition)
+ * Bug 454182 - Internal compiler error when using 1.8 compliance for simple project
* Jesper Steen Moller - Contributions for
* Bug 412150 [1.8] [compiler] Enable reflected parameter names during annotation processing
* Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
@@ -40,11 +45,11 @@
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ExternalAnnotationProvider.IMethodAnnotationWalker;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.NonNullDefaultAwareTypeAnnotationWalker;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.*;
-import org.aspectj.org.eclipse.jdt.internal.compiler.impl.BooleanConstant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
@@ -93,12 +98,12 @@
if (binaryValue instanceof Constant)
return binaryValue;
if (binaryValue instanceof ClassSignature)
- return env.getTypeFromSignature(((ClassSignature) binaryValue).getTypeName(), 0, -1, false, null, missingTypeNames, TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
+ return env.getTypeFromSignature(((ClassSignature) binaryValue).getTypeName(), 0, -1, false, null, missingTypeNames, ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
if (binaryValue instanceof IBinaryAnnotation)
return createAnnotation((IBinaryAnnotation) binaryValue, env, missingTypeNames);
if (binaryValue instanceof EnumConstantSignature) {
EnumConstantSignature ref = (EnumConstantSignature) binaryValue;
- ReferenceBinding enumType = (ReferenceBinding) env.getTypeFromSignature(ref.getTypeName(), 0, -1, false, null, missingTypeNames, TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
+ ReferenceBinding enumType = (ReferenceBinding) env.getTypeFromSignature(ref.getTypeName(), 0, -1, false, null, missingTypeNames, ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
if (enumType.isUnresolvedType() && !resolveEnumConstants)
return new ElementValuePair.UnresolvedEnumConstant(enumType, env, ref.getEnumConstantName());
enumType = (ReferenceBinding) resolveType(enumType, env, false /* no raw conversion */);
@@ -405,9 +410,10 @@
*/
if (this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
// need annotations on the type before processing null annotations on members respecting any @NonNullByDefault:
- scanTypeForNullDefaultAnnotation(binaryType, this.fPackage, this);
+ scanTypeForNullDefaultAnnotation(binaryType, this.fPackage);
}
- TypeAnnotationWalker walker = getTypeAnnotationWalker(binaryType.getTypeAnnotations());
+ ITypeAnnotationWalker walker = getTypeAnnotationWalker(binaryType.getTypeAnnotations());
+ ITypeAnnotationWalker toplevelWalker = binaryType.enrichWithExternalAnnotationsFor(walker, null, this.environment);
char[] typeSignature = binaryType.getGenericSignature(); // use generic signature even in 1.4
this.tagBits |= binaryType.getTagBits();
@@ -419,7 +425,7 @@
if (wrapper.signature[wrapper.start] == Util.C_GENERIC_START) {
// ParameterPart = '<' ParameterSignature(s) '>'
wrapper.start++; // skip '<'
- this.typeVariables = createTypeVariables(wrapper, true, missingTypeNames, walker, true/*class*/);
+ this.typeVariables = createTypeVariables(wrapper, true, missingTypeNames, toplevelWalker, true/*class*/);
wrapper.start++; // skip '>'
this.tagBits |= TagBits.HasUnresolvedTypeVariables;
this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
@@ -438,7 +444,7 @@
char[] superclassName = binaryType.getSuperclassName();
if (superclassName != null) {
// attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
- this.superclass = this.environment.getTypeFromConstantPoolName(superclassName, 0, -1, false, missingTypeNames, walker.toSupertype((short) -1));
+ this.superclass = this.environment.getTypeFromConstantPoolName(superclassName, 0, -1, false, missingTypeNames, toplevelWalker.toSupertype((short) -1, superclassName));
this.tagBits |= TagBits.HasUnresolvedSuperclass;
}
@@ -450,14 +456,14 @@
this.superInterfaces = new ReferenceBinding[size];
for (short i = 0; i < size; i++)
// attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested)
- this.superInterfaces[i] = this.environment.getTypeFromConstantPoolName(interfaceNames[i], 0, -1, false, missingTypeNames, walker.toSupertype(i));
+ this.superInterfaces[i] = this.environment.getTypeFromConstantPoolName(interfaceNames[i], 0, -1, false, missingTypeNames, toplevelWalker.toSupertype(i, superclassName));
this.tagBits |= TagBits.HasUnresolvedSuperinterfaces;
}
}
} else {
// attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
this.superclass = (ReferenceBinding) this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames,
- walker.toSupertype((short) -1));
+ toplevelWalker.toSupertype((short) -1, wrapper.peekFullType()));
this.tagBits |= TagBits.HasUnresolvedSuperclass;
this.superInterfaces = Binding.NO_SUPERINTERFACES;
@@ -466,7 +472,7 @@
java.util.ArrayList types = new java.util.ArrayList(2);
short rank = 0;
do {
- types.add(this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames, walker.toSupertype(rank++)));
+ types.add(this.environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames, toplevelWalker.toSupertype(rank++, wrapper.peekFullType())));
} while (!wrapper.atEnd());
this.superInterfaces = new ReferenceBinding[types.size()];
types.toArray(this.superInterfaces);
@@ -476,8 +482,8 @@
if (needFieldsAndMethods) {
IBinaryField[] iFields = binaryType.getFields();
- createFields(iFields, sourceLevel, missingTypeNames);
- IBinaryMethod[] iMethods = createMethods(binaryType.getMethods(), sourceLevel, missingTypeNames);
+ createFields(iFields, binaryType, sourceLevel, missingTypeNames);
+ IBinaryMethod[] iMethods = createMethods(binaryType.getMethods(), binaryType, sourceLevel, missingTypeNames);
boolean isViewedAsDeprecated = isViewedAsDeprecated();
if (isViewedAsDeprecated) {
for (int i = 0, max = this.fields.length; i < max; i++) {
@@ -495,15 +501,25 @@
}
if (this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
if (iFields != null) {
- for (int i = 0; i < iFields.length; i++)
- scanFieldForNullAnnotation(iFields[i], this.fields[i], this.isEnum());
+ for (int i = 0; i < iFields.length; i++) {
+ // below 1.8 we still might use an annotation walker to discover external annotations:
+ ITypeAnnotationWalker fieldWalker = ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ if (sourceLevel < ClassFileConstants.JDK1_8)
+ fieldWalker = binaryType.enrichWithExternalAnnotationsFor(walker, iFields[i], this.environment);
+ scanFieldForNullAnnotation(iFields[i], this.fields[i], this.isEnum(), fieldWalker);
+ }
}
if (iMethods != null) {
- for (int i = 0; i < iMethods.length; i++)
- scanMethodForNullAnnotation(iMethods[i], this.methods[i]);
+ for (int i = 0; i < iMethods.length; i++) {
+ // below 1.8 we still might use an annotation walker to discover external annotations:
+ ITypeAnnotationWalker methodWalker = ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ if (sourceLevel < ClassFileConstants.JDK1_8)
+ methodWalker = binaryType.enrichWithExternalAnnotationsFor(methodWalker, iMethods[i], this.environment);
+ scanMethodForNullAnnotation(iMethods[i], this.methods[i], methodWalker);
}
}
}
+ }
if (this.environment.globalOptions.storeAnnotations)
setAnnotations(createAnnotations(binaryType.getAnnotations(), this.environment, missingTypeNames));
if (this.isAnnotationType())
@@ -517,7 +533,7 @@
}
}
-private TypeAnnotationWalker getTypeAnnotationWalker(IBinaryTypeAnnotation[] annotations) {
+private ITypeAnnotationWalker getTypeAnnotationWalker(IBinaryTypeAnnotation[] annotations) {
if (!isPrototype()) throw new IllegalStateException();
if (annotations == null || annotations.length == 0 || !this.environment.usesAnnotatedTypeSystem()) {
if (this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
@@ -525,7 +541,7 @@
if (nullness > Binding.NULL_UNSPECIFIED_BY_DEFAULT)
return new NonNullDefaultAwareTypeAnnotationWalker(nullness, this.environment);
}
- return TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
+ return ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER;
}
if (this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
int nullness = getNullDefault();
@@ -535,7 +551,8 @@
return new TypeAnnotationWalker(annotations);
}
-private void createFields(IBinaryField[] iFields, long sourceLevel, char[][][] missingTypeNames) {
+
+private void createFields(IBinaryField[] iFields, IBinaryType binaryType, long sourceLevel, char[][][] missingTypeNames) {
if (!isPrototype()) throw new IllegalStateException();
this.fields = Binding.NO_FIELDS;
if (iFields != null) {
@@ -548,7 +565,11 @@
for (int i = 0; i < size; i++) {
IBinaryField binaryField = iFields[i];
char[] fieldSignature = use15specifics ? binaryField.getGenericSignature() : null;
- TypeAnnotationWalker walker = getTypeAnnotationWalker(binaryField.getTypeAnnotations()).toField();
+ ITypeAnnotationWalker walker = getTypeAnnotationWalker(binaryField.getTypeAnnotations());
+ if (sourceLevel >= ClassFileConstants.JDK1_8) { // below 1.8, external annotations will be attached later
+ walker = binaryType.enrichWithExternalAnnotationsFor(walker, iFields[i], this.environment);
+ }
+ walker = walker.toField();
TypeBinding type = fieldSignature == null
? this.environment.getTypeFromSignature(binaryField.getTypeName(), 0, -1, false, this, missingTypeNames, walker)
: this.environment.getTypeFromTypeSignature(new SignatureWrapper(fieldSignature), Binding.NO_TYPE_VARIABLES, this, missingTypeNames, walker);
@@ -590,7 +611,7 @@
//End AspectJ Extension
-private MethodBinding createMethod(IBinaryMethod method, long sourceLevel, char[][][] missingTypeNames) {
+private MethodBinding createMethod(IBinaryMethod method, IBinaryType binaryType, long sourceLevel, char[][][] missingTypeNames) {
if (!isPrototype()) throw new IllegalStateException();
int methodModifiers = method.getModifiers() | ExtraCompilerModifiers.AccUnresolved;
if (sourceLevel < ClassFileConstants.JDK1_5)
@@ -616,10 +637,13 @@
variables properly in order to be able to apply substitutions and thus be able to detect
overriding in the presence of generics. Seeing the erased form is not good enough.
*/
- TypeAnnotationWalker walker = getTypeAnnotationWalker(method.getTypeAnnotations());
+ ITypeAnnotationWalker walker = getTypeAnnotationWalker(method.getTypeAnnotations());
char[] methodSignature = method.getGenericSignature(); // always use generic signature, even in 1.4
if (methodSignature == null) { // no generics
char[] methodDescriptor = method.getMethodDescriptor(); // of the form (I[Ljava/jang/String;)V
+ if (sourceLevel >= ClassFileConstants.JDK1_8) { // below 1.8, external annotations will be attached later
+ walker = binaryType.enrichWithExternalAnnotationsFor(walker, method, this.environment);
+ }
int numOfParams = 0;
char nextChar;
int index = 0; // first character is always '(' so skip it
@@ -693,6 +717,9 @@
}
} else {
+ if (sourceLevel >= ClassFileConstants.JDK1_8) { // below 1.8, external annotations will be attached later
+ walker = binaryType.enrichWithExternalAnnotationsFor(walker, method, this.environment);
+ }
methodModifiers |= ExtraCompilerModifiers.AccGenericSignature;
// MethodTypeSignature = ParameterPart(optional) '(' TypeSignatures ')' return_typeSignature ['^' TypeSignature (optional)]
SignatureWrapper wrapper = new SignatureWrapper(methodSignature, use15specifics);
@@ -801,7 +828,7 @@
? new MethodBinding(methodModifiers, parameters, exceptions, this)
: new MethodBinding(methodModifiers, method.getSelector(), returnType, parameters, exceptions, this);
- IBinaryAnnotation[] receiverAnnotations = walker.toReceiver().getAnnotationsAtCursor(0);
+ IBinaryAnnotation[] receiverAnnotations = walker.toReceiver().getAnnotationsAtCursor(this.id);
if (receiverAnnotations != null && receiverAnnotations.length > 0) {
result.receiver = this.environment.createAnnotatedType(this, createAnnotations(receiverAnnotations, this.environment, missingTypeNames));
}
@@ -810,7 +837,7 @@
IBinaryAnnotation[] annotations = method.getAnnotations();
if (annotations == null || annotations.length == 0)
if (method.isConstructor())
- annotations = walker.toMethodReturn().getAnnotationsAtCursor(0); // FIXME: When both exist, order could become an issue.
+ annotations = walker.toMethodReturn().getAnnotationsAtCursor(this.id); // FIXME: When both exist, order could become an issue.
result.setAnnotations(
createAnnotations(annotations, this.environment, missingTypeNames),
paramAnnotations,
@@ -835,7 +862,7 @@
* As some iMethods may be ignored in this process we return the matching array of those
* iMethods for which MethodBindings have been created; indices match those in this.methods.
*/
-private IBinaryMethod[] createMethods(IBinaryMethod[] iMethods, long sourceLevel, char[][][] missingTypeNames) {
+private IBinaryMethod[] createMethods(IBinaryMethod[] iMethods, IBinaryType binaryType, long sourceLevel, char[][][] missingTypeNames) {
if (!isPrototype()) throw new IllegalStateException();
int total = 0, initialTotal = 0, iClinit = -1;
int[] toSkip = null;
@@ -870,7 +897,7 @@
this.methods = new MethodBinding[total];
if (total == initialTotal) {
for (int i = 0; i < initialTotal; i++) {
- MethodBinding method = createMethod(iMethods[i], sourceLevel, missingTypeNames);
+ MethodBinding method = createMethod(iMethods[i], binaryType, sourceLevel, missingTypeNames);
if (hasRestrictedAccess)
method.modifiers |= ExtraCompilerModifiers.AccRestrictedAccess;
this.methods[i] = method;
@@ -880,7 +907,7 @@
IBinaryMethod[] mappedBinaryMethods = new IBinaryMethod[total];
for (int i = 0, index = 0; i < initialTotal; i++) {
if (iClinit != i && (toSkip == null || toSkip[i] != -1)) {
- MethodBinding method = createMethod(iMethods[i], sourceLevel, missingTypeNames);
+ MethodBinding method = createMethod(iMethods[i], binaryType, sourceLevel, missingTypeNames);
if (hasRestrictedAccess)
method.modifiers |= ExtraCompilerModifiers.AccRestrictedAccess;
mappedBinaryMethods[index] = iMethods[i];
@@ -892,7 +919,7 @@
}
private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, boolean assignVariables, char[][][] missingTypeNames,
- TypeAnnotationWalker walker, boolean isClassTypeParameter)
+ ITypeAnnotationWalker walker, boolean isClassTypeParameter)
{
if (!isPrototype()) throw new IllegalStateException();
// detect all type variables first
@@ -1009,7 +1036,7 @@
while ((nextChar = methodDescriptor[++end]) != Util.C_NAME_END){/*empty*/}
// not interested in type annotations, type will be used for comparison only, and erasure() is used if needed
- TypeBinding param = this.environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames, TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
+ TypeBinding param = this.environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames, ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
if (param instanceof UnresolvedReferenceBinding) {
param = resolveType(param, this.environment, true /* raw conversion */);
}
@@ -1279,7 +1306,7 @@
}
return (this.typeBits & bit) != 0;
}
-private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBinding[] existingVariables, SignatureWrapper wrapper, char[][][] missingTypeNames, TypeAnnotationWalker walker) {
+private void initializeTypeVariable(TypeVariableBinding variable, TypeVariableBinding[] existingVariables, SignatureWrapper wrapper, char[][][] missingTypeNames, ITypeAnnotationWalker walker) {
if (!isPrototype()) throw new IllegalStateException();
// ParameterSignature = Identifier ':' TypeSignature
// or Identifier ':' TypeSignature(optional) InterfaceBound(s)
@@ -1290,6 +1317,7 @@
short rank = 0;
if (wrapper.signature[wrapper.start] == Util.C_COLON) {
type = this.environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null);
+ rank++;
} else {
TypeBinding typeFromTypeSignature = this.environment.getTypeFromTypeSignature(wrapper, existingVariables, this, missingTypeNames, walker.toTypeBound(rank++));
if (typeFromTypeSignature instanceof ReferenceBinding) {
@@ -1528,7 +1556,7 @@
// End AspectJ Extension
//pre: null annotation analysis is enabled
-private void scanFieldForNullAnnotation(IBinaryField field, FieldBinding fieldBinding, boolean isEnum) {
+private void scanFieldForNullAnnotation(IBinaryField field, FieldBinding fieldBinding, boolean isEnum, ITypeAnnotationWalker externalAnnotationWalker) {
if (!isPrototype()) throw new IllegalStateException();
if (isEnum && (field.getModifiers() & ClassFileConstants.AccEnum) != 0) {
@@ -1557,7 +1585,9 @@
return; // null annotations are only applied to reference types
boolean explicitNullness = false;
- IBinaryAnnotation[] annotations = field.getAnnotations();
+ IBinaryAnnotation[] annotations = externalAnnotationWalker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER
+ ? externalAnnotationWalker.getAnnotationsAtCursor(fieldBinding.type.id)
+ : field.getAnnotations();
if (annotations != null) {
for (int i = 0; i < annotations.length; i++) {
char[] annotationTypeName = annotations[i].getTypeName();
@@ -1581,12 +1611,8 @@
}
}
-private void scanMethodForNullAnnotation(IBinaryMethod method, MethodBinding methodBinding) {
+private void scanMethodForNullAnnotation(IBinaryMethod method, MethodBinding methodBinding, ITypeAnnotationWalker externalAnnotationWalker) {
if (!isPrototype()) throw new IllegalStateException();
- if (!this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled)
- return;
- boolean useTypeAnnotations = this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK1_8;
- // in 1.8 we only need @NonNullByDefault, see below and exit further down.
char[][] nullableAnnotationName = this.environment.getNullableAnnotationName();
char[][] nonNullAnnotationName = this.environment.getNonNullAnnotationName();
char[][] nonNullByDefaultAnnotationName = this.environment.getNonNullByDefaultAnnotationName();
@@ -1594,8 +1620,10 @@
return; // not well-configured to use null annotations
// return:
- IBinaryAnnotation[] annotations = method.getAnnotations();
- boolean explicitNullness = false;
+ ITypeAnnotationWalker returnWalker = externalAnnotationWalker.toMethodReturn();
+ IBinaryAnnotation[] annotations = returnWalker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER
+ ? returnWalker.getAnnotationsAtCursor(methodBinding.returnType.id)
+ : method.getAnnotations();
if (annotations != null) {
for (int i = 0; i < annotations.length; i++) {
char[] annotationTypeName = annotations[i].getTypeName();
@@ -1603,34 +1631,33 @@
continue;
char[][] typeName = CharOperation.splitOn('/', annotationTypeName, 1, annotationTypeName.length-1); // cut of leading 'L' and trailing ';'
if (CharOperation.equals(typeName, nonNullByDefaultAnnotationName)) {
- methodBinding.tagBits |= TagBits.AnnotationNonNullByDefault;
- if (useTypeAnnotations)
methodBinding.defaultNullness = getNonNullByDefaultValue(annotations[i]);
- }
- if (!useTypeAnnotations && !explicitNullness) {
- if (CharOperation.equals(typeName, nonNullAnnotationName)) {
+ if (methodBinding.defaultNullness == Binding.NULL_UNSPECIFIED_BY_DEFAULT)
+ methodBinding.tagBits |= TagBits.AnnotationNullUnspecifiedByDefault;
+ else if (methodBinding.defaultNullness != 0)
+ methodBinding.tagBits |= TagBits.AnnotationNonNullByDefault;
+ } else if (CharOperation.equals(typeName, nonNullAnnotationName)) {
methodBinding.tagBits |= TagBits.AnnotationNonNull;
- explicitNullness = true;
} else if (CharOperation.equals(typeName, nullableAnnotationName)) {
methodBinding.tagBits |= TagBits.AnnotationNullable;
- explicitNullness = true;
- }
}
}
}
- if (useTypeAnnotations)
- return;
-
// parameters:
TypeBinding[] parameters = methodBinding.parameters;
int numVisibleParams = parameters.length;
- int numParamAnnotations = method.getAnnotatedParametersCount();
+ int numParamAnnotations = externalAnnotationWalker instanceof IMethodAnnotationWalker
+ ? ((IMethodAnnotationWalker) externalAnnotationWalker).getParameterCount()
+ : method.getAnnotatedParametersCount();
if (numParamAnnotations > 0) {
for (int j = 0; j < numVisibleParams; j++) {
if (numParamAnnotations > 0) {
int startIndex = numParamAnnotations - numVisibleParams;
- IBinaryAnnotation[] paramAnnotations = method.getParameterAnnotations(j+startIndex);
+ ITypeAnnotationWalker parameterWalker = externalAnnotationWalker.toMethodParameter((short) (j+startIndex));
+ IBinaryAnnotation[] paramAnnotations = parameterWalker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER
+ ? parameterWalker.getAnnotationsAtCursor(parameters[j].id)
+ : method.getParameterAnnotations(j+startIndex);
if (paramAnnotations != null) {
for (int i = 0; i < paramAnnotations.length; i++) {
char[] annotationTypeName = paramAnnotations[i].getTypeName();
@@ -1655,15 +1682,17 @@
}
}
// pre: null annotation analysis is enabled
-private void scanTypeForNullDefaultAnnotation(IBinaryType binaryType, PackageBinding packageBinding, BinaryTypeBinding binaryBinding) {
+private void scanTypeForNullDefaultAnnotation(IBinaryType binaryType, PackageBinding packageBinding) {
if (!isPrototype()) throw new IllegalStateException();
char[][] nonNullByDefaultAnnotationName = this.environment.getNonNullByDefaultAnnotationName();
if (nonNullByDefaultAnnotationName == null)
return; // not well-configured to use null annotations
+ if (CharOperation.equals(CharOperation.splitOn('/', binaryType.getName()), nonNullByDefaultAnnotationName))
+ return; // don't recursively apply @NNBD on @NNBD, neither directly nor via the 'enclosing' package-info.java
+
IBinaryAnnotation[] annotations = binaryType.getAnnotations();
- boolean isPackageInfo = CharOperation.equals(binaryBinding.sourceName(), TypeConstants.PACKAGE_INFO_NAME);
- boolean useTypeAnnotations = this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean isPackageInfo = CharOperation.equals(sourceName(), TypeConstants.PACKAGE_INFO_NAME);
if (annotations != null) {
long annotationBit = 0L;
int nullness = NO_NULL_DEFAULT;
@@ -1674,20 +1703,6 @@
continue;
char[][] typeName = CharOperation.splitOn('/', annotationTypeName, 1, annotationTypeName.length-1); // cut of leading 'L' and trailing ';'
if (CharOperation.equals(typeName, nonNullByDefaultAnnotationName)) {
- IBinaryElementValuePair[] elementValuePairs = annotations[i].getElementValuePairs();
- if (!useTypeAnnotations) {
- if (elementValuePairs != null && elementValuePairs.length == 1) {
- Object value = elementValuePairs[0].getValue();
- if (value instanceof BooleanConstant
- && !((BooleanConstant)value).booleanValue())
- {
- // parameter is 'false': this means we cancel defaults from outer scopes:
- annotationBit = TagBits.AnnotationNullUnspecifiedByDefault;
- nullness = NULL_UNSPECIFIED_BY_DEFAULT;
- break;
- }
- }
- } else {
// using NonNullByDefault we need to inspect the details of the value() attribute:
nullness = getNonNullByDefaultValue(annotations[i]);
if (nullness == NULL_UNSPECIFIED_BY_DEFAULT) {
@@ -1698,13 +1713,9 @@
this.defaultNullness = nullness;
break;
}
- annotationBit = TagBits.AnnotationNonNullByDefault;
- nullness = NONNULL_BY_DEFAULT;
- break;
- }
}
if (annotationBit != 0L) {
- binaryBinding.tagBits |= annotationBit;
+ this.tagBits |= annotationBit;
if (isPackageInfo)
packageBinding.defaultNullness = nullness;
return;
@@ -1712,48 +1723,44 @@
}
if (isPackageInfo) {
// no default annotations found in package-info
- packageBinding.defaultNullness = Binding.NULL_UNSPECIFIED_BY_DEFAULT;
+ packageBinding.defaultNullness = Binding.NO_NULL_DEFAULT;
return;
}
- ReferenceBinding enclosingTypeBinding = binaryBinding.enclosingType;
+ ReferenceBinding enclosingTypeBinding = this.enclosingType;
if (enclosingTypeBinding != null) {
- if (useTypeAnnotations) {
- binaryBinding.defaultNullness = enclosingTypeBinding.getNullDefault();
- if (binaryBinding.defaultNullness != 0) {
+ if (setNullDefault(enclosingTypeBinding.tagBits, enclosingTypeBinding.getNullDefault()))
return;
}
- } else {
- if ((enclosingTypeBinding.tagBits & TagBits.AnnotationNonNullByDefault) != 0) {
- binaryBinding.tagBits |= TagBits.AnnotationNonNullByDefault;
- return;
- } else if ((enclosingTypeBinding.tagBits & TagBits.AnnotationNullUnspecifiedByDefault) != 0) {
- binaryBinding.tagBits |= TagBits.AnnotationNullUnspecifiedByDefault;
- return;
- }
- }
- }
// no annotation found on the type or its enclosing types
// check the package-info for default annotation if not already done before
if (packageBinding.defaultNullness == Binding.NO_NULL_DEFAULT && !isPackageInfo) {
// this will scan the annotations in package-info
ReferenceBinding packageInfo = packageBinding.getType(TypeConstants.PACKAGE_INFO_NAME);
if (packageInfo == null) {
- packageBinding.defaultNullness = Binding.NULL_UNSPECIFIED_BY_DEFAULT;
+ packageBinding.defaultNullness = Binding.NO_NULL_DEFAULT;
}
}
// no @NonNullByDefault at type level, check containing package:
- if (useTypeAnnotations) {
- binaryBinding.defaultNullness = packageBinding.defaultNullness;
- } else {
- switch (packageBinding.defaultNullness) {
- case Binding.NONNULL_BY_DEFAULT :
- binaryBinding.tagBits |= TagBits.AnnotationNonNullByDefault;
- break;
- case Binding.NULL_UNSPECIFIED_BY_DEFAULT :
- binaryBinding.tagBits |= TagBits.AnnotationNullUnspecifiedByDefault;
- break;
+ setNullDefault(0L, packageBinding.defaultNullness);
}
+
+boolean setNullDefault(long oldNullTagBits, int newNullDefault) {
+ this.defaultNullness = newNullDefault;
+ if (newNullDefault != 0) {
+ if (newNullDefault == Binding.NULL_UNSPECIFIED_BY_DEFAULT)
+ this.tagBits |= TagBits.AnnotationNullUnspecifiedByDefault;
+ else
+ this.tagBits |= TagBits.AnnotationNonNullByDefault;
+ return true;
}
+ if ((oldNullTagBits & TagBits.AnnotationNonNullByDefault) != 0) {
+ this.tagBits |= TagBits.AnnotationNonNullByDefault;
+ return true;
+ } else if ((oldNullTagBits & TagBits.AnnotationNullUnspecifiedByDefault) != 0) {
+ this.tagBits |= TagBits.AnnotationNullUnspecifiedByDefault;
+ return true;
+}
+ return false;
}
/** given an application of @NonNullByDefault convert the annotation argument (if any) into a bitvector a la {@link Binding#NullnessDefaultMASK} */
@@ -1771,19 +1778,19 @@
MethodBinding[] annotationMethods = annotationType.methods();
if (annotationMethods != null && annotationMethods.length == 1) {
Object value = annotationMethods[0].getDefaultValue();
- return Annotation.nullTagBitsFromAnnotationValue(value);
+ return Annotation.nullLocationBitsFromAnnotationValue(value);
}
+ return NONNULL_BY_DEFAULT; // custom unconfigurable NNBD
} else if (elementValuePairs.length > 0) {
// evaluate the contained EnumConstantSignatures:
int nullness = 0;
for (int i = 0; i < elementValuePairs.length; i++)
- nullness |= Annotation.nullTagBitsFromAnnotationValue(elementValuePairs[i].getValue());
+ nullness |= Annotation.nullLocationBitsFromAnnotationValue(elementValuePairs[i].getValue());
return nullness;
} else {
// empty argument: cancel all defaults from enclosing scopes
return NULL_UNSPECIFIED_BY_DEFAULT;
}
- return 0;
}
@Override
@@ -1803,7 +1810,7 @@
if (elementValuePairs != null && elementValuePairs.length == 1) {
Object value = elementValuePairs[0].getValue();
if (value instanceof ClassSignature) {
- this.containerAnnotationType = (ReferenceBinding) this.environment.getTypeFromSignature(((ClassSignature)value).getTypeName(), 0, -1, false, null, missingTypeNames, TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
+ this.containerAnnotationType = (ReferenceBinding) this.environment.getTypeFromSignature(((ClassSignature)value).getTypeName(), 0, -1, false, null, missingTypeNames, ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
}
}
break;
@@ -1865,6 +1872,13 @@
this.environment.mayTolerateMissingType = true; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=360164
try {
this.superInterfaces[i].superclass();
+ if (this.superInterfaces[i].isParameterizedType()) {
+ ReferenceBinding superType = this.superInterfaces[i].actualType();
+ if (TypeBinding.equalsEquals(superType, this)) {
+ this.tagBits |= TagBits.HierarchyHasProblems;
+ continue;
+ }
+ }
this.superInterfaces[i].superInterfaces();
} finally {
this.environment.mayTolerateMissingType = wasToleratingMissingTypeProcessingAnnotations;
@@ -1981,14 +1995,15 @@
return buffer.toString();
}
-public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
- if (removeOnlyNullAnnotations) {
+public TypeBinding unannotated() {
+ return this.prototype;
+}
+public TypeBinding withoutToplevelNullAnnotation() {
if (!hasNullTypeAnnotations())
return this;
AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
if (newAnnotations.length > 0)
return this.environment.createAnnotatedType(this.prototype, newAnnotations);
- }
return this.prototype;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.java
index 15d173d..494f241 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Binding.java
@@ -38,7 +38,7 @@
public static final int INTERSECTION_TYPE = TYPE | ASTNode.Bit14;
// jsr 308
public static final int TYPE_USE = TYPE | ASTNode.Bit15;
- public static final int INTERSECTION_CAST_TYPE = TYPE | ASTNode.Bit16;
+ public static final int INTERSECTION_TYPE18 = TYPE | ASTNode.Bit16;
public static final int POLY_TYPE = TYPE | ASTNode.Bit17;
// In the unlikely event you add a new type binding, remember to update TypeBindingVisitor and Scope.substitute methods.
@@ -112,14 +112,14 @@
public abstract int kind();
/*
* Computes a key that uniquely identifies this binding.
- * Returns null if binding is not a TypeBinding, a MethodBinding, a FieldBinding or a PackageBinding.
+ * Returns null if binding is not a TypeBinding, a MethodBinding, a FieldBinding, a LocalVariableBinding or a PackageBinding (i.e. an ImportBinding).
*/
public char[] computeUniqueKey() {
return computeUniqueKey(true/*leaf*/);
}
/*
* Computes a key that uniquely identifies this binding. Optionally include access flags.
- * Returns null if binding is not a TypeBinding, a MethodBinding, a FieldBinding or a PackageBinding.
+ * Returns null if binding is not a TypeBinding, a MethodBinding, a FieldBinding, a LocalVariableBinding or a PackageBinding (i.e. an ImportBinding)
*/
public char[] computeUniqueKey(boolean isLeaf) {
return null;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
index 2f75455..e7af04b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,10 @@
* bug 394768 - [compiler][resource] Incorrect resource leak warning when creating stream in conditional
* bug 404649 - [1.8][compiler] detect illegal reference to indirect or redundant super
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
+ * Bug 371614 - [compiler][resource] Wrong "resource leak" problem on return/throw inside while loop
+ * Bug 421035 - [resource] False alarm of resource leak warning when casting a closeable in its assignment
+ * Bug 444964 - [1.7+][resource] False resource leak warning (try-with-resources for ByteArrayOutputStream - return inside for loop)
+ * Bug 396575 - [compiler][resources] Incorrect Errors/Warnings check for potential resource leak when surrounding with try-catch
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* bug 378674 - "The method can be declared as static" is wrong
* Keigo Imai - Contribution for bug 388903 - Cannot extend inner class as an anonymous class when it extends the outer class
@@ -25,9 +29,8 @@
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.*;
@@ -674,7 +677,7 @@
while (currentIndex < length) {
ReferenceBinding typeBinding = (ReferenceBinding) binding;
char[] nextName = compoundName[currentIndex++];
- TypeBinding receiverType = typeBinding.capture(this, invocationSite.sourceEnd());
+ TypeBinding receiverType = typeBinding.capture(this, invocationSite.sourceStart(), invocationSite.sourceEnd());
if ((binding = findField(receiverType, nextName, invocationSite, true /*resolve*/)) != null) {
if (!binding.isValidBinding()) {
return new ProblemFieldBinding(
@@ -717,7 +720,7 @@
CharOperation.concatWith(CharOperation.subarray(compoundName, 0, currentIndex), '.'),
ProblemReasons.NotFound);
}
- TypeBinding receiverType = typeBinding.capture(this, invocationSite.sourceEnd());
+ TypeBinding receiverType = typeBinding.capture(this, invocationSite.sourceStart(), invocationSite.sourceEnd());
variableBinding = findField(receiverType, compoundName[currentIndex++], invocationSite, true /*resolve*/);
if (variableBinding == null) {
return new ProblemFieldBinding(
@@ -946,12 +949,10 @@
boolean isStatic = binding.isStatic();
ReferenceBinding fieldDeclaringClass = binding.declaringClass;
// loop in enclosing context, until reaching the field declaring context
- MethodScope methodScope = methodScope();
+ MethodScope methodScope = namedMethodScope();
while (methodScope != null) {
if (methodScope.isStatic != isStatic)
return false;
- if (methodScope.isLambdaScope())
- return false;
if (!methodScope.isInsideInitializer() // inside initializer
&& !((AbstractMethodDeclaration) methodScope.referenceContext).isInitializationMethod()) { // inside constructor or clinit
return false; // found some non-initializer context
@@ -963,7 +964,7 @@
if (!enclosingType.erasure().isAnonymousType()) {
return false; // only check inside anonymous type
}
- methodScope = methodScope.enclosingMethodScope();
+ methodScope = methodScope.enclosingMethodScope().namedMethodScope();
}
return false;
}
@@ -1053,7 +1054,7 @@
/** When are no longer interested in this tracking variable - remove it. */
public void removeTrackingVar(FakedTrackingVariable trackingVariable) {
if (trackingVariable.innerTracker != null) {
- removeTrackingVar(trackingVariable.innerTracker);
+ trackingVariable.innerTracker.withdraw();
trackingVariable.innerTracker = null;
}
if (this.trackingVariables != null)
@@ -1083,10 +1084,10 @@
FakedTrackingVariable returnVar = (location instanceof ReturnStatement) ?
FakedTrackingVariable.getCloseTrackingVariable(((ReturnStatement)location).expression, flowInfo, flowContext) : null;
- Set varSet = new HashSet(this.trackingVariables);
- FakedTrackingVariable trackingVar;
- // pick one outer-most variable from the set at a time
- while ((trackingVar = FakedTrackingVariable.pickVarForReporting(varSet, this, location != null)) != null) {
+ // iterate variables according to the priorities defined in FakedTrackingVariable.IteratorForReporting.Stage
+ Iterator<FakedTrackingVariable> iterator = new FakedTrackingVariable.IteratorForReporting(this.trackingVariables, this, location != null);
+ while (iterator.hasNext()) {
+ FakedTrackingVariable trackingVar = iterator.next();
if (returnVar != null && trackingVar.isResourceBeingReturned(returnVar)) {
continue;
@@ -1111,7 +1112,7 @@
if (location == null) // at end of block and not definitely unclosed
{
// problems at specific locations: medium priority
- if (trackingVar.reportRecordedErrors(this, status)) // ... report previously recorded errors
+ if (trackingVar.reportRecordedErrors(this, status, flowInfo.reachMode() != FlowInfo.REACHABLE)) // ... report previously recorded errors
continue;
}
if (status == FlowInfo.POTENTIALLY_NULL) {
@@ -1128,12 +1129,6 @@
for (int i=0; i<this.localIndex; i++)
this.locals[i].closeTracker = null;
this.trackingVariables = null;
- } else {
- int size = this.trackingVariables.size();
- for (int i=0; i<size; i++) {
- FakedTrackingVariable tracker = (FakedTrackingVariable) this.trackingVariables.get(i);
- tracker.resetReportingBits();
- }
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
index b0b014f..259a07f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/BoundSet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2015 GK Software AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,20 +46,17 @@
// empty, the sets are lazily initialized
}
/** Add a type bound to the appropriate set. */
- public void addBound(TypeBound bound) {
+ public boolean addBound(TypeBound bound) {
switch (bound.relation) {
case ReductionResult.SUPERTYPE:
if (this.superBounds == null) this.superBounds = new HashSet<TypeBound>();
- this.superBounds.add(bound);
- break;
+ return this.superBounds.add(bound);
case ReductionResult.SAME:
if (this.sameBounds == null) this.sameBounds = new HashSet<TypeBound>();
- this.sameBounds.add(bound);
- break;
+ return this.sameBounds.add(bound);
case ReductionResult.SUBTYPE:
if (this.subBounds == null) this.subBounds = new HashSet<TypeBound>();
- this.subBounds.add(bound);
- break;
+ return this.subBounds.add(bound);
default:
throw new IllegalArgumentException("Unexpected bound relation in : " + bound); //$NON-NLS-1$
}
@@ -107,7 +104,7 @@
}
}
if (i == 0)
- return Binding.NO_TYPES;
+ return simpleUpper != null ? new TypeBinding[] { simpleUpper } : Binding.NO_TYPES;
if (i == 1 && simpleUpper != null)
return new TypeBinding[] { simpleUpper }; // no nullHints since not a reference type
if (i < rights.length)
@@ -238,7 +235,7 @@
if (nullHints == TagBits.AnnotationNullMASK) {
// on contradiction remove null type annotations
for (int i = 0; i < boundTypes.length; i++)
- boundTypes[i] = boundTypes[i].unannotated(true);
+ boundTypes[i] = boundTypes[i].withoutToplevelNullAnnotation();
} else {
AnnotationBinding[] annot = environment.nullAnnotationsFromTagBits(nullHints);
if (annot != null) {
@@ -268,7 +265,7 @@
nullHints |= it.next().nullHints;
}
if (nullHints == TagBits.AnnotationNullMASK) // on contradiction remove null type annotations
- return type.unannotated(true);
+ return type.withoutToplevelNullAnnotation();
AnnotationBinding[] annot = environment.nullAnnotationsFromTagBits(nullHints);
if (annot != null)
// only get here if exactly one of @NonNull or @Nullable was hinted; now apply this hint:
@@ -277,18 +274,20 @@
}
public void setInstantiation(TypeBinding type, InferenceVariable variable, LookupEnvironment environment) {
if (environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
- long oldBits = ((this.instantiation != null) ? this.instantiation.tagBits : variable.tagBits)
- & TagBits.AnnotationNullMASK;
- long requestedBits = type.tagBits & TagBits.AnnotationNullMASK;
- long newBits = (oldBits == TagBits.AnnotationNonNull) ? oldBits : requestedBits; // need to preserve @NonNull
- if (this.instantiation != null && oldBits == newBits) {
- return; // no update needed
+ long variableBits = variable.tagBits & TagBits.AnnotationNullMASK;
+ long allBits = type.tagBits | variableBits;
+ if (this.instantiation != null)
+ allBits |= this.instantiation.tagBits;
+ allBits &= TagBits.AnnotationNullMASK;
+ if (allBits == TagBits.AnnotationNullMASK) { // contradiction
+ allBits = variableBits;
}
- if (requestedBits != newBits) {
- // adjust 'type' to fit the newBits
- AnnotationBinding[] annot = environment.nullAnnotationsFromTagBits(newBits);
+ if (allBits != (type.tagBits & TagBits.AnnotationNullMASK)) {
+ AnnotationBinding[] annot = environment.nullAnnotationsFromTagBits(allBits);
if (annot != null)
- type = environment.createAnnotatedType(type.unannotated(true), annot);
+ type = environment.createAnnotatedType(type.withoutToplevelNullAnnotation(), annot);
+ else if (type.hasNullTypeAnnotations())
+ type = type.withoutToplevelNullAnnotation();
}
}
this.instantiation = type;
@@ -305,9 +304,11 @@
/** 18.1.3 bullet 5: throws α */
Set<InferenceVariable> inThrows = new HashSet<InferenceVariable>();
- // avoid attempts to incorporate the same pair of type bounds more than once:
- Set<TypeBound> incorporatedBounds = new HashSet<TypeBound>();
-
+ private TypeBound [] incorporatedBounds = new TypeBound[0];
+ private TypeBound [] unincorporatedBounds = new TypeBound [1024];
+ private int unincorporatedBoundsCount = 0;
+ private TypeBound [] mostRecentBounds = new TypeBound[4]; // for quick & dirty duplicate elimination.
+
public BoundSet() {}
// pre: typeParameters != null, variables[i].typeParameter == typeParameters[i]
@@ -316,7 +317,7 @@
for (int i = 0; i < length; i++) {
TypeVariableBinding typeParameter = typeParameters[i];
InferenceVariable variable = variables[i];
- TypeBound[] someBounds = typeParameter.getTypeBounds(variable, new InferenceSubstitution(context.environment, context.inferenceVariables));
+ TypeBound[] someBounds = typeParameter.getTypeBounds(variable, new InferenceSubstitution(context));
boolean hasProperBound = false;
if (someBounds.length > 0)
hasProperBound = addBounds(someBounds, context.environment);
@@ -353,30 +354,65 @@
}
copy.inThrows.addAll(this.inThrows);
copy.captures.putAll(this.captures);
+ System.arraycopy(this.incorporatedBounds, 0, copy.incorporatedBounds = new TypeBound[this.incorporatedBounds.length], 0, this.incorporatedBounds.length);
+ System.arraycopy(this.unincorporatedBounds, 0, copy.unincorporatedBounds = new TypeBound[this.unincorporatedBounds.length], 0, this.unincorporatedBounds.length);
+ copy.unincorporatedBoundsCount = this.unincorporatedBoundsCount;
return copy;
}
public void addBound(TypeBound bound, LookupEnvironment environment) {
+
+ if (bound.relation == ReductionResult.SUBTYPE && bound.right.id == TypeIds.T_JavaLangObject)
+ return;
+ if (bound.left == bound.right) //$IDENTITY-COMPARISON$
+ return;
+ for (int recent = 0; recent < 4; recent++) {
+ if (bound.equals(this.mostRecentBounds[recent])) {
+ if (environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
+ TypeBound existing = this.mostRecentBounds[recent];
+ long boundNullBits = bound.right.tagBits & TagBits.AnnotationNullMASK;
+ long existingNullBits = existing.right.tagBits & TagBits.AnnotationNullMASK;
+ if (boundNullBits != existingNullBits) {
+ if (existingNullBits == 0)
+ existing.right = bound.right;
+ else if (boundNullBits != 0) // combine bits from both sources, even if this creates a contradiction
+ existing.right = environment.createAnnotatedType(existing.right, environment.nullAnnotationsFromTagBits(boundNullBits));
+ }
+ }
+ return;
+ }
+ }
+
+ this.mostRecentBounds[3] = this.mostRecentBounds[2];
+ this.mostRecentBounds[2] = this.mostRecentBounds[1];
+ this.mostRecentBounds[1] = this.mostRecentBounds[0];
+ this.mostRecentBounds[0] = bound;
+
InferenceVariable variable = bound.left.prototype();
ThreeSets three = this.boundsPerVariable.get(variable);
if (three == null)
this.boundsPerVariable.put(variable, (three = new ThreeSets()));
- three.addBound(bound);
- // check if this makes the inference variable instantiated:
- TypeBinding typeBinding = bound.right;
- if (bound.relation == ReductionResult.SAME && typeBinding.isProperType(true))
- three.setInstantiation(typeBinding, variable, environment);
- if (bound.right instanceof InferenceVariable) {
- // for a dependency between two IVs make a note about the inverse bound.
- // this should be needed to determine IV dependencies independent of direction.
- // TODO: so far no test could be identified which actually needs it ...
- InferenceVariable rightIV = (InferenceVariable) bound.right.prototype();
- three = this.boundsPerVariable.get(rightIV);
- if (three == null)
- this.boundsPerVariable.put(rightIV, (three = new ThreeSets()));
- if (three.inverseBounds == null)
- three.inverseBounds = new HashMap<InferenceVariable,TypeBound>();
- three.inverseBounds.put(rightIV, bound);
+ if (three.addBound(bound)) {
+ int unincorporatedBoundsLength = this.unincorporatedBounds.length;
+ if (this.unincorporatedBoundsCount >= unincorporatedBoundsLength)
+ System.arraycopy(this.unincorporatedBounds, 0, this.unincorporatedBounds = new TypeBound[unincorporatedBoundsLength * 2], 0, unincorporatedBoundsLength);
+ this.unincorporatedBounds[this.unincorporatedBoundsCount ++] = bound;
+ // check if this makes the inference variable instantiated:
+ TypeBinding typeBinding = bound.right;
+ if (bound.relation == ReductionResult.SAME && typeBinding.isProperType(true))
+ three.setInstantiation(typeBinding, variable, environment);
+ if (bound.right instanceof InferenceVariable) {
+ // for a dependency between two IVs make a note about the inverse bound.
+ // this should be needed to determine IV dependencies independent of direction.
+ // TODO: so far no test could be identified which actually needs it ...
+ InferenceVariable rightIV = (InferenceVariable) bound.right.prototype();
+ three = this.boundsPerVariable.get(rightIV);
+ if (three == null)
+ this.boundsPerVariable.put(rightIV, (three = new ThreeSets()));
+ if (three.inverseBounds == null)
+ three.inverseBounds = new HashMap<InferenceVariable,TypeBound>();
+ three.inverseBounds.put(rightIV, bound);
+ }
}
}
@@ -388,7 +424,13 @@
}
return hasProperBound;
}
-
+
+ public void addBounds(BoundSet that, LookupEnvironment environment) {
+ if (that == null || environment == null)
+ return;
+ addBounds(that.flatten(), environment);
+ }
+
public boolean isInstantiated(InferenceVariable inferenceVariable) {
ThreeSets three = this.boundsPerVariable.get(inferenceVariable.prototype());
if (three != null)
@@ -416,7 +458,37 @@
}
return num;
}
+
+ // Driver for the real workhorse - Implements generational incorporation a la generational garbage collector.
+ boolean incorporate(InferenceContext18 context) throws InferenceFailureException {
+
+ if (this.unincorporatedBoundsCount == 0 && this.captures.size() == 0)
+ return true;
+
+ do {
+ TypeBound [] freshBounds;
+ System.arraycopy(this.unincorporatedBounds, 0, freshBounds = new TypeBound[this.unincorporatedBoundsCount], 0, this.unincorporatedBoundsCount);
+ this.unincorporatedBoundsCount = 0;
+
+ // Pairwise bidirectional compare all bounds from previous generation with the fresh set.
+ if (!incorporate(context, this.incorporatedBounds, freshBounds))
+ return false;
+ // Pairwise bidirectional compare all fresh bounds.
+ if (!incorporate(context, freshBounds, freshBounds))
+ return false;
+ // Merge the bounds into one incorporated generation.
+ final int incorporatedLength = this.incorporatedBounds.length;
+ final int unincorporatedLength = freshBounds.length;
+ TypeBound [] aggregate = new TypeBound[incorporatedLength + unincorporatedLength];
+ System.arraycopy(this.incorporatedBounds, 0, aggregate, 0, incorporatedLength);
+ System.arraycopy(freshBounds, 0, aggregate, incorporatedLength, unincorporatedLength);
+ this.incorporatedBounds = aggregate;
+
+ } while (this.unincorporatedBoundsCount > 0);
+
+ return true;
+ }
/**
* <b>JLS 18.3:</b> Try to infer new constraints from pairs of existing type bounds.
* Each new constraint is first reduced and checked for TRUE or FALSE, which will
@@ -425,24 +497,25 @@
* @return false if any constraint resolved to false, true otherwise
* @throws InferenceFailureException a compile error has been detected during inference
*/
- boolean incorporate(InferenceContext18 context) throws InferenceFailureException {
- boolean hasUpdate;
- do {
- hasUpdate = false;
- // using a flattened copy also allows us to insert more bounds during the process
- // without disturbing the current round of incorporation:
- TypeBound[] bounds = flatten();
- int boundsCount = bounds.length;
- if (boundsCount < 2)
- return true;
- // check each pair:
- for (int i = 0; i < boundsCount; i++) {
- TypeBound boundI = bounds[i];
- for (int j = i+1; j < boundsCount; j++) {
- TypeBound boundJ = bounds[j];
- if (this.incorporatedBounds.contains(boundI) && this.incorporatedBounds.contains(boundJ))
- continue;
+ boolean incorporate(InferenceContext18 context, TypeBound [] first, TypeBound [] next) throws InferenceFailureException {
+ boolean analyzeNull = context.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled;
+ ConstraintTypeFormula [] mostRecentFormulas = new ConstraintTypeFormula[4]; // poor man's cache to toss out duplicates, in pathological cases there are a good quarter million of them.
+ // check each pair, in each way.
+ for (int i = 0, iLength = first.length; i < iLength; i++) {
+ TypeBound boundI = first[i];
+ for (int j = 0, jLength = next.length; j < jLength; j++) {
+ TypeBound boundJ = next[j];
+ if (boundI == boundJ)
+ continue;
+ int iteration = 1;
+ do {
ConstraintTypeFormula newConstraint = null;
+ boolean deriveTypeArgumentConstraints = false;
+ if (iteration == 2) {
+ TypeBound boundX = boundI;
+ boundI = boundJ;
+ boundJ = boundX;
+ }
switch (boundI.relation) {
case ReductionResult.SAME:
switch (boundJ.relation) {
@@ -465,6 +538,7 @@
break;
case ReductionResult.SUBTYPE:
newConstraint = combineEqualSupers(boundI, boundJ);
+ deriveTypeArgumentConstraints = TypeBinding.equalsEquals(boundI.left, boundJ.left);
break;
}
break;
@@ -482,123 +556,144 @@
}
}
if (newConstraint != null) {
- if (!reduceOneConstraint(context, newConstraint))
- return false;
- // TODO here and below: better checking if constraint really added to the boundset (optimization)?
- hasUpdate = true;
- // not per JLS: if the new constraint relates types where at least one has a null annotations,
- // record all null tagBits as hints for the final inference solution.
- long nullHints = (newConstraint.left.tagBits | newConstraint.right.tagBits) & TagBits.AnnotationNullMASK;
- boundI.nullHints |= nullHints;
- boundJ.nullHints |= nullHints;
- }
- ConstraintFormula[] typeArgumentConstraints = deriveTypeArgumentConstraints(boundI, boundJ);
- if (typeArgumentConstraints != null) {
- for (int k = 0; k < typeArgumentConstraints.length; k++) {
- if (!reduceOneConstraint(context, typeArgumentConstraints[k]))
- return false;
- hasUpdate = true;
+ if (newConstraint.left == newConstraint.right) { //$IDENTITY-COMPARISON$
+ newConstraint = null;
+ } else if (newConstraint.equalsEquals(mostRecentFormulas[0]) || newConstraint.equalsEquals(mostRecentFormulas[1]) ||
+ newConstraint.equalsEquals(mostRecentFormulas[2]) || newConstraint.equalsEquals(mostRecentFormulas[3])) {
+ newConstraint = null;
}
}
- }
- this.incorporatedBounds.add(boundI);
- }
- /* TODO: are we sure this will always terminate? Cf. e.g. (Discussion in 18.3):
- *
- * "The assertion that incorporation reaches a fixed point oversimplifies the matter slightly. ..."
- */
- Iterator<Entry<ParameterizedTypeBinding, ParameterizedTypeBinding>> captIter = this.captures.entrySet().iterator();
- while (captIter.hasNext()) {
- hasUpdate = true;
- Entry<ParameterizedTypeBinding, ParameterizedTypeBinding> capt = captIter.next();
- ParameterizedTypeBinding gAlpha = capt.getKey();
- ParameterizedTypeBinding gA = capt.getValue();
- ReferenceBinding g = (ReferenceBinding) gA.original();
- final TypeVariableBinding[] parameters = g.typeVariables();
- // construct theta = [P1:=alpha1,...]
- final InferenceVariable[] alphas = new InferenceVariable[gAlpha.arguments.length];
- System.arraycopy(gAlpha.arguments, 0, alphas, 0, alphas.length);
- InferenceSubstitution theta = new InferenceSubstitution(context.environment, alphas) {
- @Override
- protected TypeBinding getP(int i) {
- return parameters[i];
+ if (newConstraint != null) {
+ // bubble formulas around the cache.
+ mostRecentFormulas[3] = mostRecentFormulas[2];
+ mostRecentFormulas[2] = mostRecentFormulas[1];
+ mostRecentFormulas[1] = mostRecentFormulas[0];
+ mostRecentFormulas[0] = newConstraint;
+
+ if (!reduceOneConstraint(context, newConstraint))
+ return false;
+
+ if (analyzeNull) {
+ // not per JLS: if the new constraint relates types where at least one has a null annotations,
+ // record all null tagBits as hints for the final inference solution.
+ long nullHints = (newConstraint.left.tagBits | newConstraint.right.tagBits) & TagBits.AnnotationNullMASK;
+ boundI.nullHints |= nullHints;
+ boundJ.nullHints |= nullHints;
+ }
}
- };
- for (int i = 0; i < parameters.length; i++) {
- // A set of bounds on α1, ..., αn, constructed from the declared bounds of P1, ..., Pn as described in 18.1.3, is immediately implied.
- TypeVariableBinding pi = parameters[i];
- InferenceVariable alpha = (InferenceVariable) gAlpha.arguments[i];
- addBounds(pi.getTypeBounds(alpha, theta), context.environment);
+ ConstraintFormula[] typeArgumentConstraints = deriveTypeArgumentConstraints ? deriveTypeArgumentConstraints(boundI, boundJ) : null;
+ if (typeArgumentConstraints != null) {
+ for (int k = 0, length = typeArgumentConstraints.length; k < length; k++) {
+ if (!reduceOneConstraint(context, typeArgumentConstraints[k]))
+ return false;
+ }
+ }
+ if (iteration == 2) {
+ TypeBound boundX = boundI;
+ boundI = boundJ;
+ boundJ = boundX;
+ }
+ } while (first != next && ++iteration <= 2);
+ }
+ }
+ /* TODO: are we sure this will always terminate? Cf. e.g. (Discussion in 18.3):
+ *
+ * "The assertion that incorporation reaches a fixed point oversimplifies the matter slightly. ..."
+ */
+ Iterator<Entry<ParameterizedTypeBinding, ParameterizedTypeBinding>> captIter = this.captures.entrySet().iterator();
+ while (captIter.hasNext()) {
+ Entry<ParameterizedTypeBinding, ParameterizedTypeBinding> capt = captIter.next();
+ ParameterizedTypeBinding gAlpha = capt.getKey();
+ ParameterizedTypeBinding gA = capt.getValue();
+ ReferenceBinding g = (ReferenceBinding) gA.original();
+ final TypeVariableBinding[] parameters = g.typeVariables();
+ // construct theta = [P1:=alpha1,...]
+ final InferenceVariable[] alphas = new InferenceVariable[gAlpha.arguments.length];
+ System.arraycopy(gAlpha.arguments, 0, alphas, 0, alphas.length);
+ InferenceSubstitution theta = new InferenceSubstitution(context.environment, alphas, context.currentInvocation) {
+ @Override
+ protected TypeBinding getP(int i) {
+ return parameters[i];
+ }
+ };
+ for (int i = 0, length = parameters.length; i < length; i++) {
+ // A set of bounds on α1, ..., αn, constructed from the declared bounds of P1, ..., Pn as described in 18.1.3, is immediately implied.
+ TypeVariableBinding pi = parameters[i];
+ InferenceVariable alpha = (InferenceVariable) gAlpha.arguments[i];
+ addBounds(pi.getTypeBounds(alpha, theta), context.environment);
- TypeBinding ai = gA.arguments[i];
- if (ai instanceof WildcardBinding) {
- WildcardBinding wildcardBinding = (WildcardBinding)ai;
- TypeBinding t = wildcardBinding.bound;
- ThreeSets three = this.boundsPerVariable.get(alpha.prototype());
- if (three != null) {
- Iterator<TypeBound> it;
- if (three.sameBounds != null) {
- // α = R implies false
- it = three.sameBounds.iterator();
- while (it.hasNext()) {
- TypeBound bound = it.next();
- if (!(bound.right instanceof InferenceVariable))
+ TypeBinding ai = gA.arguments[i];
+ if (ai instanceof WildcardBinding) {
+ WildcardBinding wildcardBinding = (WildcardBinding)ai;
+ TypeBinding t = wildcardBinding.bound;
+ ThreeSets three = this.boundsPerVariable.get(alpha.prototype());
+ if (three != null) {
+ Iterator<TypeBound> it;
+ if (three.sameBounds != null) {
+ // α = R implies false
+ it = three.sameBounds.iterator();
+ while (it.hasNext()) {
+ TypeBound bound = it.next();
+ if (InferenceContext18.SHOULD_WORKAROUND_BUG_JDK_8054721) {
+ if (bound.right instanceof CaptureBinding && bound.right.isProperType(true))
+ continue;
+ }
+ if (!(bound.right instanceof InferenceVariable))
+ return false;
+ }
+ }
+ if (three.subBounds != null && pi.firstBound != null) {
+ // If Bi is Object, α <: R implies ⟨T <: R⟩ (extends wildcard)
+ // α <: R implies ⟨θ Bi <: R⟩ (else)
+ it = three.subBounds.iterator();
+ while (it.hasNext()) {
+ TypeBound bound = it.next();
+ if (!(bound.right instanceof InferenceVariable)) {
+ TypeBinding r = bound.right;
+ TypeBinding bi1 = pi.firstBound;
+ ReferenceBinding[] otherBounds = pi.superInterfaces;
+ TypeBinding bi;
+ if (otherBounds == Binding.NO_SUPERINTERFACES) {
+ bi = bi1;
+ } else {
+ int n = otherBounds.length+1;
+ ReferenceBinding[] allBounds = new ReferenceBinding[n];
+ allBounds[0] = (ReferenceBinding) bi1; // TODO is this safe?
+ System.arraycopy(otherBounds, 0, allBounds, 1, n-1);
+ bi = context.environment.createIntersectionType18(allBounds);
+ }
+ addTypeBoundsFromWildcardBound(context, theta, wildcardBinding.boundKind, t, r, bi);
+ // if (otherBounds != null) {
+ // for (int j = 0; j < otherBounds.length; j++) {
+ // TypeBinding tj = otherBounds[j];
+ // if (TypeBinding.notEquals(tj, t))
+ // addTypeBoundsFromWildcardBound(context, wildcardBinding, tj, r, bij);
+ // }
+ // }
+ }
+ }
+ }
+ if (three.superBounds != null) {
+ // R <: α implies ⟨R <: T⟩ (super wildcard)
+ // R <: α implies false (else)
+ it = three.superBounds.iterator();
+ while (it.hasNext()) {
+ TypeBound bound = it.next();
+ if (!(bound.right instanceof InferenceVariable)) {
+ if (wildcardBinding.boundKind == Wildcard.SUPER)
+ reduceOneConstraint(context, ConstraintTypeFormula.create(bound.right, t, ReductionResult.SUBTYPE));
+ else
return false;
}
}
- if (three.subBounds != null && pi.firstBound != null) {
- // If Bi is Object, α <: R implies ⟨T <: R⟩ (extends wildcard)
- // α <: R implies ⟨θ Bi <: R⟩ (else)
- it = three.subBounds.iterator();
- while (it.hasNext()) {
- TypeBound bound = it.next();
- if (!(bound.right instanceof InferenceVariable)) {
- TypeBinding r = bound.right;
- TypeBinding bi1 = pi.firstBound;
- ReferenceBinding[] otherBounds = pi.superInterfaces;
- TypeBinding bi;
- if (otherBounds == Binding.NO_SUPERINTERFACES) {
- bi = bi1;
- } else {
- int n = otherBounds.length+1;
- ReferenceBinding[] allBounds = new ReferenceBinding[n];
- allBounds[0] = (ReferenceBinding) bi1; // TODO is this safe?
- System.arraycopy(otherBounds, 0, allBounds, 1, n-1);
- bi = new IntersectionCastTypeBinding(allBounds, context.environment);
- }
- addTypeBoundsFromWildcardBound(context, theta, wildcardBinding.boundKind, t, r, bi);
-// if (otherBounds != null) {
-// for (int j = 0; j < otherBounds.length; j++) {
-// TypeBinding tj = otherBounds[j];
-// if (TypeBinding.notEquals(tj, t))
-// addTypeBoundsFromWildcardBound(context, wildcardBinding, tj, r, bij);
-// }
-// }
- }
- }
- }
- if (three.superBounds != null) {
- // R <: α implies ⟨R <: T⟩ (super wildcard)
- // R <: α implies false (else)
- it = three.superBounds.iterator();
- while (it.hasNext()) {
- TypeBound bound = it.next();
- if (!(bound.right instanceof InferenceVariable)) {
- if (wildcardBinding.boundKind == Wildcard.SUPER)
- reduceOneConstraint(context, ConstraintTypeFormula.create(bound.right, t, ReductionResult.SUBTYPE));
- else
- return false;
- }
- }
- }
}
- } else {
- addBound(new TypeBound(alpha, ai, ReductionResult.SAME), context.environment);
}
+ } else {
+ addBound(new TypeBound(alpha, ai, ReductionResult.SAME), context.environment);
}
}
- this.captures.clear();
- } while (hasUpdate);
+ }
+ this.captures.clear();
return true;
}
@@ -711,10 +806,7 @@
* there exists a supertype (4.10) of S of the form G<S1, ..., Sn> and a supertype of T of the form G<T1, ..., Tn>,
* then for all i, 1 ≤ i ≤ n, if Si and Ti are types (not wildcards), the constraint ⟨Si = Ti⟩ is implied.
*/
- if (boundS.relation != ReductionResult.SUBTYPE || boundT.relation != ReductionResult.SUBTYPE)
- return null;
- if (TypeBinding.notEquals(boundS.left, boundT.left))
- return null;
+ // callers must ensure both relations are <: and both lefts are equal
TypeBinding[] supers = superTypesWithCommonGenericType(boundS.right, boundT.right);
if (supers != null)
return typeArgumentEqualityConstraints(supers[0], supers[1], boundS.isSoft || boundT.isSoft);
@@ -890,7 +982,6 @@
if (three == null) return null;
return three.findSingleWrapperType();
}
-
// this condition is just way too complex to check it in-line:
public boolean condition18_5_2_bullet_3_3_1(InferenceVariable alpha, TypeBinding targetType) {
// T is a reference type, but is not a wildcard-parameterized type, and either
@@ -898,6 +989,8 @@
if (targetType.isBaseType()) return false;
if (InferenceContext18.parameterizedWithWildcard(targetType) != null) return false;
ThreeSets ts = this.boundsPerVariable.get(alpha.prototype());
+ if (ts == null)
+ return false;
if (ts.sameBounds != null) {
Iterator<TypeBound> bounds = ts.sameBounds.iterator();
while (bounds.hasNext()) {
@@ -924,8 +1017,15 @@
for (int j=i+1; j<len; j++) {
TypeBinding s2 = superBounds.get(j).right;
TypeBinding[] supers = superTypesWithCommonGenericType(s1, s2);
- if (supers != null && !TypeBinding.equalsEquals(supers[0], supers[1]))
- return true;
+ if (supers != null) {
+ /* HashMap<K#8,V#9> and HashMap<K#8,ArrayList<T>> with an instantiation for V9 = ArrayList<T> already in the
+ bound set should not be seen as two different parameterizations of the same generic class or interface.
+ See https://bugs.eclipse.org/bugs/show_bug.cgi?id=432626 for a test that triggers this condition.
+ See https://bugs.openjdk.java.net/browse/JDK-8056092: recommendation is to check for proper types.
+ */
+ if (supers[0].isProperType(true) && supers[1].isProperType(true) && !TypeBinding.equalsEquals(supers[0], supers[1]))
+ return true;
+ }
}
}
}
@@ -939,6 +1039,8 @@
if (!targetType.isParameterizedType()) return false;
TypeBinding g = targetType.original();
ThreeSets ts = this.boundsPerVariable.get(alpha.prototype());
+ if (ts == null)
+ return false;
Iterator<TypeBound> boundIterator;
if (ts.sameBounds != null) {
boundIterator = ts.sameBounds.iterator();
@@ -961,7 +1063,8 @@
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) {
if (s instanceof InferenceVariable)
return false; // inference has no super types
- if (s.findSuperTypeOriginatingFrom(g) == null)
+ final TypeBinding superType = s.findSuperTypeOriginatingFrom(g);
+ if (superType != null && !superType.isParameterizedType())
return s.isCompatibleWith(env.convertToRawType(g, false));
return false;
}
@@ -989,4 +1092,24 @@
}
return null;
}
+
+ public TypeBinding getEquivalentOuterVariable(InferenceVariable variable, InferenceVariable[] outerVariables) {
+ ThreeSets three = this.boundsPerVariable.get(variable);
+ if (three != null) {
+ for (TypeBound bound : three.sameBounds) {
+ for (InferenceVariable iv : outerVariables)
+ if (TypeBinding.equalsEquals(bound.right, iv))
+ return iv;
+ }
+ }
+ for (InferenceVariable iv : outerVariables) {
+ three = this.boundsPerVariable.get(outerVariables);
+ if (three != null) {
+ for (TypeBound bound : three.sameBounds)
+ if (TypeBinding.equalsEquals(bound.right, variable))
+ return iv;
+ }
+ }
+ return null;
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
index def8c42..a6816cb 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,15 @@
* Stephan Herrmann - Contribution for
* Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
* Bug 429384 - [1.8][null] implement conformance rules for null-annotated lower / upper type bounds
+ * Bug 441797 - [1.8] synchronize type annotations on capture and its wildcard
+ * Bug 456497 - [1.8][null] during inference nullness from target type is lost against weaker hint from applicability analysis
+ * Bug 456924 - StackOverflowError during compilation
+ * Bug 462790 - [null] NPE in Expression.computeConversion()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@@ -26,30 +31,47 @@
/* information to compute unique binding key */
public ReferenceBinding sourceType;
- public int position;
+ public int start;
+ public int end;
+ public ASTNode cud; // to facilitate recaptures.
- public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int position, int captureID) {
- super(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX, null, 0, wildcard.environment);
+ TypeBinding pendingSubstitute; // for substitution of recursive captures, see https://bugs.eclipse.org/456924
+
+ public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int start, int end, ASTNode cud, int captureID) {
+ super(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX, wildcard.environment);
this.wildcard = wildcard;
this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat capture as public
this.fPackage = wildcard.fPackage;
this.sourceType = sourceType;
- this.position = position;
+ this.start = start;
+ this.end = end;
this.captureID = captureID;
this.tagBits |= TagBits.HasCapturedWildcard;
+ this.cud = cud;
if (wildcard.hasTypeAnnotations()) {
- setTypeAnnotations(wildcard.getTypeAnnotations(), wildcard.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled);
+ // register an unannoted version before adding the annotated wildcard:
+ CaptureBinding unannotated = (CaptureBinding) clone(null);
+ unannotated.wildcard = (WildcardBinding) this.wildcard.unannotated();
+ this.environment.getUnannotatedType(unannotated);
+ this.id = unannotated.id; // transfer fresh id
+ // now register this annotated type:
+ this.environment.typeSystem.cacheDerivedType(this, unannotated, this);
+ // propagate from wildcard to capture - use super version, because our own method propagates type annotations in the opposite direction:
+ super.setTypeAnnotations(wildcard.getTypeAnnotations(), wildcard.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled);
if (wildcard.hasNullTypeAnnotations())
this.tagBits |= TagBits.HasNullTypeAnnotation;
+ } else {
+ computeId(this.environment);
}
}
// for subclass CaptureBinding18
- protected CaptureBinding(ReferenceBinding sourceType, char[] sourceName, int position, int captureID, LookupEnvironment environment) {
+ protected CaptureBinding(ReferenceBinding sourceType, char[] sourceName, int start, int end, int captureID, LookupEnvironment environment) {
super(sourceName, null, 0, environment);
this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat capture as public
this.sourceType = sourceType;
- this.position = position;
+ this.start = start;
+ this.end = end;
this.captureID = captureID;
}
@@ -57,10 +79,12 @@
super(prototype);
this.wildcard = prototype.wildcard;
this.sourceType = prototype.sourceType;
- this.position = prototype.position;
+ this.start = prototype.start;
+ this.end = prototype.end;
this.captureID = prototype.captureID;
this.lowerBound = prototype.lowerBound;
this.tagBits |= (prototype.tagBits & TagBits.HasCapturedWildcard);
+ this.cud = prototype.cud;
}
// Captures may get cloned and annotated during type inference.
@@ -81,7 +105,7 @@
}
buffer.append(TypeConstants.WILDCARD_CAPTURE);
buffer.append(this.wildcard.computeUniqueKey(false/*not a leaf*/));
- buffer.append(this.position);
+ buffer.append(this.end);
buffer.append(';');
int length = buffer.length();
char[] uniqueKey = new char[length];
@@ -128,7 +152,7 @@
switch (this.wildcard.boundKind) {
case Wildcard.EXTENDS :
// still need to capture bound supertype as well so as not to expose wildcards to the outside (111208)
- TypeBinding capturedWildcardBound = originalWildcardBound.capture(scope, this.position);
+ TypeBinding capturedWildcardBound = originalWildcardBound.capture(scope, this.start, this.end);
if (originalWildcardBound.isInterface()) {
this.setSuperClass(scope.getJavaLangObject());
this.setSuperInterfaces(new ReferenceBinding[] { (ReferenceBinding) capturedWildcardBound });
@@ -180,7 +204,7 @@
switch (this.wildcard.boundKind) {
case Wildcard.EXTENDS :
// still need to capture bound supertype as well so as not to expose wildcards to the outside (111208)
- TypeBinding capturedWildcardBound = originalWildcardBound.capture(scope, this.position);
+ TypeBinding capturedWildcardBound = originalWildcardBound.capture(scope, this.start, this.end);
if (originalWildcardBound.isInterface()) {
this.setSuperClass(substitutedVariableSuperclass);
// merge wildcard bound into variable superinterfaces using glb
@@ -253,6 +277,15 @@
return false;
}
+ @Override
+ public boolean isProperType(boolean admitCapture18) {
+ if (this.lowerBound != null && !this.lowerBound.isProperType(admitCapture18))
+ return false;
+ if (this.wildcard != null && !this.wildcard.isProperType(admitCapture18))
+ return false;
+ return super.isProperType(admitCapture18);
+ }
+
public char[] readableName() {
if (this.wildcard != null) {
StringBuffer buffer = new StringBuffer(10);
@@ -268,6 +301,20 @@
}
return super.readableName();
}
+
+ public char[] signableName() {
+ if (this.wildcard != null) {
+ StringBuffer buffer = new StringBuffer(10);
+ buffer
+ .append(TypeConstants.WILDCARD_CAPTURE_SIGNABLE_NAME_SUFFIX)
+ .append(this.wildcard.readableName());
+ int length = buffer.length();
+ char[] name = new char[length];
+ buffer.getChars(0, length, name, 0);
+ return name;
+ }
+ return super.readableName();
+ }
public char[] shortReadableName() {
if (this.wildcard != null) {
@@ -295,7 +342,7 @@
try {
if (this.wildcard != null) {
nameBuffer.append("of "); //$NON-NLS-1$
- nameBuffer.append(this.wildcard.nullAnnotatedReadableName(options, shortNames));
+ nameBuffer.append(this.wildcard.withoutToplevelNullAnnotation().nullAnnotatedReadableName(options, shortNames));
} else if (this.lowerBound != null) {
nameBuffer.append(" super "); //$NON-NLS-1$
nameBuffer.append(this.lowerBound.nullAnnotatedReadableName(options, shortNames));
@@ -317,10 +364,93 @@
}
@Override
+ public TypeBinding withoutToplevelNullAnnotation() {
+ if (!hasNullTypeAnnotations())
+ return this;
+ if (this.wildcard != null && this.wildcard.hasNullTypeAnnotations()) {
+ WildcardBinding newWildcard = (WildcardBinding) this.wildcard.withoutToplevelNullAnnotation();
+ if (newWildcard != this.wildcard) { //$IDENTITY-COMPARISON$
+
+ CaptureBinding newCapture = (CaptureBinding) this.environment.getUnannotatedType(this).clone(null);
+ if (newWildcard.hasTypeAnnotations())
+ newCapture.tagBits |= TagBits.HasTypeAnnotations;
+ newCapture.wildcard = newWildcard;
+
+ // manually transfer the following two, because we are not in a context where we can call initializeBounds():
+ newCapture.superclass = this.superclass;
+ newCapture.superInterfaces = this.superInterfaces;
+
+ AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
+ return this.environment.createAnnotatedType(newCapture, newAnnotations);
+ }
+ }
+ return super.withoutToplevelNullAnnotation();
+ }
+
+ @Override
+ TypeBinding substituteInferenceVariable(InferenceVariable var, TypeBinding substituteType) {
+ if (this.pendingSubstitute != null)
+ return this.pendingSubstitute;
+ try {
+ TypeBinding substitutedWildcard = this.wildcard.substituteInferenceVariable(var, substituteType);
+ if (substitutedWildcard != this.wildcard) { //$IDENTITY-COMPARISON$
+ CaptureBinding substitute = (CaptureBinding) clone(enclosingType());
+ substitute.wildcard = (WildcardBinding) substitutedWildcard;
+ this.pendingSubstitute = substitute;
+ if (this.lowerBound != null)
+ substitute.lowerBound = this.lowerBound.substituteInferenceVariable(var, substituteType);
+ if (this.firstBound != null)
+ substitute.firstBound = this.firstBound.substituteInferenceVariable(var, substituteType);
+ if (this.superclass != null)
+ substitute.superclass = (ReferenceBinding) this.superclass.substituteInferenceVariable(var, substituteType);
+ if (this.superInterfaces != null) {
+ int length = this.superInterfaces.length;
+ substitute.superInterfaces = new ReferenceBinding[length];
+ for (int i = 0; i < length; i++)
+ substitute.superInterfaces[i] = (ReferenceBinding) this.superInterfaces[i].substituteInferenceVariable(var, substituteType);
+ }
+ return substitute;
+ }
+ return this;
+ } finally {
+ this.pendingSubstitute = null;
+ }
+ }
+
+ @Override
+ public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
+ super.setTypeAnnotations(annotations, evalNullAnnotations);
+ if (annotations != Binding.NO_ANNOTATIONS && this.wildcard != null) {
+ // keep annotations in sync, propagate from capture to its wildcard:
+ this.wildcard = (WildcardBinding) this.wildcard.environment.createAnnotatedType(this.wildcard, annotations);
+ }
+ }
+
+ @Override
public TypeBinding uncapture(Scope scope) {
return this.wildcard;
}
+ /*
+ * CaptureBinding needs even more propagation, because we are creating a naked type
+ * (during CaptureBinding(WildcardBinding,ReferenceBinding,int,int,ASTNode,int)
+ * that has no firstBound / superclass / superInterfaces set.
+ */
+ @Override
+ protected TypeBinding[] getDerivedTypesForDeferredInitialization() {
+ TypeBinding[] derived = this.environment.typeSystem.getDerivedTypes(this);
+ if (derived.length > 0) {
+ int count = 0;
+ for (int i = 0; i < derived.length; i++) {
+ if (derived[i] != null && derived[i].id == this.id)
+ derived[count++] = derived[i];
+ }
+ if (count < derived.length)
+ System.arraycopy(derived, 0, derived = new TypeBinding[count], 0, count);
+ }
+ return derived;
+ }
+
public String toString() {
if (this.wildcard != null) {
StringBuffer buffer = new StringBuffer(10);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
index 0ae9d2f..d507f10 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
@@ -11,6 +11,7 @@
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
/**
* Capture-like type variable introduced during 1.8 type inference.
@@ -19,12 +20,22 @@
TypeBinding[] upperBounds;
private char[] originalName;
+ private CaptureBinding18 prototype;
- public CaptureBinding18(ReferenceBinding contextType, char[] sourceName, char[] originalName, int position, int captureID, LookupEnvironment environment) {
- super(contextType, sourceName, position, captureID, environment);
+ public CaptureBinding18(ReferenceBinding contextType, char[] sourceName, char[] originalName, int start, int end, int captureID, LookupEnvironment environment) {
+ super(contextType, sourceName, start, end, captureID, environment);
this.originalName = originalName;
+ this.prototype = this;
}
+ private CaptureBinding18(CaptureBinding18 prototype) {
+ super(prototype);
+ this.sourceName = CharOperation.append(prototype.sourceName, '\'');
+ this.originalName = prototype.originalName;
+ this.upperBounds = prototype.upperBounds;
+ this.prototype = prototype.prototype;
+ }
+
public boolean setUpperBounds(TypeBinding[] upperBounds, ReferenceBinding javaLangObject) {
this.upperBounds = upperBounds;
if (upperBounds.length > 0)
@@ -58,7 +69,7 @@
}
public TypeBinding clone(TypeBinding enclosingType) {
- return new CaptureBinding18(this.sourceType, CharOperation.append(this.sourceName, '\''), this.originalName, this.position, this.captureID, this.environment);
+ return new CaptureBinding18(this);
}
public MethodBinding[] getMethods(char[] selector) {
@@ -80,7 +91,7 @@
}
if (!multipleErasures)
return erasures[0];
- return new IntersectionCastTypeBinding(erasures, this.environment);
+ return this.environment.createIntersectionType18(erasures);
}
return super.erasure();
}
@@ -99,16 +110,12 @@
// capture of ? extends X[]
if (aBound != null && aBound.isArrayType()) {
if (!aBound.isCompatibleWith(otherType))
- continue;
- }
- switch (otherType.kind()) {
+ return false;
+ } else switch (otherType.kind()) {
case Binding.WILDCARD_TYPE :
case Binding.INTERSECTION_TYPE :
if (!((WildcardBinding) otherType).boundCheck(aBound))
return false;
- break;
- default:
- return false;
}
}
return true;
@@ -117,17 +124,50 @@
}
public boolean isCompatibleWith(TypeBinding otherType, Scope captureScope) {
+ if (TypeBinding.equalsEquals(this, otherType))
+ return true;
if (this.inRecursiveFunction)
return true;
this.inRecursiveFunction = true;
try {
if (this.upperBounds != null) {
- for (int i = 0; i < this.upperBounds.length; i++) {
+ int length = this.upperBounds.length;
+
+ // need to compare two intersection types? (borrowed from IntersectionType18)
+ int rightKind = otherType.kind();
+ TypeBinding[] rightIntersectingTypes = null;
+ if (rightKind == INTERSECTION_TYPE && otherType.boundKind() == Wildcard.EXTENDS) {
+ TypeBinding allRightBounds = ((WildcardBinding) otherType).allBounds();
+ if (allRightBounds instanceof IntersectionTypeBinding18)
+ rightIntersectingTypes = ((IntersectionTypeBinding18) allRightBounds).intersectingTypes;
+ } else if (rightKind == INTERSECTION_TYPE18) {
+ rightIntersectingTypes = ((IntersectionTypeBinding18) otherType).intersectingTypes;
+ }
+ if (rightIntersectingTypes != null) {
+ int numRequired = rightIntersectingTypes.length;
+ TypeBinding[] required = new TypeBinding[numRequired];
+ System.arraycopy(rightIntersectingTypes, 0, required, 0, numRequired);
+ for (int i = 0; i < length; i++) {
+ TypeBinding provided = this.upperBounds[i];
+ for (int j = 0; j < required.length; j++) {
+ if (required[j] == null) continue;
+ if (provided.isCompatibleWith(required[j], captureScope)) {
+ required[j] = null;
+ if (--numRequired == 0)
+ return true;
+ break;
+ }
+ }
+ }
+ return false;
+ }
+
+ for (int i = 0; i < length; i++) {
if (this.upperBounds[i].isCompatibleWith(otherType, captureScope))
return true;
}
}
- return super.isCompatibleWith(otherType, captureScope);
+ return false;
} finally {
this.inRecursiveFunction = false;
}
@@ -192,6 +232,11 @@
}
}
}
+ TypeBinding currentFirstBound = null;
+ if (this.firstBound != null) {
+ currentFirstBound = this.firstBound.substituteInferenceVariable(var, substituteType);
+ haveSubstitution |= TypeBinding.notEquals(this.firstBound, currentFirstBound);
+ }
if (haveSubstitution) {
final CaptureBinding18 newCapture = (CaptureBinding18) clone(enclosingType());
newCapture.tagBits = this.tagBits;
@@ -209,6 +254,8 @@
return CaptureBinding18.this.environment;
}
};
+ if (currentFirstBound != null)
+ newCapture.firstBound = Scope.substitute(substitution, currentFirstBound);
newCapture.superclass = (ReferenceBinding) Scope.substitute(substitution, currentSuperclass);
newCapture.superInterfaces = Scope.substitute(substitution, currentSuperInterfaces);
newCapture.upperBounds = Scope.substitute(substitution, currentUpperBounds);
@@ -248,7 +295,7 @@
if (this.genericTypeSignature == null) {
char[] boundSignature;
try {
- if (this.recursionLevel++ > 0 || this.firstBound == null) {
+ if (this.prototype.recursionLevel++ > 0 || this.firstBound == null) {
boundSignature = TypeConstants.WILDCARD_STAR;
} else if (this.upperBounds != null) {
boundSignature = CharOperation.concat(TypeConstants.WILDCARD_PLUS, this.firstBound.genericTypeSignature());
@@ -259,7 +306,7 @@
}
this.genericTypeSignature = CharOperation.concat(TypeConstants.WILDCARD_CAPTURE, boundSignature);
} finally {
- this.recursionLevel--;
+ this.prototype.recursionLevel--;
}
}
return this.genericTypeSignature;
@@ -267,9 +314,9 @@
public char[] readableName() {
if (this.lowerBound == null && this.firstBound != null) {
- if (this.recursionLevel < 2) {
+ if (this.prototype.recursionLevel < 2) {
try {
- this.recursionLevel ++;
+ this.prototype.recursionLevel ++;
if (this.upperBounds != null && this.upperBounds.length > 1) {
StringBuffer sb = new StringBuffer();
sb.append(this.upperBounds[0].readableName());
@@ -282,7 +329,7 @@
}
return this.firstBound.readableName();
} finally {
- this.recursionLevel--;
+ this.prototype.recursionLevel--;
}
} else {
return this.originalName;
@@ -293,9 +340,9 @@
public char[] shortReadableName() {
if (this.lowerBound == null && this.firstBound != null) {
- if (this.recursionLevel < 2) {
+ if (this.prototype.recursionLevel < 2) {
try {
- this.recursionLevel++;
+ this.prototype.recursionLevel++;
if (this.upperBounds != null && this.upperBounds.length > 1) {
StringBuffer sb = new StringBuffer();
sb.append(this.upperBounds[0].shortReadableName());
@@ -308,7 +355,7 @@
}
return this.firstBound.shortReadableName();
} finally {
- this.recursionLevel--;
+ this.prototype.recursionLevel--;
}
} else {
return this.originalName;
@@ -325,7 +372,7 @@
public char[] computeUniqueKey(boolean isLeaf) {
StringBuffer buffer = new StringBuffer();
buffer.append(TypeConstants.CAPTURE18);
- buffer.append('{').append(this.position).append('#').append(this.captureID).append('}');
+ buffer.append('{').append(this.end).append('#').append(this.captureID).append('}');
buffer.append(';');
int length = buffer.length();
char[] uniqueKey = new char[length];
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index b0d0148..9d0f753 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,8 +19,11 @@
* Bug 427199 - [1.8][resource] avoid resource leak warnings on Streams that have no resource
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 434570 - Generic type mismatch for parametrized class annotation attribute with inner class
+ * Bug 444024 - [1.8][compiler][null] Type mismatch error in annotation generics assignment which happens "sometimes"
+ * Bug 459967 - [null] compiler should know about nullness of special methods like MyEnum.valueOf()
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 415821 - [1.8][compiler] CLASS_EXTENDS target type annotation missing for anonymous classes
+ * het@google.com - Bug 456986 - Bogus error when annotation processor generates annotation type
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -291,6 +294,9 @@
int count = 0;
nextMember : for (int i = 0; i < length; i++) {
TypeDeclaration memberContext = this.referenceContext.memberTypes[i];
+ if (this.environment().isProcessingAnnotations && this.environment().isMissingType(memberContext.name)) {
+ throw new SourceTypeCollisionException(); // resolved a type ref before APT generated the type
+ }
switch(TypeDeclaration.kind(memberContext.modifiers)) {
case TypeDeclaration.INTERFACE_DECL :
case TypeDeclaration.ANNOTATION_TYPE_DECL :
@@ -402,6 +408,12 @@
fields[i].modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
}
}
+ if (isEnum && compilerOptions().isAnnotationBasedNullAnalysisEnabled) {
+ // mark return types of values & valueOf as nonnull (needed to wait till after setMethods() to avoid reentrance):
+ LookupEnvironment environment = this.environment();
+ ((SyntheticMethodBinding)methodBindings[0]).markNonNull(environment);
+ ((SyntheticMethodBinding)methodBindings[1]).markNonNull(environment);
+ }
}
// AspectJ start - replace original method with one simply passing null to new variant
SourceTypeBinding buildType(SourceTypeBinding enclosingType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
@@ -1136,6 +1148,10 @@
void connectTypeHierarchy() {
SourceTypeBinding sourceType = this.referenceContext.binding;
+ CompilationUnitScope compilationUnitScope = compilationUnitScope();
+ boolean wasAlreadyConnecting = compilationUnitScope.connectingHierarchy;
+ compilationUnitScope.connectingHierarchy = true;
+ try {
if ((sourceType.tagBits & TagBits.BeginHierarchyCheck) == 0) {
sourceType.tagBits |= TagBits.BeginHierarchyCheck;
environment().typesBeingConnected.add(sourceType);
@@ -1149,6 +1165,9 @@
problemReporter().hierarchyHasProblems(sourceType);
}
connectMemberTypes();
+ } finally {
+ compilationUnitScope.connectingHierarchy = wasAlreadyConnecting;
+ }
LookupEnvironment env = environment();
try {
env.missingClassFileLocation = this.referenceContext;
@@ -1188,6 +1207,10 @@
if ((sourceType.tagBits & TagBits.BeginHierarchyCheck) != 0)
return;
+ CompilationUnitScope compilationUnitScope = compilationUnitScope();
+ boolean wasAlreadyConnecting = compilationUnitScope.connectingHierarchy;
+ compilationUnitScope.connectingHierarchy = true;
+ try {
sourceType.tagBits |= TagBits.BeginHierarchyCheck;
environment().typesBeingConnected.add(sourceType);
boolean noProblems = connectSuperclass();
@@ -1198,6 +1221,9 @@
sourceType.tagBits |= TagBits.TypeVariablesAreConnected;
if (noProblems && sourceType.isHierarchyInconsistent())
problemReporter().hierarchyHasProblems(sourceType);
+ } finally {
+ compilationUnitScope.connectingHierarchy = wasAlreadyConnecting;
+ }
}
public boolean detectHierarchyCycle(TypeBinding superType, TypeReference reference) {
@@ -1252,6 +1278,11 @@
// force its superclass & superinterfaces to be found... 2 possibilities exist - the source type is included in the hierarchy of:
// - a binary type... this case MUST be caught & reported here
// - another source type... this case is reported against the other source type
+ if (superType.problemId() != ProblemReasons.NotFound && (superType.tagBits & TagBits.HierarchyHasProblems) != 0) {
+ sourceType.tagBits |= TagBits.HierarchyHasProblems;
+ problemReporter().hierarchyHasProblems(sourceType);
+ return true;
+ }
boolean hasCycle = false;
ReferenceBinding parentType = superType.superclass();
if (parentType != null) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index fdfbfc8..a3eb326 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -819,6 +819,8 @@
return "--- CompilationUnit Scope : " + new String(this.referenceContext.getFileName()); //$NON-NLS-1$
}
private ReferenceBinding typeToRecord(TypeBinding type) {
+ if (type == null)
+ return null;
while (type.isArrayType())
type = ((ArrayBinding) type).leafComponentType();
@@ -827,7 +829,7 @@
case Binding.TYPE_PARAMETER :
case Binding.WILDCARD_TYPE :
case Binding.INTERSECTION_TYPE :
- case Binding.INTERSECTION_CAST_TYPE: // constituents would have been recorded.
+ case Binding.INTERSECTION_TYPE18: // constituents would have been recorded.
case Binding.POLY_TYPE: // not a real type, will mutate into one, hopefully soon.
return null;
case Binding.PARAMETERIZED_TYPE :
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java
index 48ae744..010f539 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java
@@ -79,14 +79,14 @@
TypeBinding[] ePrime = null;
if (this.left instanceof LambdaExpression) {
- LambdaExpression lambda = ((LambdaExpression) this.left).getResolvedCopyForInferenceTargeting(this.right);
+ LambdaExpression lambda = ((LambdaExpression) this.left).resolveExpressionExpecting(this.right, inferenceContext.scope, inferenceContext);
if (lambda == null)
return TRUE; // cannot make use of this buggy constraint
Set<TypeBinding> ePrimeSet = lambda.getThrownExceptions();
ePrime = ePrimeSet.toArray(new TypeBinding[ePrimeSet.size()]);
} else {
- ReferenceExpression referenceExpression = (ReferenceExpression)this.left;
- MethodBinding method = referenceExpression.findCompileTimeMethodTargeting(this.right, scope);
+ ReferenceExpression referenceExpression = ((ReferenceExpression) this.left).resolveExpressionExpecting(this.right, scope, inferenceContext);
+ MethodBinding method = referenceExpression != null ? referenceExpression.binding : null;
if (method != null)
ePrime = method.thrownExceptions;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
index 79a7014..0cc96ea 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2015 GK Software AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,18 +17,13 @@
import java.util.List;
import java.util.Set;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExpressionContext;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FunctionalExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Invocation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReturnStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.SuspendedInferenceRecord;
/**
@@ -55,42 +50,20 @@
}
public Object reduce(InferenceContext18 inferenceContext) throws InferenceFailureException {
+
+ if (this.relation == POTENTIALLY_COMPATIBLE) {
+ /* 15.12.2.1: ... The definition of potential applicability goes beyond a basic arity check to also take into account the presence and "shape" of functional interface
+ target types. In some cases involving type argument inference, a lambda expression appearing as a method invocation argument cannot be properly typed until after
+ overload resolution. These rules allow the form of the lambda expression to still be taken into account, discarding obviously incorrect target types that might
+ otherwise cause ambiguity errors.
+ */
+
+ return this.left.isPotentiallyCompatibleWith(this.right, inferenceContext.scope) ? TRUE: FALSE;
+ }
+
// JLS 18.2.1
- proper:
if (this.right.isProperType(true)) {
- TypeBinding exprType = this.left.resolvedType;
- if (exprType == null) {
- // if we get here for some kinds of poly expressions (incl. ConditionalExpression),
- // then other ways for checking compatibility are needed:
- if (this.left instanceof FunctionalExpression) {
- if (this.left instanceof LambdaExpression) {
- // cf. NegativeLambdaExpressionTest.test412453()
- LambdaExpression copy = ((LambdaExpression) this.left).getResolvedCopyForInferenceTargeting(this.right);
- return (copy != null && copy.resolvedType != null && copy.resolvedType.isValidBinding()) ? TRUE : FALSE;
- }
- }
- return this.left.isCompatibleWith(this.right, inferenceContext.scope) ? TRUE : FALSE;
- } else if (!exprType.isValidBinding()) {
- return FALSE;
- }
- if (isCompatibleWithInLooseInvocationContext(exprType, this.right, inferenceContext)) {
- return TRUE;
- } else if (this.left instanceof AllocationExpression && this.left.isPolyExpression()) {
- // half-resolved diamond has a resolvedType, but that may not be the final word, try one more step of resolution:
- MethodBinding binding = ((AllocationExpression) this.left).binding(this.right, false, null);
- return (binding != null && binding.declaringClass.isCompatibleWith(this.right, inferenceContext.scope)) ? TRUE : FALSE;
- } else if (this.left instanceof Invocation && this.left.isPolyExpression()) {
- Invocation invoc = (Invocation) this.left;
- MethodBinding binding = invoc.binding(this.right, false, null);
- if (binding instanceof ParameterizedGenericMethodBinding) {
- ParameterizedGenericMethodBinding method = (ParameterizedGenericMethodBinding) binding;
- InferenceContext18 leftCtx = invoc.getInferenceContext(method);
- if (leftCtx.stepCompleted < InferenceContext18.TYPE_INFERRED) {
- break proper; // fall through into nested inference below (not explicit in the spec!)
- }
- }
- }
- return FALSE;
+ return this.left.isCompatibleWith(this.right, inferenceContext.scope) || this.left.isBoxingCompatibleWith(this.right, inferenceContext.scope) ? TRUE : FALSE;
}
if (!canBePolyExpression(this.left)) {
TypeBinding exprType = this.left.resolvedType;
@@ -102,7 +75,7 @@
// - parenthesized expression : these are transparent in our AST
if (this.left instanceof Invocation) {
Invocation invocation = (Invocation) this.left;
- MethodBinding previousMethod = invocation.binding(this.right, false, null);
+ MethodBinding previousMethod = invocation.binding();
if (previousMethod == null) // can happen, e.g., if inside a copied lambda with ignored errors
return null; // -> proceed with no new constraints
MethodBinding method = previousMethod;
@@ -121,17 +94,31 @@
if (previousMethod instanceof ParameterizedGenericMethodBinding) {
// find the previous inner inference context to see what inference kind this invocation needs:
InferenceContext18 innerCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) previousMethod);
- if (innerCtx == null) { // no inference -> assume it wasn't really poly after all
+ if (innerCtx == null) {
+ /* No inference context -> the method was likely manufactured by Scope.findExactMethod -> assume it wasn't really poly after all.
+ -> proceed as for non-poly expressions.
+ */
TypeBinding exprType = this.left.resolvedType;
if (exprType == null || !exprType.isValidBinding())
return FALSE;
return ConstraintTypeFormula.create(exprType, this.right, COMPATIBLE, this.isSoft);
}
- inferenceContext.inferenceKind = innerCtx.inferenceKind;
- innerCtx.outerContext = inferenceContext;
+ if (innerCtx.stepCompleted >= InferenceContext18.APPLICABILITY_INFERRED) {
+ inferenceContext.currentBounds.addBounds(innerCtx.b2, inferenceContext.environment);
+ inferenceContext.inferenceVariables = innerCtx.inferenceVariables;
+ inferenceContext.inferenceKind = innerCtx.inferenceKind;
+ innerCtx.outerContext = inferenceContext;
+ inferenceContext.usesUncheckedConversion = innerCtx.usesUncheckedConversion;
+ } else {
+ return FALSE; // should not reach here.
+ }
+ // b2 has been lifted, inferring poly invocation type amounts to lifting b3.
+ } else {
+ inferenceContext.inferenceKind = inferenceContext.getInferenceKind(previousMethod, argumentTypes);
+ boolean isDiamond = method.isConstructor() && this.left.isPolyExpression(method);
+ inferInvocationApplicability(inferenceContext, method, argumentTypes, isDiamond, inferenceContext.inferenceKind);
+ // b2 has been lifted, inferring poly invocation type amounts to lifting b3.
}
- boolean isDiamond = method.isConstructor() && this.left.isPolyExpression(method);
- inferInvocationApplicability(inferenceContext, method, argumentTypes, isDiamond, inferenceContext.inferenceKind);
if (!inferPolyInvocationType(inferenceContext, invocation, this.right, method))
return FALSE;
return null; // already incorporated
@@ -167,7 +154,7 @@
for (int i = 0; i < parameters.length; i++)
if (!parameters[i].isProperType(true))
return FALSE;
- lambda = lambda.getResolvedCopyForInferenceTargeting(t);
+ lambda = lambda.resolveExpressionExpecting(t, inferenceContext.scope, inferenceContext);
if (lambda == null)
return FALSE; // not strictly unreduceable, but proceeding with TRUE would likely produce secondary errors
if (functionType.returnType == TypeBinding.VOID) {
@@ -181,20 +168,15 @@
if (!lambda.argumentsTypeElided()) {
Argument[] arguments = lambda.arguments();
for (int i = 0; i < parameters.length; i++)
- result.add(ConstraintTypeFormula.create(parameters[i], arguments[i].type.resolveType(lambda.enclosingScope), SAME));
+ result.add(ConstraintTypeFormula.create(parameters[i], arguments[i].type.resolvedType, SAME));
// in addition, ⟨T' <: T⟩:
if (lambda.resolvedType != null)
result.add(ConstraintTypeFormula.create(lambda.resolvedType, this.right, SUBTYPE));
}
if (functionType.returnType != TypeBinding.VOID) {
TypeBinding r = functionType.returnType;
- Expression[] exprs;
- if (lambda.body() instanceof Expression) {
- exprs = new Expression[] {(Expression)lambda.body()};
- } else {
- exprs = lambda.resultExpressions();
- }
- for (int i = 0; i < exprs.length; i++) {
+ Expression[] exprs = lambda.resultExpressions();
+ for (int i = 0, length = exprs == null ? 0 : exprs.length; i < length; i++) {
Expression expr = exprs[i];
if (r.isProperType(true) && expr.resolvedType != null) {
TypeBinding exprType = expr.resolvedType;
@@ -217,7 +199,7 @@
return FALSE;
}
- public ReferenceBinding findGroundTargetType(InferenceContext18 inferenceContext, BlockScope scope,
+ public static ReferenceBinding findGroundTargetType(InferenceContext18 inferenceContext, BlockScope scope,
LambdaExpression lambda, ParameterizedTypeBinding targetTypeWithWildCards)
{
if (lambda.argumentsTypeElided()) {
@@ -254,8 +236,9 @@
MethodBinding functionType = t.getSingleAbstractMethod(inferenceContext.scope, true);
if (functionType == null)
return FALSE;
- // potentially-applicable method for the method reference when targeting T (15.28.1),
- MethodBinding potentiallyApplicable = reference.findCompileTimeMethodTargeting(t, inferenceContext.scope);
+ // potentially-applicable method for the method reference when targeting T (15.13.1),
+ reference = reference.resolveExpressionExpecting(t, inferenceContext.scope, inferenceContext);
+ MethodBinding potentiallyApplicable = reference != null ? reference.binding : null;
if (potentiallyApplicable == null)
return FALSE;
if (reference.isExactMethodReference()) {
@@ -276,7 +259,7 @@
TypeBinding rAppl = potentiallyApplicable.isConstructor() && !reference.isArrayConstructorReference() ? potentiallyApplicable.declaringClass : potentiallyApplicable.returnType;
if (rAppl == TypeBinding.VOID)
return FALSE;
- TypeBinding rPrime = rAppl.capture(inferenceContext.scope, 14); // FIXME capture position??
+ TypeBinding rPrime = rAppl.capture(inferenceContext.scope, reference.sourceStart, reference.sourceEnd);
newConstraints.add(ConstraintTypeFormula.create(rPrime, r, COMPATIBLE));
}
return newConstraints.toArray(new ConstraintFormula[newConstraints.size()]);
@@ -285,7 +268,7 @@
for (int i = 0; i < n; i++)
if (!functionType.parameters[i].isProperType(true))
return FALSE;
- // Otherwise, a search for a compile-time declaration is performed, as defined in 15.28.1....
+ // Otherwise, a search for a compile-time declaration is performed, as defined in 15.13.1....
// Note: we currently don't distinguish search for a potentially-applicable method from searching the compiler-time declaration,
// hence reusing the method binding from above
MethodBinding compileTimeDecl = potentiallyApplicable;
@@ -295,18 +278,21 @@
if (r.id == TypeIds.T_void)
return TRUE;
// ignore parameterization of resolve result and do a fresh start:
- MethodBinding original = compileTimeDecl.original();
+ MethodBinding original = compileTimeDecl.shallowOriginal();
+ TypeBinding compileTypeReturn = original.isConstructor() ? original.declaringClass : original.returnType;
if (reference.typeArguments == null
- && ((original.typeVariables() != Binding.NO_TYPE_VARIABLES && r.mentionsAny(original.typeVariables(), -1))
- || (original.isConstructor() && original.declaringClass.typeVariables() != Binding.NO_TYPE_VARIABLES)))
+ && ((original.typeVariables() != Binding.NO_TYPE_VARIABLES && compileTypeReturn.mentionsAny(original.typeVariables(), -1))
+ || (original.isConstructor() && compileTimeDecl.declaringClass.isRawType())))
// not checking r.mentionsAny for constructors, because A::new resolves to the raw type
// whereas in fact the type of all expressions of this shape depends on their type variable (if any)
{
- SuspendedInferenceRecord prevInvocation = inferenceContext.enterPolyInvocation(reference, null/*no invocation arguments available*/);
+ SuspendedInferenceRecord prevInvocation = inferenceContext.enterPolyInvocation(reference, reference.createPseudoExpressions(functionType.parameters));
// Invocation Applicability Inference: 18.5.1 & Invocation Type Inference: 18.5.2
try {
- inferInvocationApplicability(inferenceContext, original, functionType.parameters, original.isConstructor()/*mimic a diamond?*/, inferenceContext.inferenceKind);
+ InferenceContext18 innerContex = reference.getInferenceContext((ParameterizedMethodBinding) compileTimeDecl);
+ int innerInferenceKind = innerContex != null ? innerContex.inferenceKind : InferenceContext18.CHECK_STRICT;
+ inferInvocationApplicability(inferenceContext, original, functionType.parameters, original.isConstructor()/*mimic a diamond?*/, innerInferenceKind);
if (!inferPolyInvocationType(inferenceContext, reference, r, original))
return FALSE;
if (!original.isConstructor()
@@ -320,7 +306,7 @@
inferenceContext.resumeSuspendedInference(prevInvocation);
}
}
- TypeBinding rPrime = compileTimeDecl.isConstructor() ? compileTimeDecl.declaringClass : compileTimeDecl.returnType;
+ TypeBinding rPrime = compileTimeDecl.isConstructor() ? compileTimeDecl.declaringClass : compileTimeDecl.returnType.capture(inferenceContext.scope, reference.sourceStart(), reference.sourceEnd());
if (rPrime.id == TypeIds.T_void)
return FALSE;
return ConstraintTypeFormula.create(rPrime, r, COMPATIBLE, this.isSoft);
@@ -366,7 +352,7 @@
if (returnType == TypeBinding.VOID)
throw new InferenceFailureException("expression has no value"); //$NON-NLS-1$
- if (inferenceContext.usesUncheckedConversion()) {
+ if (inferenceContext.usesUncheckedConversion) {
// spec says erasure, but we don't really have compatibility rules for erasure, use raw type instead:
TypeBinding erasure = inferenceContext.environment.convertToRawType(returnType, false);
ConstraintTypeFormula newConstraint = ConstraintTypeFormula.create(erasure, targetType, COMPATIBLE);
@@ -384,17 +370,28 @@
ParameterizedTypeBinding gbeta = inferenceContext.environment.createParameterizedType(
parameterizedType.genericType(), betas, parameterizedType.enclosingType(), parameterizedType.getTypeAnnotations());
inferenceContext.currentBounds.captures.put(gbeta, parameterizedType); // established: both types have nonnull arguments
+ if (InferenceContext18.SHOULD_WORKAROUND_BUG_JDK_8054721) {
+ parameterizedType = parameterizedType.capture(inferenceContext.scope, invocationSite.sourceStart(), invocationSite.sourceEnd());
+ arguments = parameterizedType.arguments;
+ for (int i = 0, length = arguments.length; i < length; i++) {
+ if (arguments[i].isCapture() && arguments[i].isProperType(true)) {
+ CaptureBinding capture = (CaptureBinding) arguments[i];
+ inferenceContext.currentBounds.addBound(new TypeBound(betas[i], capture, SAME), inferenceContext.environment);
+ }
+ }
+ }
ConstraintTypeFormula newConstraint = ConstraintTypeFormula.create(gbeta, targetType, COMPATIBLE);
return inferenceContext.reduceAndIncorporate(newConstraint);
}
- if (rTheta instanceof InferenceVariable) {
- InferenceVariable alpha = (InferenceVariable) rTheta;
+ if (rTheta.leafComponentType() instanceof InferenceVariable) { // https://bugs.openjdk.java.net/browse/JDK-8062082
+ InferenceVariable alpha = (InferenceVariable) rTheta.leafComponentType();
+ TypeBinding targetLeafType = targetType.leafComponentType();
boolean toResolve = false;
- if (inferenceContext.currentBounds.condition18_5_2_bullet_3_3_1(alpha, targetType)) {
+ if (inferenceContext.currentBounds.condition18_5_2_bullet_3_3_1(alpha, targetLeafType)) {
toResolve = true;
- } else if (inferenceContext.currentBounds.condition18_5_2_bullet_3_3_2(alpha, targetType, inferenceContext)) {
+ } else if (inferenceContext.currentBounds.condition18_5_2_bullet_3_3_2(alpha, targetLeafType, inferenceContext)) {
toResolve = true;
- } else if (targetType.isPrimitiveType()) {
+ } else if (targetLeafType.isPrimitiveType()) {
TypeBinding wrapper = inferenceContext.currentBounds.findWrapperTypeBound(alpha);
if (wrapper != null)
toResolve = true;
@@ -403,7 +400,10 @@
BoundSet solution = inferenceContext.solve(new InferenceVariable[]{alpha});
if (solution == null)
return false;
- TypeBinding u = solution.getInstantiation(alpha, null).capture(inferenceContext.scope, invocationSite.sourceStart()); // TODO make position unique?
+ TypeBinding u = solution.getInstantiation(alpha, null).capture(inferenceContext.scope, invocationSite.sourceStart(), invocationSite.sourceEnd());
+ if (rTheta.dimensions() != 0) {
+ u = inferenceContext.environment.createArrayType(u, rTheta.dimensions());
+ }
ConstraintTypeFormula newConstraint = ConstraintTypeFormula.create(u, targetType, COMPATIBLE);
return inferenceContext.reduceAndIncorporate(newConstraint);
}
@@ -435,18 +435,10 @@
if (sam.returnType != TypeBinding.VOID) {
// ii)
final TypeBinding r = sam.returnType;
- LambdaExpression resolved = lambda.getResolvedCopyForInferenceTargeting(this.right);
- Statement body = resolved != null ? resolved.body() : lambda.body();
- if (body instanceof Expression) {
- variables.addAll(new ConstraintExpressionFormula((Expression) body, r, COMPATIBLE).inputVariables(context));
- } else {
- // TODO: should I use LambdaExpression.resultExpressions? (is currently private).
- body.traverse(new ASTVisitor() {
- public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
- variables.addAll(new ConstraintExpressionFormula(returnStatement.expression, r, COMPATIBLE).inputVariables(context));
- return false;
- }
- }, (BlockScope)null);
+ LambdaExpression resolved = lambda.resolveExpressionExpecting(this.right, context.scope, context);
+ Expression[] resultExpressions = resolved != null ? resolved.resultExpressions() : null;
+ for (int i = 0, length = resultExpressions == null ? 0 : resultExpressions.length; i < length; i++) {
+ variables.addAll(new ConstraintExpressionFormula(resultExpressions[i], r, COMPATIBLE).inputVariables(context));
}
}
return variables;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
index 23efb02..c469bf6 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java
@@ -30,26 +30,6 @@
public abstract Object reduce(InferenceContext18 inferenceContext) throws InferenceFailureException;
- /** 5.3: compatibility check which includes the option of boxing/unboxing. */
- protected boolean isCompatibleWithInLooseInvocationContext(TypeBinding one, TypeBinding two, InferenceContext18 context) {
- if (one.isCompatibleWith(two, context.scope))
- return true;
- if (one.isBaseType() == two.isBaseType()) // this also protects against comparing null & primitive
- return false;
- if (one.isPrimitiveType()) {
- if (!two.isBaseType()) {
- TypeBinding boxingType = context.environment.computeBoxingType(one);
- if (boxingType != one) //$IDENTITY-COMPARISON$ just checking if boxing could help
- return boxingType.isCompatibleWith(two, context.scope);
- }
- } else if (two.isPrimitiveType()) {
- TypeBinding boxingType = context.environment.computeBoxingType(two);
- if (boxingType != two) //$IDENTITY-COMPARISON$ just checking if boxing could help
- return one.isCompatibleWith(boxingType, context.scope);
- }
- return false;
- }
-
Collection<InferenceVariable> inputVariables(InferenceContext18 context) {
return EMPTY_VARIABLE_LIST;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
index d7d5122..00900fc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2015 GK Software AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Invocation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
/**
@@ -60,15 +61,17 @@
case COMPATIBLE:
// 18.2.2:
if (this.left.isProperType(true) && this.right.isProperType(true)) {
- if (isCompatibleWithInLooseInvocationContext(this.left, this.right, inferenceContext))
- return TRUE;
- return FALSE;
+ return this.left.isCompatibleWith(this.right, inferenceContext.scope) || this.left.isBoxingCompatibleWith(this.right, inferenceContext.scope) ? TRUE : FALSE;
}
if (this.left.isPrimitiveType()) {
+ if (inferenceContext.inferenceKind == InferenceContext18.CHECK_STRICT)
+ inferenceContext.inferenceKind = InferenceContext18.CHECK_LOOSE;
TypeBinding sPrime = inferenceContext.environment.computeBoxingType(this.left);
return ConstraintTypeFormula.create(sPrime, this.right, COMPATIBLE, this.isSoft);
}
if (this.right.isPrimitiveType()) {
+ if (inferenceContext.inferenceKind == InferenceContext18.CHECK_STRICT)
+ inferenceContext.inferenceKind = InferenceContext18.CHECK_LOOSE;
TypeBinding tPrime = inferenceContext.environment.computeBoxingType(this.right);
return ConstraintTypeFormula.create(this.left, tPrime, SAME, this.isSoft);
}
@@ -96,6 +99,9 @@
// 18.2.3:
return reduceSubType(inferenceContext.scope, this.right, this.left);
case SAME:
+ if (inferenceContext.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled)
+ if (!checkIVFreeTVmatch(this.left, this.right))
+ checkIVFreeTVmatch(this.right, this.left);
// 18.2.4:
return reduceTypeEquality(inferenceContext.object);
case TYPE_ARGUMENT_CONTAINED:
@@ -143,6 +149,16 @@
}
}
+ /** Detect when we are equating an inference variable against a free type variable. */
+ boolean checkIVFreeTVmatch(TypeBinding one, TypeBinding two) {
+ if (one instanceof InferenceVariable && two.isTypeVariable() && (two.tagBits & TagBits.AnnotationNullMASK) == 0) {
+ // found match => avoid inferring any null annotation (by marking as contradiction):
+ ((InferenceVariable)one).nullHints = TagBits.AnnotationNullMASK;
+ return true;
+ }
+ return false;
+ }
+
private Object reduceTypeEquality(TypeBinding object) {
// 18.2.4
if (this.left.kind() == Binding.WILDCARD_TYPE) {
@@ -304,13 +320,21 @@
case Binding.INTERSECTION_TYPE:
superCandidate = ((WildcardBinding) superCandidate).allBounds();
//$FALL-THROUGH$
- case Binding.INTERSECTION_CAST_TYPE:
- TypeBinding[] intersectingTypes = ((IntersectionCastTypeBinding) superCandidate).intersectingTypes;
+ case Binding.INTERSECTION_TYPE18:
+ TypeBinding[] intersectingTypes = ((IntersectionTypeBinding18) superCandidate).intersectingTypes;
ConstraintFormula[] result = new ConstraintFormula[intersectingTypes.length];
for (int i = 0; i < intersectingTypes.length; i++) {
result[i] = ConstraintTypeFormula.create(subCandidate, intersectingTypes[i], SUBTYPE, this.isSoft);
}
return result;
+ case Binding.POLY_TYPE:
+ PolyTypeBinding poly = (PolyTypeBinding) superCandidate;
+ Invocation invocation = (Invocation) poly.expression;
+ MethodBinding binding = invocation.binding();
+ if (binding == null || !binding.isValidBinding())
+ return FALSE;
+ TypeBinding returnType = binding.isConstructor() ? binding.declaringClass : binding.returnType;
+ return reduceSubType(scope, subCandidate, returnType.capture(scope, invocation.sourceStart(), invocation.sourceEnd()));
}
throw new IllegalStateException("Unexpected RHS "+superCandidate); //$NON-NLS-1$
}
@@ -347,7 +371,7 @@
return true;
if (!(cb instanceof ParameterizedTypeBinding)) {
// if C is parameterized with its own type variables, there're no more constraints to be created here, otherwise let's fail
- return isInsignificantParameterized(ca);
+ return ca.isParameterizedWithOwnVariables();
}
TypeBinding[] bi = ((ParameterizedTypeBinding) cb).arguments;
if (cb.isRawType() || bi == null || bi.length == 0)
@@ -357,20 +381,11 @@
return true;
}
- private boolean isInsignificantParameterized(ParameterizedTypeBinding ca) {
- TypeVariableBinding[] typeVariables = ca.original().typeVariables();
- TypeBinding[] typeArguments = ca.arguments;
- if (typeVariables == null || typeArguments == null)
- return typeVariables == typeArguments;
- if (typeVariables.length != typeArguments.length)
- return false;
- for (int i = 0; i < typeArguments.length; i++) {
- if (TypeBinding.notEquals(typeVariables[i], typeArguments[i]))
- return false;
- }
- return true;
+ public boolean equalsEquals (ConstraintTypeFormula that) {
+ return (that != null && this.relation == that.relation && this.isSoft == that.isSoft &&
+ TypeBinding.equalsEquals(this.left, that.left) && TypeBinding.equalsEquals(this.right, that.right));
}
-
+
public boolean applySubstitution(BoundSet solutionSet, InferenceVariable[] variables) {
super.applySubstitution(solutionSet, variables);
for (int i=0; i<variables.length; i++) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
index d8e211e..4285990 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/FieldBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,15 +11,20 @@
* bug 185682 - Increment/decrement operators mark local variables as read
* bug 331649 - [compiler][null] consider null annotations for fields
* Bug 417295 - [1.8[[null] Massage type annotated null analysis to gel well with deep encoded type bindings.
+ * Bug 447088 - [null] @Nullable on fully qualified field type is ignored
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 458396 - NPE in CodeStream.invoke()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
+import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
public class FieldBinding extends VariableBinding {
public ReferenceBinding declaringClass;
@@ -226,16 +231,29 @@
return fieldConstant;
}
+public Constant constant(Scope scope) {
+ if (this.constant != null)
+ return this.constant;
+ ProblemReporter problemReporter = scope.problemReporter();
+ IErrorHandlingPolicy suspendedPolicy = problemReporter.suspendTempErrorHandlingPolicy();
+ try {
+ return constant();
+ } finally {
+ problemReporter.resumeTempErrorHandlingPolicy(suspendedPolicy);
+ }
+}
+
public void fillInDefaultNonNullness(FieldDeclaration sourceField, Scope scope) {
LookupEnvironment environment = scope.environment();
if ( this.type != null
&& !this.type.isBaseType()
- && (this.tagBits & TagBits.AnnotationNullMASK) == 0)
+ && (this.tagBits & TagBits.AnnotationNullMASK) == 0 // declaration annotation?
+ && (this.type.tagBits & TagBits.AnnotationNullMASK) == 0) // type annotation? (java.lang.@Nullable String)
{
- if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_8)
- this.tagBits |= TagBits.AnnotationNonNull;
- else
+ if (environment.usesNullTypeAnnotations())
this.type = environment.createAnnotatedType(this.type, new AnnotationBinding[]{environment.getNonNullAnnotation()});
+ else
+ this.tagBits |= TagBits.AnnotationNonNull;
} else if ((this.tagBits & TagBits.AnnotationNonNull) != 0) {
scope.problemReporter().nullAnnotationIsRedundant(sourceField);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
index ff0742a..8357c74 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ImplicitNullAnnotationVerifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2014 GK Software AG, IBM Corporation and others.
+ * Copyright (c) 2012, 2015 GK Software AG, IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,7 +21,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching.CheckMode;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
/**
@@ -75,11 +74,11 @@
if (currentType.id == TypeIds.T_JavaLangObject) {
return;
}
- long sourceLevel = scope.compilerOptions().sourceLevel;
+ boolean usesTypeAnnotations = scope.environment().usesNullTypeAnnotations();
boolean needToApplyReturnNonNullDefault =
- currentMethod.hasNonNullDefaultFor(Binding.DefaultLocationReturnType, sourceLevel >= ClassFileConstants.JDK1_8);
+ currentMethod.hasNonNullDefaultFor(Binding.DefaultLocationReturnType, usesTypeAnnotations);
boolean needToApplyParameterNonNullDefault =
- currentMethod.hasNonNullDefaultFor(Binding.DefaultLocationParameter, sourceLevel >= ClassFileConstants.JDK1_8);
+ currentMethod.hasNonNullDefaultFor(Binding.DefaultLocationParameter, usesTypeAnnotations);
boolean needToApplyNonNullDefault = needToApplyReturnNonNullDefault | needToApplyParameterNonNullDefault;
// compatibility & inheritance do not consider constructors / static methods:
boolean isInstanceMethod = !currentMethod.isConstructor() && !currentMethod.isStatic();
@@ -113,7 +112,7 @@
// recurse to prepare currentSuper
checkImplicitNullAnnotations(currentSuper, null, false, scope); // TODO (stephan) complain=true if currentSuper is source method??
}
- checkNullSpecInheritance(currentMethod, srcMethod, needToApplyReturnNonNullDefault, needToApplyParameterNonNullDefault, complain, currentSuper, scope, inheritedNonNullnessInfos);
+ checkNullSpecInheritance(currentMethod, srcMethod, needToApplyReturnNonNullDefault, needToApplyParameterNonNullDefault, complain, currentSuper, null, scope, inheritedNonNullnessInfos);
needToApplyNonNullDefault = false;
}
@@ -127,7 +126,7 @@
tagBits = TagBits.AnnotationNullable;
}
if (tagBits != 0) {
- if (sourceLevel < ClassFileConstants.JDK1_8) {
+ if (!usesTypeAnnotations) {
currentMethod.tagBits |= tagBits;
} else {
if (!currentMethod.returnType.isBaseType()) {
@@ -141,7 +140,7 @@
info = inheritedNonNullnessInfos[i+1];
if (!info.complained && info.inheritedNonNullness != null) {
Argument currentArg = srcMethod == null ? null : srcMethod.arguments[i];
- if (sourceLevel < ClassFileConstants.JDK1_8)
+ if (!usesTypeAnnotations)
recordArgNonNullness(currentMethod, paramLen, i, currentArg, info.inheritedNonNullness);
else
recordArgNonNullness18(currentMethod, i, currentArg, info.inheritedNonNullness, scope.environment());
@@ -150,7 +149,7 @@
}
if (needToApplyNonNullDefault) {
- if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8)
+ if (!usesTypeAnnotations)
currentMethod.fillInDefaultNonNullness(srcMethod);
else
currentMethod.fillInDefaultNonNullness18(srcMethod, scope.environment());
@@ -193,16 +192,18 @@
{
MethodBinding [] ifcMethods = superType.getMethods(selector, suggestedParameterLength);
int length = ifcMethods.length;
+ boolean added = false;
for (int i=0; i<length; i++) {
MethodBinding currentMethod = ifcMethods[i];
if (currentMethod.isStatic())
continue;
if (MethodVerifier.doesMethodOverride(original, currentMethod, this.environment)) {
result.add(currentMethod);
- return; // at most one method is overridden from any supertype
+ added = true; // when overriding one or more methods from superType don't traverse to transitive superTypes
}
}
- findAllOverriddenMethods(original, selector, suggestedParameterLength, superType, ifcsSeen, result);
+ if (!added)
+ findAllOverriddenMethods(original, selector, suggestedParameterLength, superType, ifcsSeen, result);
}
/**
@@ -214,6 +215,7 @@
* @param shouldComplain should we report any errors found?
* (see also comment about flows into this method, below).
* @param inheritedMethod one overridden method from a super type
+ * @param allInheritedMethods look here to see if nonnull-unannotated conflict already exists in one super type
* @param scope provides context for error reporting etc.
* @param inheritedNonNullnessInfos if non-null, this array of non-null elements is used for
* interim recording of nullness information from inheritedMethod rather than prematurely updating currentMethod.
@@ -221,7 +223,7 @@
*/
void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclaration srcMethod,
boolean hasReturnNonNullDefault, boolean hasParameterNonNullDefault, boolean shouldComplain,
- MethodBinding inheritedMethod, Scope scope, InheritedNonNullnessInfo[] inheritedNonNullnessInfos)
+ MethodBinding inheritedMethod, MethodBinding[] allInheritedMethods, Scope scope, InheritedNonNullnessInfo[] inheritedNonNullnessInfos)
{
// Note that basically two different flows lead into this method:
// (1) during MethodVerifyer15.checkMethods() we want to report errors (against srcMethod or against the current type)
@@ -237,7 +239,7 @@
// TODO (stephan): even here we may need to report problems? How to discriminate?
this.buddyImplicitNullAnnotationsVerifier.checkImplicitNullAnnotations(inheritedMethod, null, false, scope);
}
- boolean useTypeAnnotations = this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean useTypeAnnotations = this.environment.usesNullTypeAnnotations();
long inheritedNullnessBits = getReturnTypeNullnessTagBits(inheritedMethod, useTypeAnnotations);
long currentNullnessBits = getReturnTypeNullnessTagBits(currentMethod, useTypeAnnotations);
@@ -294,7 +296,8 @@
}
if (NullAnnotationMatching.analyse(inheritedMethod.returnType, currentMethod.returnType, substituteReturnType, 0, CheckMode.OVERRIDE).isAnyMismatch()) {
if (srcMethod != null)
- scope.problemReporter().illegalReturnRedefinition(srcMethod, inheritedMethod, null);
+ scope.problemReporter().illegalReturnRedefinition(srcMethod, inheritedMethod,
+ this.environment.getNonNullAnnotationName());
else
scope.problemReporter().cannotImplementIncompatibleNullness(currentMethod, inheritedMethod, useTypeAnnotations);
return;
@@ -325,6 +328,7 @@
else if (currentMethod.parameterNonNullness != null)
length = currentMethod.parameterNonNullness.length;
+ parameterLoop:
for (int i = 0; i < length; i++) {
if (currentMethod.parameters[i].isBaseType()) continue;
@@ -405,6 +409,12 @@
continue;
} else if (inheritedNonNullNess == Boolean.TRUE) {
// not strictly a conflict, but a configurable warning is given anyway:
+ if (allInheritedMethods != null) {
+ // avoid this optional warning if the conflict already existed in one supertype (merging of two methods into one?)
+ for (MethodBinding one : allInheritedMethods)
+ if (TypeBinding.equalsEquals(inheritedMethod.declaringClass, one.declaringClass) && getParameterNonNullness(one, i, useTypeAnnotations) != Boolean.TRUE)
+ continue parameterLoop;
+ }
scope.problemReporter().parameterLackingNonnullAnnotation(
currentArgument,
inheritedMethod.declaringClass,
@@ -427,12 +437,12 @@
}
void applyReturnNullBits(MethodBinding method, long nullnessBits) {
- if (this.environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_8) {
- method.tagBits |= nullnessBits;
- } else {
+ if (this.environment.usesNullTypeAnnotations()) {
if (!method.returnType.isBaseType()) {
method.returnType = this.environment.createAnnotatedType(method.returnType, this.environment.nullAnnotationsFromTagBits(nullnessBits));
}
+ } else {
+ method.tagBits |= nullnessBits;
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
index ef84cea..d8b5649 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG, and others.
+ * Copyright (c) 2013, 2015 GK Software AG, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,16 +23,12 @@
import java.util.Set;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FunctionalExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Invocation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.Sorting;
@@ -82,11 +78,11 @@
* <dt>18.5.1 Invocation Applicability Inference</dt>
* <dd>{@link #inferInvocationApplicability(MethodBinding, TypeBinding[], boolean)}. Prepare the initial state for
* inference of a generic invocation - no target type used at this point.
- * Need to call {@link #solve()} afterwards to produce the intermediate result.<br/>
+ * Need to call {@link #solve(boolean)} with true afterwards to produce the intermediate result.<br/>
* Called indirectly from {@link Scope#findMethod(ReferenceBinding, char[], TypeBinding[], InvocationSite, boolean)} et al
* to select applicable methods into overload resolution.</dd>
* <dt>18.5.2 Invocation Type Inference</dt>
- * <dd>{@link InferenceContext18#inferInvocationType(BoundSet, TypeBinding, InvocationSite, MethodBinding)}. After a
+ * <dd>{@link InferenceContext18#inferInvocationType(TypeBinding, InvocationSite, MethodBinding)}. After a
* most specific method has been picked, and given a target type determine the final generic instantiation.
* As long as a target type is still unavailable this phase keeps getting deferred.</br>
* Different wrappers exist for the convenience of different callers.</dd>
@@ -95,41 +91,9 @@
* <dt>18.5.4 More Specific Method Inference</dt>
* <dd><em>Not Yet Implemented</em></dd>
* </dl>
- * For 18.5.1 and 18.5.2 some high-level control is implemented in
- * {@link ParameterizedGenericMethodBinding#computeCompatibleMethod(MethodBinding, TypeBinding[], Scope, InvocationSite, int)}.
+ * For 18.5.1 and 18.5.2 high-level control is implemented in
+ * {@link ParameterizedGenericMethodBinding#computeCompatibleMethod(MethodBinding, TypeBinding[], Scope, InvocationSite)}.
* <h2>Inference Lifecycle</h2>
- * The separation into 18.5.1 and 18.5.2 causes some complexity:
- * <ul>
- * <li>Calling both parts of inference is directly interwoven with overload resolution. See
- * {@link ParameterizedGenericMethodBinding#computeCompatibleMethod(MethodBinding, TypeBinding[], Scope, InvocationSite, int)
- * PGMB#computeCompatibleMethod()} for the basic <b>protocol</b>.</li>
- * <li>Intermediate <b>state</b> regarding inference must be stored between both phases. Inference is performed with different
- * inputs for each pair of {@link Invocation} x {@link ParameterizedGenericMethodBinding},
- * see {@link Invocation#registerInferenceContext(ParameterizedGenericMethodBinding, InferenceContext18) Invocation.registerInferenceContext()} and
- * {@link Invocation#getInferenceContext(ParameterizedMethodBinding) getInferenceContext()}.<br/>
- * As part of the lifecycle state, each instance of InferenceContext18 remembers the current {@link #inferenceKind}
- * and {@link #stepCompleted}.</li>
- * <li><b>Nested inference/resolving</b>: If an invocation argument is a poly expression itself, final resolving of the argument can only happened
- * after Invocation Type Inference regarding the outer invocation. Outer inference must produce the <b>target type</b> that drives
- * the inner inference / resolving. Two different protocols are applied:
- * <ul>
- * <li>If the inner poly expression is an invocation, inner inference is directly incorporated into
- * the {@link #currentBounds}, see block inside {@link ConstraintExpressionFormula#reduce(InferenceContext18)}.<br/>
- * In this case the results of the combined inference need to be applied to all contained inner invocations,
- * which happens in {@link #rebindInnerPolies(BoundSet, TypeBinding[])}, which must be called whenever
- * 18.5.2 finishes.</li>
- * <li>If the inner poly expression is a functional expression or a conditional expression no inference variables
- * exist representing the inner. In this case the final target type is pushed into the inner using
- * {@link Expression#checkAgainstFinalTargetType(TypeBinding, Scope)}, which, too, is called from
- * {@link #rebindInnerPolies(BoundSet, TypeBinding[])}.</li>
- * <li>For recursively pushing target types into arguments of an invocation
- * method {@link ASTNode#resolvePolyExpressionArguments(Invocation, MethodBinding, TypeBinding[], Scope)} exists,
- * which is called in two situations: (1) for non-generic outer invocations from MessageSend#findMethodBinding() and
- * Statement#findConstructorBinding(); (2) for generic outer invocations from {@link #rebindInnerPolies(BoundSet, TypeBinding[])}.</li>
- * <li>In some situations invocation arguments that are poly invocations need to be resolved in the middle of overload resolution
- * to answer {@link Scope#parameterCompatibilityLevel18} (where the outer invocation did not involve any inference).<br/>
- * </ul>
- * Pushing inference results into an inner invocation happens using {@link Invocation#updateBindings(MethodBinding,TypeBinding)}.</li>
* <li>Decision whether or not an invocation is a <b>variable-arity</b> invocation is made by first attempting
* to solve 18.5.1 in mode {@link #CHECK_LOOSE}. Only if that fails, another attempt is made in mode {@link #CHECK_VARARG}.
* Which of these two attempts was successful is stored in {@link #inferenceKind}.
@@ -141,6 +105,12 @@
/** to conform with javac regarding https://bugs.openjdk.java.net/browse/JDK-8026527 */
static final boolean SIMULATE_BUG_JDK_8026527 = true;
+
+ /** Temporary workaround until we know fully what to do with https://bugs.openjdk.java.net/browse/JDK-8054721
+ * It looks likely that we have a bug independent of this JLS bug in that we clear the capture bounds eagerly.
+ */
+ static final boolean SHOULD_WORKAROUND_BUG_JDK_8054721 = true; // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=437444#c24 onwards
+
/**
* Detail flag to control the extent of {@link #SIMULATE_BUG_JDK_8026527}.
* A setting of 'false' implements the advice from http://mail.openjdk.java.net/pipermail/lambda-spec-experts/2013-December/000447.html
@@ -158,19 +128,14 @@
/** The inference variables for which as solution is sought. */
InferenceVariable[] inferenceVariables;
- /** Number of inference variables. */
- int variableCount = 0;
+
/** Constraints that have not yet been reduced and incorporated. */
ConstraintFormula[] initialConstraints;
+ ConstraintExpressionFormula[] finalConstraints; // for final revalidation at a "macroscopic" level
+
/** The accumulated type bounds etc. */
BoundSet currentBounds;
- /** solution of applicability inference, stored for use as fallback, if invocation type inference fails. */
- BoundSet storedSolution;
-
- /** For each candidate target type imposed from the outside store the solution of invocation type inference. */
- Map<TypeBinding,Solution> solutionsPerTargetType = new HashMap<TypeBinding, Solution>();
-
/** One of CHECK_STRICT, CHECK_LOOSE, or CHECK_VARARGS. */
int inferenceKind;
/** Marks how much work has been done so far? Used to avoid performing any of these tasks more than once. */
@@ -181,24 +146,43 @@
public static final int APPLICABILITY_INFERRED = 1;
/** Invocation Type Inference (18.5.2) has been completed (for some target type). */
public static final int TYPE_INFERRED = 2;
- /** All nested elements have been fully resolved. */
- public static final int BINDINGS_UPDATED = 3;
/** Signals whether any type compatibility makes use of unchecked conversion. */
public List<ConstraintFormula> constraintsWithUncheckedConversion;
-
- // ---
-
- /** Inner poly invocations which have been included in this inference. */
- List<InvocationSite> innerPolies = new ArrayList<InvocationSite>();
- /** Link to an outer inference context, used for bundled error reporting. */
+ public boolean usesUncheckedConversion;
public InferenceContext18 outerContext;
- private ArrayList<MethodBinding> problemMethods;
-
Scope scope;
LookupEnvironment environment;
ReferenceBinding object; // java.lang.Object
+ public BoundSet b2;
+ // InferenceVariable interning:
+ private InferenceVariable[] internedVariables;
+
+ private InferenceVariable getInferenceVariable(TypeBinding typeParameter, int rank, InvocationSite site) {
+ InferenceContext18 outermostContext = this.environment.currentInferenceContext;
+ if (outermostContext == null)
+ outermostContext = this;
+ int i = 0;
+ InferenceVariable[] interned = outermostContext.internedVariables;
+ if (interned == null) {
+ outermostContext.internedVariables = new InferenceVariable[10];
+ } else {
+ int len = interned.length;
+ for (i = 0; i < len; i++) {
+ InferenceVariable var = interned[i];
+ if (var == null)
+ break;
+ if (var.typeParameter == typeParameter && var.rank == rank && var.site == site) //$IDENTITY-COMPARISON$
+ return var;
+ }
+ if (i >= len)
+ System.arraycopy(interned, 0, outermostContext.internedVariables = new InferenceVariable[len+10], 0, len);
+ }
+ return outermostContext.internedVariables[i] = new InferenceVariable(typeParameter, rank, i, site, this.environment, this.object);
+ }
+
+ public static final int CHECK_UNKNOWN = 0;
public static final int CHECK_STRICT = 1;
public static final int CHECK_LOOSE = 2;
public static final int CHECK_VARARG = 3;
@@ -208,33 +192,24 @@
Expression[] invocationArguments;
InferenceVariable[] inferenceVariables;
int inferenceKind;
- SuspendedInferenceRecord(InvocationSite site, Expression[] invocationArguments, InferenceVariable[] inferenceVariables, int inferenceKind) {
+ boolean usesUncheckedConversion;
+ SuspendedInferenceRecord(InvocationSite site, Expression[] invocationArguments, InferenceVariable[] inferenceVariables, int inferenceKind, boolean usesUncheckedConversion) {
this.site = site;
this.invocationArguments = invocationArguments;
this.inferenceVariables = inferenceVariables;
this.inferenceKind = inferenceKind;
+ this.usesUncheckedConversion = usesUncheckedConversion;
}
}
- /** Record for a candidate solution of Invocation Type Inference for one specific target type. */
- static class Solution {
- TypeBinding resolvedType;
- MethodBinding method;
- BoundSet bounds;
- Solution(MethodBinding method, BoundSet bounds) {
- this.method = method;
- this.resolvedType = method.isConstructor() ? method.declaringClass : method.returnType;
- this.bounds = bounds;
- }
- }
-
/** Construct an inference context for an invocation (method/constructor). */
- public InferenceContext18(Scope scope, Expression[] arguments, InvocationSite site) {
+ public InferenceContext18(Scope scope, Expression[] arguments, InvocationSite site, InferenceContext18 outerContext) {
this.scope = scope;
this.environment = scope.environment();
this.object = scope.getJavaLangObject();
this.invocationArguments = arguments;
this.currentInvocation = site;
+ this.outerContext = outerContext;
}
public InferenceContext18(Scope scope) {
@@ -264,31 +239,35 @@
* Substitute any type variables mentioned in 'type' by the corresponding inference variable, if one exists.
*/
public TypeBinding substitute(TypeBinding type) {
- InferenceSubstitution inferenceSubstitution = new InferenceSubstitution(this.environment, this.inferenceVariables);
+ InferenceSubstitution inferenceSubstitution = new InferenceSubstitution(this);
return inferenceSubstitution.substitute(inferenceSubstitution, type);
}
/** JLS 18.5.1: compute bounds from formal and actual parameters. */
public void createInitialConstraintsForParameters(TypeBinding[] parameters, boolean checkVararg, TypeBinding varArgsType, MethodBinding method) {
- // TODO discriminate strict vs. loose invocations
if (this.invocationArguments == null)
return;
int len = checkVararg ? parameters.length - 1 : Math.min(parameters.length, this.invocationArguments.length);
int maxConstraints = checkVararg ? this.invocationArguments.length : len;
int numConstraints = 0;
+ boolean ownConstraints;
if (this.initialConstraints == null) {
this.initialConstraints = new ConstraintFormula[maxConstraints];
+ ownConstraints = true;
} else {
numConstraints = this.initialConstraints.length;
maxConstraints += numConstraints;
System.arraycopy(this.initialConstraints, 0,
this.initialConstraints=new ConstraintFormula[maxConstraints], 0, numConstraints);
+ ownConstraints = false; // these are lifted from a nested poly expression.
}
for (int i = 0; i < len; i++) {
+ TypeBinding thetaF = substitute(parameters[i]);
if (this.invocationArguments[i].isPertinentToApplicability(parameters[i], method)) {
- TypeBinding thetaF = substitute(parameters[i]);
this.initialConstraints[numConstraints++] = new ConstraintExpressionFormula(this.invocationArguments[i], thetaF, ReductionResult.COMPATIBLE, ARGUMENT_CONSTRAINTS_ARE_SOFT);
- }
+ } else if (!isTypeVariableOfCandidate(parameters[i], method)) {
+ this.initialConstraints[numConstraints++] = new ConstraintExpressionFormula(this.invocationArguments[i], thetaF, ReductionResult.POTENTIALLY_COMPATIBLE);
+ } // else we know it is potentially compatible, no need to assert.
}
if (checkVararg && varArgsType instanceof ArrayBinding) {
varArgsType = ((ArrayBinding)varArgsType).elementsType();
@@ -296,13 +275,31 @@
for (int i = len; i < this.invocationArguments.length; i++) {
if (this.invocationArguments[i].isPertinentToApplicability(varArgsType, method)) {
this.initialConstraints[numConstraints++] = new ConstraintExpressionFormula(this.invocationArguments[i], thetaF, ReductionResult.COMPATIBLE, ARGUMENT_CONSTRAINTS_ARE_SOFT);
- }
+ } else if (!isTypeVariableOfCandidate(varArgsType, method)) {
+ this.initialConstraints[numConstraints++] = new ConstraintExpressionFormula(this.invocationArguments[i], thetaF, ReductionResult.POTENTIALLY_COMPATIBLE);
+ } // else we know it is potentially compatible, no need to assert.
}
}
if (numConstraints == 0)
this.initialConstraints = ConstraintFormula.NO_CONSTRAINTS;
else if (numConstraints < maxConstraints)
System.arraycopy(this.initialConstraints, 0, this.initialConstraints = new ConstraintFormula[numConstraints], 0, numConstraints);
+ if (ownConstraints) { // lifted constraints get validated at their own context.
+ final int length = this.initialConstraints.length;
+ System.arraycopy(this.initialConstraints, 0, this.finalConstraints = new ConstraintExpressionFormula[length], 0, length);
+ }
+ }
+
+ private boolean isTypeVariableOfCandidate(TypeBinding type, MethodBinding candidate) {
+ // cf. FunctionalExpression.isPertinentToApplicability()
+ if (type instanceof TypeVariableBinding) {
+ Binding declaringElement = ((TypeVariableBinding) type).declaringElement;
+ if (declaringElement == candidate)
+ return true;
+ if (candidate.isConstructor() && declaringElement == candidate.declaringClass)
+ return true;
+ }
+ return false;
}
private InferenceVariable[] addInitialTypeVariableSubstitutions(TypeBinding[] typeVariables) {
@@ -314,7 +311,7 @@
}
InferenceVariable[] newVariables = new InferenceVariable[len];
for (int i = 0; i < len; i++)
- newVariables[i] = new InferenceVariable(typeVariables[i], this.variableCount++, this.currentInvocation, this.environment, this.object);
+ newVariables[i] = getInferenceVariable(typeVariables[i], i, this.currentInvocation);
if (this.inferenceVariables == null || this.inferenceVariables.length == 0) {
this.inferenceVariables = newVariables;
} else {
@@ -337,7 +334,7 @@
newVariables[i] = (InferenceVariable) typeVariables[i]; // prevent double substitution of an already-substituted inferenceVariable
else
toAdd[numToAdd++] =
- newVariables[i] = new InferenceVariable(typeVariables[i], this.variableCount++, this.currentInvocation, this.environment, this.object);
+ newVariables[i] = getInferenceVariable(typeVariables[i], i, this.currentInvocation);
}
if (numToAdd > 0) {
int start = 0;
@@ -372,18 +369,14 @@
}
/** JLS 18.5.2 Invocation Type Inference
- * <p>Callers are responsible for any post-processing (see {@link #rebindInnerPolies(BoundSet, TypeBinding[])}).</p>
- * @param b1 "the bound set produced by reduction in order to demonstrate that m is applicable in 18.5.1"
*/
- public BoundSet inferInvocationType(BoundSet b1, TypeBinding expectedType, InvocationSite invocationSite, MethodBinding method)
- throws InferenceFailureException
+ public BoundSet inferInvocationType(TypeBinding expectedType, InvocationSite invocationSite, MethodBinding method) throws InferenceFailureException
{
// not JLS: simply ensure that null hints from the return type have been seen even in standalone contexts:
if (expectedType == null && method.returnType != null)
substitute(method.returnType); // result is ignore, the only effect is on InferenceVariable.nullHints
- //
- BoundSet previous = this.currentBounds.copy();
- this.currentBounds = b1;
+
+ this.currentBounds = this.b2.copy();
try {
// bullets 1&2: definitions only.
if (expectedType != null
@@ -398,9 +391,9 @@
}
// 4. bullet: assemble C:
Set<ConstraintFormula> c = new HashSet<ConstraintFormula>();
- if (!addConstraintsToC(this.invocationArguments, c, method, this.inferenceKind))
+ if (!addConstraintsToC(this.invocationArguments, c, method, this.inferenceKind, false, invocationSite))
return null;
- // 5. bullet: determine B3 from C
+ // 5. bullet: determine B4 from C
while (!c.isEmpty()) {
// *
Set<ConstraintFormula> bottomSet = findBottomSet(c, allOutputVariables(c));
@@ -439,7 +432,7 @@
// 6. bullet: solve
BoundSet solution = solve();
if (solution == null || !isResolved(solution)) {
- this.currentBounds = previous; // don't let bounds from unsuccessful attempt leak into subsequent attempts
+ this.currentBounds = this.b2; // don't let bounds from unsuccessful attempt leak into subsequent attempts
return null;
}
// we're done, start reporting:
@@ -450,7 +443,9 @@
}
}
- private boolean addConstraintsToC(Expression[] exprs, Set<ConstraintFormula> c, MethodBinding method, int inferenceKindForMethod) {
+ private boolean addConstraintsToC(Expression[] exprs, Set<ConstraintFormula> c, MethodBinding method, int inferenceKindForMethod, boolean interleaved, InvocationSite site)
+ throws InferenceFailureException
+ {
TypeBinding[] fs;
if (exprs != null) {
int k = exprs.length;
@@ -470,136 +465,99 @@
}
for (int i = 0; i < k; i++) {
TypeBinding fsi = fs[Math.min(i, p-1)];
- TypeBinding substF = substitute(fsi);
- if (!addConstraintsToC_OneExpr(exprs[i], c, fsi, substF, method))
+ InferenceSubstitution inferenceSubstitution = new InferenceSubstitution(this.environment, this.inferenceVariables, site);
+ TypeBinding substF = inferenceSubstitution.substitute(inferenceSubstitution,fsi);
+ if (!addConstraintsToC_OneExpr(exprs[i], c, fsi, substF, method, interleaved))
return false;
}
}
return true;
}
- private boolean addConstraintsToC_OneExpr(Expression expri, Set<ConstraintFormula> c, TypeBinding fsi, TypeBinding substF, MethodBinding method) {
+ private boolean addConstraintsToC_OneExpr(Expression expri, Set<ConstraintFormula> c, TypeBinding fsi, TypeBinding substF, MethodBinding method, boolean interleaved)
+ throws InferenceFailureException
+ {
// For all i (1 ≤ i ≤ k), if ei is not pertinent to applicability, the set contains ⟨ei → θ Fi⟩.
if (!expri.isPertinentToApplicability(fsi, method)) {
c.add(new ConstraintExpressionFormula(expri, substF, ReductionResult.COMPATIBLE, ARGUMENT_CONSTRAINTS_ARE_SOFT));
}
if (expri instanceof FunctionalExpression) {
c.add(new ConstraintExceptionFormula((FunctionalExpression) expri, substF));
- } else if (expri instanceof Invocation && expri.isPolyExpression()) {
- Invocation invocation = (Invocation) expri;
- MethodBinding innerMethod = invocation.binding(null, false, null);
- if (innerMethod instanceof ParameterizedGenericMethodBinding) {
- InferenceContext18 innerCtx = invocation.getInferenceContext((ParameterizedMethodBinding) innerMethod);
- if (innerCtx != null) { // otherwise innerMethod does not participate in inference
- return addConstraintsToC(invocation.arguments(), c, innerMethod.genericMethod(), innerCtx.inferenceKind);
+ if (expri instanceof LambdaExpression) {
+ // https://bugs.openjdk.java.net/browse/JDK-8038747
+ LambdaExpression lambda = (LambdaExpression) expri;
+ BlockScope skope = lambda.enclosingScope;
+ if (substF.isFunctionalInterface(skope)) { // could be an inference variable.
+ ReferenceBinding t = (ReferenceBinding) substF;
+ ParameterizedTypeBinding withWildCards = InferenceContext18.parameterizedWithWildcard(t);
+ if (withWildCards != null) {
+ t = ConstraintExpressionFormula.findGroundTargetType(this, skope, lambda, withWildCards);
+ }
+ MethodBinding functionType;
+ if (t != null && (functionType = t.getSingleAbstractMethod(skope, true)) != null && (lambda = lambda.resolveExpressionExpecting(t, this.scope, this)) != null) {
+ TypeBinding r = functionType.returnType;
+ Expression[] resultExpressions = lambda.resultExpressions();
+ for (int i = 0, length = resultExpressions == null ? 0 : resultExpressions.length; i < length; i++) {
+ Expression resultExpression = resultExpressions[i];
+ if (!addConstraintsToC_OneExpr(resultExpression, c, r.original(), r, method, true))
+ return false;
+ }
+ }
}
}
+ } else if (expri instanceof Invocation && expri.isPolyExpression()) {
+
+ if (substF.isProperType(true)) // https://bugs.openjdk.java.net/browse/JDK-8052325
+ return true;
+
+ Invocation invocation = (Invocation) expri;
+ MethodBinding innerMethod = invocation.binding();
+ if (innerMethod == null)
+ return true; // -> proceed with no new C set elements.
+
+ Expression[] arguments = invocation.arguments();
+ TypeBinding[] argumentTypes = arguments == null ? Binding.NO_PARAMETERS : new TypeBinding[arguments.length];
+ for (int i = 0; i < argumentTypes.length; i++)
+ argumentTypes[i] = arguments[i].resolvedType;
+ int applicabilityKind;
+ InferenceContext18 innerContext = null;
+ if (innerMethod instanceof ParameterizedGenericMethodBinding)
+ innerContext = invocation.getInferenceContext((ParameterizedGenericMethodBinding) innerMethod);
+ applicabilityKind = innerContext != null ? innerContext.inferenceKind : getInferenceKind(innerMethod, argumentTypes);
+
+ if (interleaved) {
+ MethodBinding shallowMethod = innerMethod.shallowOriginal();
+ SuspendedInferenceRecord prevInvocation = enterPolyInvocation(invocation, arguments);
+ try {
+ this.inferenceKind = applicabilityKind;
+ if (innerContext != null)
+ innerContext.outerContext = this;
+ inferInvocationApplicability(shallowMethod, argumentTypes, shallowMethod.isConstructor());
+ if (!ConstraintExpressionFormula.inferPolyInvocationType(this, invocation, substF, shallowMethod))
+ return false;
+ } finally {
+ resumeSuspendedInference(prevInvocation);
+ }
+ }
+ return addConstraintsToC(arguments, c, innerMethod.genericMethod(), applicabilityKind, interleaved, invocation);
} else if (expri instanceof ConditionalExpression) {
ConditionalExpression ce = (ConditionalExpression) expri;
- return addConstraintsToC_OneExpr(ce.valueIfTrue, c, fsi, substF, method)
- && addConstraintsToC_OneExpr(ce.valueIfFalse, c, fsi, substF, method);
+ return addConstraintsToC_OneExpr(ce.valueIfTrue, c, fsi, substF, method, interleaved)
+ && addConstraintsToC_OneExpr(ce.valueIfFalse, c, fsi, substF, method, interleaved);
}
return true;
}
- /**
- * Simplified API to perform Invocation Type Inference (JLS 18.5.2)
- * and perform subsequent steps: bound check, rebinding of inner poly expressions,
- * and creating of a problem method binding if needed.
- * Should only be called if the inference has not yet finished.
- * @param invocation invocation being inferred
- * @param argumentTypes arguments being passed into the invocation
- * @param method current candidate method binding for this invocation
- * @return a valid method binding with updated type parameters,
- * or a problem method binding signaling either inference failure or a bound mismatch.
- */
- /*@NonNull*/ MethodBinding inferInvocationType(Invocation invocation, TypeBinding[] argumentTypes, ParameterizedGenericMethodBinding method) {
- // TODO optimize: if outerContext exists and is resolved, we probably don't need to infer again.
- TypeBinding targetType = invocation.invocationTargetType();
- ParameterizedGenericMethodBinding finalMethod = null;
- ParameterizedGenericMethodBinding methodToCheck = method;
-
- boolean haveProperTargetType = targetType != null && targetType.isProperType(true);
- if (haveProperTargetType || !invocation.getExpressionContext().definesTargetType()) {
- MethodBinding original = method.originalMethod;
- Solution solution = this.solutionsPerTargetType.get(targetType);
- BoundSet result = solution != null ? solution.bounds : null;
- if (result == null) {
- // start over from a previous candidate but discard its type variable instantiations
- // TODO: should we retain any instantiations of type variables not owned by the method?
- try {
- result = inferInvocationType(this.currentBounds, targetType, invocation, original);
- } catch (InferenceFailureException e) {
- // no solution, but do more checks below
- }
- }
- if (result != null) {
- TypeBinding[] solutions = getSolutions(original.typeVariables(), invocation, result);
- if (solutions != null) {
- finalMethod = this.environment.createParameterizedGenericMethod(original, solutions);
- if (this.scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled)
- NullAnnotationMatching.checkForContraditions(finalMethod, invocation, this.scope);
- invocation.registerInferenceContext(finalMethod, this);
- this.solutionsPerTargetType.put(targetType, new Solution(finalMethod, result));
- }
- }
- if (finalMethod != null)
- methodToCheck = finalMethod;
- } else {
- finalMethod = method;
+
+ protected int getInferenceKind(MethodBinding nonGenericMethod, TypeBinding[] argumentTypes) {
+ switch (this.scope.parameterCompatibilityLevel(nonGenericMethod, argumentTypes)) {
+ case Scope.AUTOBOX_COMPATIBLE:
+ return CHECK_LOOSE;
+ case Scope.VARARGS_COMPATIBLE:
+ return CHECK_VARARG;
+ default:
+ return CHECK_STRICT;
}
-
- MethodBinding problemMethod = methodToCheck.boundCheck18(this.scope, argumentTypes);
- if (problemMethod != null)
- return problemMethod;
-
- if (!haveProperTargetType && invocation.getExpressionContext().definesTargetType())
- return method; // still not ready!
-
- if (finalMethod != null) {
- if (rebindInnerPolies(finalMethod, invocation))
- return finalMethod;
- }
- return getReturnProblemMethodIfNeeded(targetType, method);
- }
-
- /**
- * Simplified API to perform Invocation Type Inference (JLS 18.5.2)
- * and perform subsequent steps: bound check, rebinding of inner poly expressions,
- * and creating of a problem method binding if needed.
- * Should only be called if the inference has not yet finished.
- * Version used for inner invocations, where argument types need to be extracted
- * from actual invocation arguments.
- * @param invocation invocation being inferred
- * @param method current candidate method binding for this invocation
- * @return a valid method binding with updated type parameters,
- * or a problem method binding signaling either inference failure or a bound mismatch.
- */
- public /*@NonNull*/ MethodBinding inferInvocationType(Invocation invocation, ParameterizedGenericMethodBinding method) {
- TypeBinding[] argumentTypes = null;
- Expression[] arguments = invocation.arguments();
- if (arguments != null) {
- argumentTypes = new TypeBinding[arguments.length];
- for (int i = 0; i < arguments.length; i++)
- argumentTypes[i] = arguments[i].resolvedType;
- }
- return inferInvocationType(invocation, argumentTypes, method);
- }
-
- public boolean hasResultFor(TypeBinding targetType) {
- if (targetType == null)
- return this.stepCompleted >= TYPE_INFERRED;
- else
- return this.solutionsPerTargetType.containsKey(targetType);
- }
-
- public boolean registerSolution(TypeBinding targetType, MethodBinding updatedBinding) {
- Solution solution = this.solutionsPerTargetType.get(targetType);
- if (solution != null)
- return false; // no update
- this.solutionsPerTargetType.put(targetType, new Solution(updatedBinding, null));
- this.stepCompleted = Math.max(this.stepCompleted, TYPE_INFERRED);
- return true;
}
/**
@@ -617,7 +575,7 @@
TypeBinding[] a = targetTypeWithWildCards.arguments; // a is not-null by construction of parameterizedWithWildcard()
TypeBinding[] aprime = getFunctionInterfaceArgumentSolutions(a);
// TODO If F<A'1, ..., A'm> is a well-formed type, ...
- return blockScope.environment().createParameterizedType(genericType, aprime, genericType.enclosingType());
+ return blockScope.environment().createParameterizedType(genericType, aprime, targetTypeWithWildCards.enclosingType());
}
}
return targetTypeWithWildCards;
@@ -729,8 +687,8 @@
// "... none of the following is true:"
if (siSuperI(si, funcI) || siSubI(si, funcI))
return null;
- if (si instanceof IntersectionCastTypeBinding) {
- TypeBinding[] elements = ((IntersectionCastTypeBinding)si).intersectingTypes;
+ if (si instanceof IntersectionTypeBinding18) {
+ TypeBinding[] elements = ((IntersectionTypeBinding18)si).intersectingTypes;
checkSuper: {
for (int i = 0; i < elements.length; i++)
if (!siSuperI(elements[i], funcI))
@@ -742,7 +700,7 @@
return null; // some element of the intersection is a subinterface of I, or a parameterization of a subinterface of I.
}
// all passed, time to do some work:
- TypeBinding siCapture = si.capture(this.scope, this.captureId++);
+ TypeBinding siCapture = si.capture(this.scope, expri.sourceStart, expri.sourceEnd);
MethodBinding sam = siCapture.getSingleAbstractMethod(this.scope, false); // no wildcards should be left needing replacement
TypeBinding[] u = sam.parameters;
TypeBinding r1 = sam.isConstructor() ? sam.declaringClass : sam.returnType;
@@ -792,19 +750,19 @@
}
return reduceAndIncorporate(ConstraintTypeFormula.create(r1, r2, ReductionResult.SUBTYPE));
} else if (expri instanceof ReferenceExpression && ((ReferenceExpression)expri).isExactMethodReference()) {
+ ReferenceExpression reference = (ReferenceExpression) expri;
for (int i = 0; i < u.length; i++) {
- ReferenceExpression reference = (ReferenceExpression) expri;
if (!reduceAndIncorporate(ConstraintTypeFormula.create(u[i], v[i], ReductionResult.SAME)))
return false;
- if (r2.id == TypeIds.T_void)
- return true;
- MethodBinding method = reference.findCompileTimeMethodTargeting(null, this.scope); // TODO directly access exactMethodBinding!
- TypeBinding returnType = method.isConstructor() ? method.declaringClass : method.returnType;
- if (r1.isPrimitiveType() && !r2.isPrimitiveType() && returnType.isPrimitiveType())
- return true;
- if (r2.isPrimitiveType() && !r1.isPrimitiveType() && !returnType.isPrimitiveType())
- return true;
}
+ if (r2.id == TypeIds.T_void)
+ return true;
+ MethodBinding method = reference.getExactMethod();
+ TypeBinding returnType = method.isConstructor() ? method.declaringClass : method.returnType;
+ if (r1.isPrimitiveType() && !r2.isPrimitiveType() && returnType.isPrimitiveType())
+ return true;
+ if (r2.isPrimitiveType() && !r1.isPrimitiveType() && !returnType.isPrimitiveType())
+ return true;
return reduceAndIncorporate(ConstraintTypeFormula.create(r1, r2, ReductionResult.SUBTYPE));
} else if (expri instanceof ConditionalExpression) {
ConditionalExpression cond = (ConditionalExpression) expri;
@@ -845,13 +803,35 @@
* @return a bound set representing the solution, or null if inference failed
* @throws InferenceFailureException a compile error has been detected during inference
*/
- public /*@Nullable*/ BoundSet solve() throws InferenceFailureException {
+ public /*@Nullable*/ BoundSet solve(boolean inferringApplicability) throws InferenceFailureException {
+
if (!reduce())
return null;
if (!this.currentBounds.incorporate(this))
return null;
+ if (inferringApplicability)
+ this.b2 = this.currentBounds.copy(); // Preserve the result after reduction, without effects of resolve() for later use in invocation type inference.
- return resolve(this.inferenceVariables);
+ BoundSet solution = resolve(this.inferenceVariables);
+
+ /* If inferring applicability make a final pass over the initial constraints preserved as final constraints to make sure they hold true at a macroscopic level.
+ See https://bugs.eclipse.org/bugs/show_bug.cgi?id=426537#c55 onwards.
+ */
+ if (inferringApplicability && solution != null && this.finalConstraints != null) {
+ for (ConstraintExpressionFormula constraint: this.finalConstraints) {
+ if (constraint.left.isPolyExpression())
+ continue; // avoid redundant re-inference, inner poly's own constraints get validated in its own context & poly invocation type inference proved compatibility against target.
+ constraint.applySubstitution(solution, this.inferenceVariables);
+ if (!this.currentBounds.reduceOneConstraint(this, constraint)) {
+ return null;
+ }
+ }
+ }
+ return solution;
+ }
+
+ public /*@Nullable*/ BoundSet solve() throws InferenceFailureException {
+ return solve(false);
}
public /*@Nullable*/ BoundSet solve(InferenceVariable[] toResolve) throws InferenceFailureException {
@@ -868,11 +848,14 @@
* @throws InferenceFailureException
*/
private boolean reduce() throws InferenceFailureException {
- if (this.initialConstraints != null) {
- for (int i = 0; i < this.initialConstraints.length; i++) {
- if (!this.currentBounds.reduceOneConstraint(this, this.initialConstraints[i]))
- return false;
- }
+ // Caution: This can be reentered recursively even as an earlier call is munching through the constraints !
+ for (int i = 0; this.initialConstraints != null && i < this.initialConstraints.length; i++) {
+ final ConstraintFormula currentConstraint = this.initialConstraints[i];
+ if (currentConstraint == null)
+ continue;
+ this.initialConstraints[i] = null;
+ if (!this.currentBounds.reduceOneConstraint(this, currentConstraint))
+ return false;
}
this.initialConstraints = null;
return true;
@@ -900,11 +883,18 @@
public TypeBinding /*@Nullable*/[] getSolutions(TypeVariableBinding[] typeParameters, InvocationSite site, BoundSet boundSet) {
int len = typeParameters.length;
TypeBinding[] substitutions = new TypeBinding[len];
+ InferenceVariable[] outerVariables = null;
+ if (this.outerContext != null && this.outerContext.stepCompleted < TYPE_INFERRED)
+ outerVariables = this.outerContext.inferenceVariables;
for (int i = 0; i < typeParameters.length; i++) {
for (int j = 0; j < this.inferenceVariables.length; j++) {
InferenceVariable variable = this.inferenceVariables[j];
if (variable.site == site && TypeBinding.equalsEquals(variable.typeParameter, typeParameters[i])) {
- substitutions[i] = boundSet.getInstantiation(variable, this.environment);
+ TypeBinding outerVar = null;
+ if (outerVariables != null && (outerVar = boundSet.getEquivalentOuterVariable(variable, outerVariables)) != null)
+ substitutions[i] = outerVar;
+ else
+ substitutions[i] = boundSet.getInstantiation(variable, this.environment);
break;
}
}
@@ -971,7 +961,7 @@
} else if (glbs.length == 1) {
glb = glbs[0];
} else {
- IntersectionCastTypeBinding intersection = new IntersectionCastTypeBinding(glbs, this.environment);
+ IntersectionTypeBinding18 intersection = (IntersectionTypeBinding18) this.environment.createIntersectionType18(glbs);
if (!ReferenceBinding.isConsistentIntersection(intersection.intersectingTypes)) {
tmpBoundSet = prevBoundSet; // clean up
break variables; // and start over
@@ -993,6 +983,7 @@
final CaptureBinding18[] zs = new CaptureBinding18[numVars];
for (int j = 0; j < numVars; j++)
zs[j] = freshCapture(variables[j]);
+ final BoundSet kurrentBoundSet = tmpBoundSet;
Substitution theta = new Substitution() {
public LookupEnvironment environment() {
return InferenceContext18.this.environment;
@@ -1004,6 +995,16 @@
for (int j = 0; j < numVars; j++)
if (TypeBinding.equalsEquals(variables[j], typeVariable))
return zs[j];
+ /* If we have an instantiation, lower it to the instantiation. We don't want downstream abstractions to be confused about multiple versions of bounds without
+ and with instantiations propagated by incorporation. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=430686. There is no value whatsoever in continuing
+ to speak in two tongues. Also fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=425031.
+ */
+ if (typeVariable instanceof InferenceVariable) {
+ InferenceVariable inferenceVariable = (InferenceVariable) typeVariable;
+ TypeBinding instantiation = kurrentBoundSet.getInstantiation(inferenceVariable, null);
+ if (instantiation != null)
+ return instantiation;
+ }
return typeVariable;
}
};
@@ -1013,7 +1014,6 @@
// add lower bounds:
TypeBinding[] lowerBounds = tmpBoundSet.lowerBounds(variable, true/*onlyProper*/);
if (lowerBounds != Binding.NO_TYPES) {
- lowerBounds = Scope.substitute(theta, lowerBounds);
TypeBinding lub = this.scope.lowerUpperBound(lowerBounds);
if (lub != TypeBinding.VOID && lub != null)
zsj.lowerBound = lub;
@@ -1063,9 +1063,10 @@
private CaptureBinding18 freshCapture(InferenceVariable variable) {
int id = this.captureId++;
char[] sourceName = CharOperation.concat("Z".toCharArray(), '#', String.valueOf(id).toCharArray(), '-', variable.sourceName); //$NON-NLS-1$
- int position = this.currentInvocation != null ? this.currentInvocation.sourceStart() : 0;
+ int start = this.currentInvocation != null ? this.currentInvocation.sourceStart() : 0;
+ int end = this.currentInvocation != null ? this.currentInvocation.sourceEnd() : 0;
return new CaptureBinding18(this.scope.enclosingSourceType(), sourceName, variable.typeParameter.shortReadableName(),
- position, id, this.environment);
+ start, end, id, this.environment);
}
// === ===
@@ -1361,21 +1362,20 @@
}
public SuspendedInferenceRecord enterPolyInvocation(InvocationSite invocation, Expression[] innerArguments) {
- SuspendedInferenceRecord record = new SuspendedInferenceRecord(this.currentInvocation, this.invocationArguments, this.inferenceVariables, this.inferenceKind);
+ SuspendedInferenceRecord record = new SuspendedInferenceRecord(this.currentInvocation, this.invocationArguments, this.inferenceVariables, this.inferenceKind, this.usesUncheckedConversion);
this.inferenceVariables = null;
this.invocationArguments = innerArguments;
this.currentInvocation = invocation;
-
- // schedule for re-binding the inner after inference success:
- this.innerPolies.add(invocation);
+ this.usesUncheckedConversion = false;
return record;
}
public SuspendedInferenceRecord enterLambda(LambdaExpression lambda) {
- SuspendedInferenceRecord record = new SuspendedInferenceRecord(this.currentInvocation, this.invocationArguments, this.inferenceVariables, this.inferenceKind);
+ SuspendedInferenceRecord record = new SuspendedInferenceRecord(this.currentInvocation, this.invocationArguments, this.inferenceVariables, this.inferenceKind, this.usesUncheckedConversion);
this.inferenceVariables = null;
this.invocationArguments = null;
this.currentInvocation = null;
+ this.usesUncheckedConversion = false;
return record;
}
@@ -1395,130 +1395,7 @@
this.currentInvocation = record.site;
this.invocationArguments = record.invocationArguments;
this.inferenceKind = record.inferenceKind;
- }
-
- public boolean rebindInnerPolies(MethodBinding method, InvocationSite site) {
- BoundSet bounds = this.currentBounds;
- TypeBinding targetType = site.invocationTargetType();
- if (targetType == null || !targetType.isProperType(true)) {
- if (!site.getExpressionContext().definesTargetType()) {
- // in this case we may not yet have the solution(?, get or compute it now:
- Solution solution = this.solutionsPerTargetType.get(targetType);
- try {
- if (solution != null && solution.bounds != null)
- bounds = solution.bounds;
- else
- bounds = inferInvocationType(this.currentBounds, null, site, method.shallowOriginal());
- } catch (InferenceFailureException e) {
- return false;
- }
- if (bounds == null)
- return false;
- }
- } else {
- Solution solution = this.solutionsPerTargetType.get(targetType);
- if (solution != null && solution.bounds != null)
- bounds = solution.bounds;
- }
- rebindInnerPolies(bounds, method.parameters);
- return true;
- }
-
- /**
- * After inference has finished, iterate all inner poly expressions (Invocations), that
- * have been included in the inference. For each of these update some type information
- * from the inference result and perhaps trigger follow-up resolving as needed.
- * Similar for poly expressions that did not directly participate in the inference
- * but are direct arguments of the current invocation (FunctionalExpression, ConditionalExpression).
- */
- public void rebindInnerPolies(BoundSet bounds, TypeBinding[] parameterTypes) {
- // This updates all remaining poly expressions that are direct arguments of the current invocation:
- // (handles FunctionalExpression & ConditionalExpression)
- boolean isVarargs = this.inferenceKind == CHECK_VARARG;
- acceptPendingPolyArguments(bounds, parameterTypes, isVarargs);
- // This loops over all poly expressions for which a sub-inference was triggered:
- // (handles generic invocations)
- int len = this.innerPolies.size();
- for (int i = 0; i < len; i++) {
- Expression inner = (Expression) this.innerPolies.get(i);
- if (inner instanceof Invocation) {
- Invocation innerMessage = (Invocation) inner;
- TypeBinding innerTargetType = inner.expectedType(); // may be set from acceptPendingPolyArguments
- if (innerTargetType != null && !innerTargetType.isProperType(true))
- innerTargetType = null;
- MethodBinding binding = innerMessage.binding(innerTargetType, innerTargetType != null, this.scope);
- if (binding == null)
- continue;
- MethodBinding original = binding.shallowOriginal();
-
- // apply inference results onto the allocation type of inner diamonds:
- if (original.isConstructor() && inner.isPolyExpression()) {
- ReferenceBinding declaringClass = original.declaringClass;
- TypeBinding[] arguments = getSolutions(declaringClass.typeVariables(), innerMessage, bounds);
- declaringClass = this.environment.createParameterizedType(declaringClass, arguments, declaringClass.enclosingType());
- original = ((ParameterizedTypeBinding)declaringClass).createParameterizedMethod(original);
- inner.checkAgainstFinalTargetType(innerTargetType, this.scope);
- if (this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled)
- NullAnnotationMatching.checkForContraditions(original, innerMessage, this.scope);
- }
-
- // apply results of the combined inference onto the binding of the inner invocation:
- TypeBinding[] solutions = getSolutions(original.typeVariables(), innerMessage, bounds);
- if (solutions == null) {
- if (binding instanceof ParameterizedGenericMethodBinding) {
- InferenceContext18 innerCtx = innerMessage.getInferenceContext((ParameterizedGenericMethodBinding) binding);
- if (innerCtx != null && !binding.isValidBinding()) {
- innerCtx.reportInvalidInvocation(innerMessage, binding);
- }
- }
- continue; // inner inference not requested -> not a problem
- }
- ParameterizedGenericMethodBinding innerBinding = this.environment.createParameterizedGenericMethod(original, solutions);
-
- if (innerMessage.updateBindings(innerBinding, innerTargetType)) { // only if we are actually improving anything
- ASTNode.resolvePolyExpressionArguments(innerMessage, innerBinding, this.scope);
- }
- }
- }
- this.stepCompleted = BINDINGS_UPDATED; // we're done-done
- }
-
- private void acceptPendingPolyArguments(BoundSet acceptedResult, TypeBinding[] parameterTypes, boolean isVarArgs) {
- if (acceptedResult == null || this.invocationArguments == null) return;
- Substitution substitution = getResultSubstitution(acceptedResult);
- for (int i = 0; i < this.invocationArguments.length; i++) {
- TypeBinding targetType = getParameter(parameterTypes, i, isVarArgs);
- if (!targetType.isProperType(true))
- targetType = Scope.substitute(substitution, targetType);
- Expression expression = this.invocationArguments[i];
- if (expression instanceof Invocation) {
- Invocation invocation = (Invocation) expression;
- if (!this.innerPolies.contains(invocation)) {
- MethodBinding method = invocation.binding(targetType, true, this.scope);
- if (method instanceof ParameterizedGenericMethodBinding) {
- ParameterizedGenericMethodBinding previousBinding = (ParameterizedGenericMethodBinding) method;
- InferenceContext18 innerCtx = invocation.getInferenceContext(previousBinding);
- if (innerCtx != null) {
- // we have a non-poly generic invocation, which needs inference but is not connected via innerPolis.
- // Finish that inner inference now (incl. binding updates):
- MethodBinding innerBinding = innerCtx.inferInvocationType(invocation, previousBinding);
- if (!innerBinding.isValidBinding()) {
- innerCtx.reportInvalidInvocation(invocation, innerBinding);
- }
- if (invocation.updateBindings(innerBinding, targetType)) { // only if we are actually improving anything
- ASTNode.resolvePolyExpressionArguments(invocation, innerBinding, this.scope);
- }
- }
- } else if(method instanceof ParameterizedMethodBinding){
- expression.checkAgainstFinalTargetType(targetType, this.scope);
- }
- } else {
- expression.setExpectedType(targetType);
- }
- } else {
- expression.checkAgainstFinalTargetType(targetType, this.scope);
- }
- }
+ this.usesUncheckedConversion = record.usesUncheckedConversion;
}
private Substitution getResultSubstitution(final BoundSet result) {
@@ -1566,21 +1443,16 @@
if (method.returnType.erasure().isCompatibleWith(expectedType))
return method; // don't count as problem.
}
- if (expectedType == null)
- return method; // assume inference failure concerned another expression
- ProblemMethodBinding problemMethod = new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ParameterizedMethodExpectedTypeProblem);
+ /* We used to check if expected type is null and if so return method, but that is wrong - it injects an incompatible method into overload resolution.
+ if we get here with expected type set to null at all, the target context does not define a target type (vanilla context), so inference has done its
+ best and nothing more to do than to signal error.
+ */
+ ProblemMethodBinding problemMethod = new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.InvocationTypeInferenceFailure);
problemMethod.returnType = expectedType;
problemMethod.inferenceContext = this;
return problemMethod;
}
- public void reportInvalidInvocation(Invocation invocation, MethodBinding binding) {
- if (invocation instanceof MessageSend)
- this.scope.problemReporter().invalidMethod((MessageSend) invocation, binding);
- else
- this.scope.problemReporter().invalidConstructor((Statement)invocation, binding);
- }
-
// debugging:
public String toString() {
StringBuffer buf = new StringBuffer("Inference Context"); //$NON-NLS-1$
@@ -1588,7 +1460,6 @@
case NOT_INFERRED: buf.append(" (initial)");break; //$NON-NLS-1$
case APPLICABILITY_INFERRED: buf.append(" (applicability inferred)");break; //$NON-NLS-1$
case TYPE_INFERRED: buf.append(" (type inferred)");break; //$NON-NLS-1$
- case BINDINGS_UPDATED: buf.append(" (bindings updated)");break; //$NON-NLS-1$
}
switch (this.inferenceKind) {
case CHECK_STRICT: buf.append(" (strict)");break; //$NON-NLS-1$
@@ -1620,12 +1491,6 @@
return buf.toString();
}
- public void addProblemMethod(ProblemMethodBinding problemMethod) {
- if (this.problemMethods == null)
- this.problemMethods = new ArrayList<MethodBinding>();
- this.problemMethods.add(problemMethod);
- }
-
/**
* If 'type' is a parameterized type and one of its arguments is a wildcard answer the casted type, else null.
* A nonnull answer is ensured to also have nonnull arguments.
@@ -1662,6 +1527,7 @@
if (this.constraintsWithUncheckedConversion == null)
this.constraintsWithUncheckedConversion = new ArrayList<ConstraintFormula>();
this.constraintsWithUncheckedConversion.add(constraint);
+ this.usesUncheckedConversion = true;
}
void reportUncheckedConversions(BoundSet solution) {
@@ -1697,4 +1563,57 @@
public static void missingImplementation(String msg) {
throw new UnsupportedOperationException(msg);
}
+
+ public void forwardResults(BoundSet result, Invocation invocation, ParameterizedMethodBinding pmb, TypeBinding targetType) {
+ if (targetType != null)
+ invocation.registerResult(targetType, pmb);
+ Expression[] arguments = invocation.arguments();
+ for (int i = 0, length = arguments == null ? 0 : arguments.length; i < length; i++) {
+ Expression [] expressions = arguments[i].getPolyExpressions();
+ for (int j = 0, jLength = expressions.length; j < jLength; j++) {
+ Expression expression = expressions[j];
+ if (!(expression instanceof Invocation))
+ continue;
+ Invocation polyInvocation = (Invocation) expression;
+ MethodBinding binding = polyInvocation.binding();
+ if (binding == null || !binding.isValidBinding())
+ continue;
+ ParameterizedMethodBinding methodSubstitute = null;
+ if (binding instanceof ParameterizedGenericMethodBinding) {
+ MethodBinding shallowOriginal = binding.shallowOriginal();
+ TypeBinding[] solutions = getSolutions(shallowOriginal.typeVariables(), polyInvocation, result);
+ if (solutions == null) // in CEF.reduce, we lift inner poly expressions into outer context only if their target type has inference variables.
+ continue;
+ methodSubstitute = this.environment.createParameterizedGenericMethod(shallowOriginal, solutions);
+ } else {
+ if (!binding.isConstructor() || !(binding instanceof ParameterizedMethodBinding))
+ continue; // throw ISE ?
+ MethodBinding shallowOriginal = binding.shallowOriginal();
+ ReferenceBinding genericType = shallowOriginal.declaringClass;
+ TypeBinding[] solutions = getSolutions(genericType.typeVariables(), polyInvocation, result);
+ if (solutions == null) // in CEF.reduce, we lift inner poly expressions into outer context only if their target type has inference variables.
+ continue;
+ ParameterizedTypeBinding parameterizedType = this.environment.createParameterizedType(genericType, solutions, binding.declaringClass.enclosingType());
+ for (MethodBinding parameterizedMethod : parameterizedType.methods()) {
+ if (parameterizedMethod.original() == shallowOriginal) {
+ methodSubstitute = (ParameterizedMethodBinding) parameterizedMethod;
+ break;
+ }
+ }
+ }
+ if (methodSubstitute == null || !methodSubstitute.isValidBinding())
+ continue;
+ boolean variableArity = pmb.isVarargs();
+ final TypeBinding[] parameters = pmb.parameters;
+ if (variableArity && parameters.length == arguments.length && i == length - 1) {
+ TypeBinding returnType = methodSubstitute.returnType.capture(this.scope, expression.sourceStart, expression.sourceEnd);
+ if (returnType.isCompatibleWith(parameters[parameters.length - 1], this.scope)) {
+ variableArity = false;
+ }
+ }
+ TypeBinding parameterType = InferenceContext18.getParameter(parameters, i, variableArity);
+ forwardResults(result, polyInvocation, methodSubstitute, parameterType);
+ }
+ }
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java
index b1f9929..62672c2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceSubstitution.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2015 GK Software AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,12 +17,18 @@
private LookupEnvironment environment;
private InferenceVariable[] variables;
+ private InvocationSite site;
- public InferenceSubstitution(LookupEnvironment environment, InferenceVariable[] variables) {
+ public InferenceSubstitution(LookupEnvironment environment, InferenceVariable[] variables, InvocationSite site) {
this.environment = environment;
this.variables = variables;
+ this.site = site;
}
-
+
+ public InferenceSubstitution(InferenceContext18 context) {
+ this(context.environment, context.inferenceVariables, context.currentInvocation);
+ }
+
/**
* Override method {@link Scope.Substitutor#substitute(Substitution, TypeBinding)},
* to add substitution of types other than type variables.
@@ -30,8 +36,9 @@
public TypeBinding substitute(Substitution substitution, TypeBinding originalType) {
for (int i = 0; i < this.variables.length; i++) {
InferenceVariable variable = this.variables[i];
- if (TypeBinding.equalsEquals(getP(i), originalType)) {
- variable.nullHints |= originalType.tagBits & TagBits.AnnotationNullMASK;
+ if (this.site == variable.site && TypeBinding.equalsEquals(getP(i), originalType)) {
+ if (this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled && originalType.hasNullTypeAnnotations())
+ return this.environment.createAnnotatedType(variable.withoutToplevelNullAnnotation(), originalType.getTypeAnnotations());
return variable;
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
index adee6c8..3009003 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InferenceVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2015 GK Software AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,12 +21,16 @@
InvocationSite site;
TypeBinding typeParameter;
- long nullHints;
+ long nullHints; // one of TagBits.{AnnotationNonNull,AnnotationNullable} may steer inference into inferring nullness as well; set both bits to request avoidance.
private InferenceVariable prototype;
- public InferenceVariable(TypeBinding typeParameter, int variableRank, InvocationSite site, LookupEnvironment environment, ReferenceBinding object) {
- super(CharOperation.concat(typeParameter.shortReadableName(), Integer.toString(variableRank).toCharArray(), '#'),
- null/*declaringElement*/, variableRank, environment);
+ public InferenceVariable(TypeBinding typeParameter, int parameterRank, int iVarId, InvocationSite site, LookupEnvironment environment, ReferenceBinding object) {
+ this(typeParameter, parameterRank, site,
+ CharOperation.concat(typeParameter.shortReadableName(), Integer.toString(iVarId).toCharArray(), '#'),
+ environment, object);
+ }
+ private InferenceVariable(TypeBinding typeParameter, int parameterRank, InvocationSite site, char[] sourceName, LookupEnvironment environment, ReferenceBinding object) {
+ super(sourceName, null/*declaringElement*/, parameterRank, environment);
this.site = site;
this.typeParameter = typeParameter;
this.tagBits |= typeParameter.tagBits & TagBits.AnnotationNullMASK;
@@ -46,7 +50,7 @@
@Override
public TypeBinding clone(TypeBinding enclosingType) {
- InferenceVariable clone = new InferenceVariable(this.typeParameter, this.rank, this.site, this.environment, this.superclass);
+ InferenceVariable clone = new InferenceVariable(this.typeParameter, this.rank, this.site, this.sourceName, this.environment, this.superclass);
clone.tagBits = this.tagBits;
clone.nullHints = this.nullHints;
clone.prototype = this;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
similarity index 89%
rename from org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.java
rename to org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
index e322717..cdd6183 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionCastTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
@@ -23,13 +23,13 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-public class IntersectionCastTypeBinding extends ReferenceBinding {
+public class IntersectionTypeBinding18 extends ReferenceBinding { // abstraction used for intersection casts in Java 8 + type inference at 1.8+
public ReferenceBinding [] intersectingTypes;
private ReferenceBinding javaLangObject;
int length;
- public IntersectionCastTypeBinding(ReferenceBinding[] intersectingTypes, LookupEnvironment environment) {
+ public IntersectionTypeBinding18(ReferenceBinding[] intersectingTypes, LookupEnvironment environment) {
this.intersectingTypes = intersectingTypes;
this.length = intersectingTypes.length;
if (!intersectingTypes[0].isClass()) {
@@ -38,6 +38,20 @@
}
}
+ private IntersectionTypeBinding18(IntersectionTypeBinding18 prototype) {
+ this.intersectingTypes = prototype.intersectingTypes;
+ this.length = prototype.length;
+ if (!this.intersectingTypes[0].isClass()) {
+ this.javaLangObject = prototype.javaLangObject;
+ this.modifiers |= ClassFileConstants.AccInterface;
+ }
+ }
+
+ @Override
+ public TypeBinding clone(TypeBinding enclosingType) {
+ return new IntersectionTypeBinding18(this);
+ }
+
public MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcards) {
int index = replaceWildcards ? 0 : 1;
if (this.singleAbstractMethod != null) {
@@ -141,10 +155,10 @@
TypeBinding[] rightIntersectingTypes = null;
if (rightKind == INTERSECTION_TYPE && right.boundKind() == Wildcard.EXTENDS) {
TypeBinding allRightBounds = ((WildcardBinding) right).allBounds();
- if (allRightBounds instanceof IntersectionCastTypeBinding)
- rightIntersectingTypes = ((IntersectionCastTypeBinding) allRightBounds).intersectingTypes;
- } else if (rightKind == INTERSECTION_CAST_TYPE) {
- rightIntersectingTypes = ((IntersectionCastTypeBinding) right).intersectingTypes;
+ if (allRightBounds instanceof IntersectionTypeBinding18)
+ rightIntersectingTypes = ((IntersectionTypeBinding18) allRightBounds).intersectingTypes;
+ } else if (rightKind == INTERSECTION_TYPE18) {
+ rightIntersectingTypes = ((IntersectionTypeBinding18) right).intersectingTypes;
}
if (rightIntersectingTypes != null) {
int numRequired = rightIntersectingTypes.length;
@@ -222,11 +236,11 @@
}
return shortReadableName.toString().toCharArray();
}
- public boolean isIntersectionCastType() {
+ public boolean isIntersectionType18() {
return true;
}
public int kind() {
- return Binding.INTERSECTION_CAST_TYPE;
+ return Binding.INTERSECTION_TYPE18;
}
public String debugName() {
StringBuffer debugName = new StringBuffer(16);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
index 18c1d52..b5dce26 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
@@ -20,6 +20,7 @@
TypeBinding[] genericTypeArguments();
boolean isSuperAccess();
+ boolean isQualifiedSuper();
boolean isTypeAccess();
// in case the receiver type does not match the actual receiver type
// e.g. pkg.Type.C (receiver type of C is type of source context,
@@ -32,6 +33,9 @@
int sourceStart();
TypeBinding invocationTargetType();
boolean receiverIsImplicitThis();
+ boolean checkingPotentialCompatibility();
+ void acceptPotentiallyCompatibleMethods(MethodBinding [] methods);
+
/** When inference for this invocationSite starts, get a fresh inference context, initialized from this site. */
InferenceContext18 freshInferenceContext(Scope scope);
ExpressionContext getExpressionContext();
@@ -53,5 +57,9 @@
public boolean receiverIsImplicitThis() { return false; }
public InferenceContext18 freshInferenceContext(Scope scope) { return null; }
public ExpressionContext getExpressionContext() { return ExpressionContext.VANILLA_CONTEXT; }
+ @Override
+ public boolean isQualifiedSuper() { return false; }
+ public boolean checkingPotentialCompatibility() { return false; }
+ public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) { /* ignore */ }
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
index 4caa764..be0ce94 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalTypeBinding.java
@@ -11,6 +11,7 @@
* bug 365662 - [compiler][null] warn on contradictory and redundant null annotations
* bug 401030 - [1.8][null] Null analysis support for lambda methods.
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -78,12 +79,19 @@
// System.out.println("Adding dependency: "+ new String(scope.enclosingType().readableName()) + " --> " + new String(this.readableName()));
}
+@Override
+public MethodBinding enclosingMethod() {
+ return this.enclosingMethod;
+}
+
/*
* Returns the anonymous original super type (in some error cases, superclass may get substituted with Object)
*/
public ReferenceBinding anonymousOriginalSuperType() {
if (!isPrototype())
return ((LocalTypeBinding) this.prototype).anonymousOriginalSuperType();
+ if (this.superclass == null && this.scope != null)
+ return this.scope.getJavaLangObject();
if (this.superInterfaces != Binding.NO_SUPERINTERFACES) {
return this.superInterfaces[0];
@@ -100,13 +108,13 @@
return this.superclass; // default answer
}
-protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation[] annotations, long nullBits, boolean isJdk18) {
+protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) {
if (!isPrototype()) throw new IllegalStateException();
long outerDefault = 0;
if (this.enclosingMethod != null) {
- outerDefault = isJdk18
+ outerDefault = useNullTypeAnnotations
? this.enclosingMethod.defaultNullness
: this.enclosingMethod.tagBits & (TagBits.AnnotationNonNullByDefault|TagBits.AnnotationNullUnspecifiedByDefault);
}
@@ -116,7 +124,7 @@
}
return;
}
- super.checkRedundantNullnessDefaultRecurse(location, annotations, nullBits, isJdk18);
+ super.checkRedundantNullnessDefaultRecurse(location, annotations, nullBits, useNullTypeAnnotations);
}
public char[] computeUniqueKey(boolean isLeaf) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
index 8c7bc28..a99143c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
* bug 186342 - [compiler][null] Using annotations for null checking
* bug 365859 - [compiler][null] distinguish warnings based on flow analysis vs. null annotations
* bug 331649 - [compiler][null] consider null annotations for fields
+ * Bug 466308 - [hovering] Javadoc header for parameter is wrong with annotation-based null analysis
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -21,6 +22,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FakedTrackingVariable;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Initializer;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
@@ -76,7 +78,14 @@
/*
* declaringUniqueKey # scopeIndex(0-based) # varName [# occurrenceCount(0-based)]
- * p.X { void foo() { int local; int local;} } --> Lp/X;.foo()V#1#local#1
+ * p.X { void foo() { int local; int local;} } --> Lp/X;.foo()V#1#local#1
+ *
+ * for method parameter, we have no scopeIndex, but instead we append the parameter rank:
+ * declaringUniqueKey # varName # occurrenceCount(always 0) # argument rank (0-based)
+ * with parameter names:
+ * p.X { void foo(int i0, int i1) { } } --> Lp/X;.foo()V#i1#0#1
+ * without parameter names (see org.aspectj.org.eclipse.jdt.internal.core.util.BindingKeyResolver.SyntheticLocalVariableBinding):
+ * p.X { void foo(int i0, int i1) { } } --> Lp/X;.foo()V#arg1#0#1
*/
public char[] computeUniqueKey(boolean isLeaf) {
StringBuffer buffer = new StringBuffer();
@@ -123,11 +132,26 @@
buffer.append('#');
buffer.append(this.name);
+ boolean addParameterRank = this.isParameter() && this.declaringScope != null;
// add occurence count to avoid same key for duplicate variables
// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=149590)
- if (occurenceCount > 0) {
+ if (occurenceCount > 0 || addParameterRank) {
buffer.append('#');
buffer.append(occurenceCount);
+ if (addParameterRank) {
+ int pos = -1;
+ LocalVariableBinding[] params = this.declaringScope.locals;
+ for (int i = 0; i < params.length; i++) {
+ if (params[i] == this) {
+ pos = i;
+ break;
+ }
+ }
+ if (pos > -1) {
+ buffer.append('#');
+ buffer.append(pos);
+ }
+ }
}
int length = buffer.length();
@@ -270,4 +294,18 @@
public boolean isCatchParameter() {
return false;
}
+
+ public MethodBinding getEnclosingMethod() {
+ BlockScope blockScope = this.declaringScope;
+ if (blockScope != null) {
+ ReferenceContext referenceContext = blockScope.referenceContext();
+ if (referenceContext instanceof Initializer) {
+ return null;
+ }
+ if (referenceContext instanceof AbstractMethodDeclaration) {
+ return ((AbstractMethodDeclaration) referenceContext).binding;
+ }
+ }
+ return null;
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
index 79a9480..3dca1a5 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,6 +27,11 @@
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
* Bug 434602 - Possible error with inferred null annotations leading to contradictory null annotations
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 453475 - [1.8][null] Contradictory null annotations (4.5 M3 edition)
+ * Bug 457079 - Regression: type inference
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
+ * Bug 455180 - IllegalStateException in AnnotatableTypeSystem.getRawType
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -38,10 +43,10 @@
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFilePool;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.TypeAnnotationWalker;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.*;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ITypeRequestor;
@@ -111,6 +116,9 @@
AnnotationBinding nonNullAnnotation;
AnnotationBinding nullableAnnotation;
+ /** Global access to the outermost active inference context as the universe for inference variable interning. */
+ InferenceContext18 currentInferenceContext;
+
// AspectJ extension - raised visibility to protected on these four fields
protected final static int BUILD_FIELDS_AND_METHODS = 4;
protected final static int BUILD_TYPE_HIERARCHY = 1;
@@ -446,7 +454,7 @@
break;
case Binding.POLY_TYPE:
return ((PolyTypeBinding) type).computeBoxingType();
- case Binding.INTERSECTION_CAST_TYPE:
+ case Binding.INTERSECTION_TYPE18:
return computeBoxingType(type.getIntersectingTypes()[0]);
}
return type;
@@ -683,8 +691,8 @@
return this.typeSystem.getArrayType(leafComponentType, dimensionCount, annotations);
}
-public TypeBinding createIntersectionCastType(ReferenceBinding[] intersectingTypes) {
- return this.typeSystem.getIntersectionCastType(intersectingTypes);
+public TypeBinding createIntersectionType18(ReferenceBinding[] intersectingTypes) {
+ return this.typeSystem.getIntersectionType18(intersectingTypes);
}
public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
@@ -952,6 +960,9 @@
return this.typeSystem.getMemberType(memberType, enclosingType);
}
public ParameterizedTypeBinding createParameterizedType(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType) {
+ AnnotationBinding[] annotations = genericType.typeAnnotations;
+ if (annotations != Binding.NO_ANNOTATIONS)
+ return this.typeSystem.getParameterizedType((ReferenceBinding) genericType.unannotated(), typeArguments, enclosingType, annotations);
return this.typeSystem.getParameterizedType(genericType, typeArguments, enclosingType);
}
@@ -1002,6 +1013,9 @@
}
public RawTypeBinding createRawType(ReferenceBinding genericType, ReferenceBinding enclosingType) {
+ AnnotationBinding[] annotations = genericType.typeAnnotations;
+ if (annotations != Binding.NO_ANNOTATIONS)
+ return this.typeSystem.getRawType((ReferenceBinding) genericType.unannotated(), enclosingType, annotations);
return this.typeSystem.getRawType(genericType, enclosingType);
}
@@ -1010,9 +1024,18 @@
}
public WildcardBinding createWildcard(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind) {
+ if (genericType != null) {
+ AnnotationBinding[] annotations = genericType.typeAnnotations;
+ if (annotations != Binding.NO_ANNOTATIONS)
+ return this.typeSystem.getWildcard((ReferenceBinding) genericType.unannotated(), rank, bound, otherBounds, boundKind, annotations);
+ }
return this.typeSystem.getWildcard(genericType, rank, bound, otherBounds, boundKind);
}
+public CaptureBinding createCapturedWildcard(WildcardBinding wildcard, ReferenceBinding contextType, int start, int end, ASTNode cud, int id) {
+ return this.typeSystem.getCapturedWildcard(wildcard, contextType, start, end, cud, id);
+}
+
public WildcardBinding createWildcard(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, AnnotationBinding [] annotations) {
return this.typeSystem.getWildcard(genericType, rank, bound, otherBounds, boundKind, annotations);
}
@@ -1080,6 +1103,28 @@
return this.globalOptions.nonNullByDefaultAnnotationName;
}
+public boolean usesNullTypeAnnotations() {
+ if (this.globalOptions.useNullTypeAnnotations != null)
+ return this.globalOptions.useNullTypeAnnotations;
+
+ this.globalOptions.useNullTypeAnnotations = Boolean.FALSE;
+ if (!this.globalOptions.isAnnotationBasedNullAnalysisEnabled || this.globalOptions.sourceLevel < ClassFileConstants.JDK1_8)
+ return false;
+ ReferenceBinding nullable = this.nullableAnnotation != null ? this.nullableAnnotation.getAnnotationType() : getType(this.getNullableAnnotationName());
+ ReferenceBinding nonNull = this.nonNullAnnotation != null ? this.nonNullAnnotation.getAnnotationType() : getType(this.getNonNullAnnotationName());
+ if (nullable == null && nonNull == null)
+ return false;
+ if (nullable == null || nonNull == null)
+ return false; // TODO should report an error about inconsistent setup
+ long nullableMetaBits = nullable.getAnnotationTagBits() & TagBits.AnnotationForTypeUse;
+ long nonNullMetaBits = nonNull.getAnnotationTagBits() & TagBits.AnnotationForTypeUse;
+ if (nullableMetaBits != nonNullMetaBits)
+ return false; // TODO should report an error about inconsistent setup
+ if (nullableMetaBits == 0)
+ return false;
+ return this.globalOptions.useNullTypeAnnotations = Boolean.TRUE;
+}
+
/* Answer the top level package named name if it exists in the cache.
* Answer theNotFoundPackage if it could not be resolved the first time
* it was looked up, otherwise answer null.
@@ -1177,7 +1222,7 @@
}
private TypeBinding[] getTypeArgumentsFromSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType, ReferenceBinding genericType,
- char[][][] missingTypeNames, TypeAnnotationWalker walker)
+ char[][][] missingTypeNames, ITypeAnnotationWalker walker)
{
java.util.ArrayList args = new java.util.ArrayList(2);
int rank = 0;
@@ -1230,7 +1275,7 @@
*
* NOTE: Does NOT answer base types nor array types!
*/
-ReferenceBinding getTypeFromConstantPoolName(char[] signature, int start, int end, boolean isParameterized, char[][][] missingTypeNames, TypeAnnotationWalker walker) {
+ReferenceBinding getTypeFromConstantPoolName(char[] signature, int start, int end, boolean isParameterized, char[][][] missingTypeNames, ITypeAnnotationWalker walker) {
if (end == -1)
end = signature.length;
char[][] compoundName = CharOperation.splitOn('/', signature, start, end);
@@ -1244,14 +1289,14 @@
}
}
ReferenceBinding binding = getTypeFromCompoundName(compoundName, isParameterized, wasMissingType);
- if (walker != TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
+ if (walker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
binding = (ReferenceBinding) annotateType(binding, walker, missingTypeNames);
}
return binding;
}
ReferenceBinding getTypeFromConstantPoolName(char[] signature, int start, int end, boolean isParameterized, char[][][] missingTypeNames) {
- return getTypeFromConstantPoolName(signature, start, end, isParameterized, missingTypeNames, TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
+ return getTypeFromConstantPoolName(signature, start, end, isParameterized, missingTypeNames, ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER);
}
/* Answer the type corresponding to the signature from the binary file.
@@ -1261,7 +1306,7 @@
* NOTE: Does answer base types & array types.
*/
TypeBinding getTypeFromSignature(char[] signature, int start, int end, boolean isParameterized, TypeBinding enclosingType,
- char[][][] missingTypeNames, TypeAnnotationWalker walker)
+ char[][][] missingTypeNames, ITypeAnnotationWalker walker)
{
int dimension = 0;
while (signature[start] == '[') {
@@ -1270,7 +1315,7 @@
}
// annotations on dimensions?
AnnotationBinding [][] annotationsOnDimensions = null;
- if (dimension > 0 && walker != TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
+ if (dimension > 0 && walker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
for (int i = 0; i < dimension; i++) {
AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0), this, missingTypeNames);
if (annotations != Binding.NO_ANNOTATIONS) {
@@ -1330,7 +1375,7 @@
return binding;
}
- if (walker != TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
+ if (walker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
binding = annotateType(binding, walker, missingTypeNames);
}
@@ -1340,7 +1385,7 @@
return binding;
}
-private TypeBinding annotateType(TypeBinding binding, TypeAnnotationWalker walker, char[][][] missingTypeNames) {
+private TypeBinding annotateType(TypeBinding binding, ITypeAnnotationWalker walker, char[][][] missingTypeNames) {
int depth = binding.depth() + 1;
if (depth > 1) {
// need to count non-static nesting levels, resolved binding required for precision
@@ -1386,7 +1431,7 @@
}
public TypeBinding getTypeFromTypeSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType,
- char[][][] missingTypeNames, TypeAnnotationWalker walker)
+ char[][][] missingTypeNames, ITypeAnnotationWalker walker)
{
// TypeVariableSignature = 'T' Identifier ';'
// ArrayTypeSignature = '[' TypeSignature
@@ -1400,7 +1445,7 @@
}
// annotations on dimensions?
AnnotationBinding [][] annotationsOnDimensions = null;
- if (dimension > 0 && walker != TypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
+ if (dimension > 0 && walker != ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER) {
for (int i = 0; i < dimension; i++) {
AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0), this, missingTypeNames);
if (annotations != Binding.NO_ANNOTATIONS) {
@@ -1474,8 +1519,8 @@
return dimension == 0 ? (TypeBinding) parameterizedType : createArrayType(parameterizedType, dimension, AnnotatableTypeSystem.flattenedAnnotations(annotationsOnDimensions));
}
-private TypeBinding getTypeFromTypeVariable(TypeVariableBinding typeVariableBinding, int dimension, AnnotationBinding [][] annotationsOnDimensions, TypeAnnotationWalker walker, char [][][] missingTypeNames) {
- AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0), this, missingTypeNames);
+private TypeBinding getTypeFromTypeVariable(TypeVariableBinding typeVariableBinding, int dimension, AnnotationBinding [][] annotationsOnDimensions, ITypeAnnotationWalker walker, char [][][] missingTypeNames) {
+ AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(-1), this, missingTypeNames);
if (annotations != null && annotations != Binding.NO_ANNOTATIONS)
typeVariableBinding = (TypeVariableBinding) createAnnotatedType(typeVariableBinding, new AnnotationBinding [][] { annotations });
@@ -1492,7 +1537,7 @@
ReferenceBinding genericType,
int rank,
char[][][] missingTypeNames,
- TypeAnnotationWalker walker) {
+ ITypeAnnotationWalker walker) {
// VariantTypeSignature = '-' TypeSignature
// or '+' TypeSignature
// or TypeSignature
@@ -1502,18 +1547,18 @@
// ? super aType
wrapper.start++;
TypeBinding bound = getTypeFromTypeSignature(wrapper, staticVariables, enclosingType, missingTypeNames, walker.toWildcardBound());
- AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0), this, missingTypeNames);
+ AnnotationBinding [] annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(-1), this, missingTypeNames);
return this.typeSystem.getWildcard(genericType, rank, bound, null /*no extra bound*/, Wildcard.SUPER, annotations);
case '+' :
// ? extends aType
wrapper.start++;
bound = getTypeFromTypeSignature(wrapper, staticVariables, enclosingType, missingTypeNames, walker.toWildcardBound());
- annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0), this, missingTypeNames);
+ annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(-1), this, missingTypeNames);
return this.typeSystem.getWildcard(genericType, rank, bound, null /*no extra bound*/, Wildcard.EXTENDS, annotations);
case '*' :
// ?
wrapper.start++;
- annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(0), this, missingTypeNames);
+ annotations = BinaryTypeBinding.createAnnotations(walker.getAnnotationsAtCursor(-1), this, missingTypeNames);
return this.typeSystem.getWildcard(genericType, rank, null, null /*no extra bound*/, Wildcard.UNBOUND, annotations);
default :
return getTypeFromTypeSignature(wrapper, staticVariables, enclosingType, missingTypeNames, walker);
@@ -1643,4 +1688,21 @@
System.arraycopy(filtered, 0, filtered = new AnnotationBinding[count], 0, count);
return filtered;
}
+
+public boolean containsNullTypeAnnotation(IBinaryAnnotation[] typeAnnotations) {
+ if (typeAnnotations.length == 0)
+ return false;
+ char[][] nonNullAnnotationName = this.getNonNullAnnotationName();
+ char[][] nullableAnnotationName = this.getNullableAnnotationName();
+ for (int i = 0; i < typeAnnotations.length; i++) {
+ IBinaryAnnotation typeAnnotation = typeAnnotations[i];
+ char[] typeName = typeAnnotation.getTypeName();
+ // typeName must be "Lfoo/X;"
+ if (typeName == null || typeName.length < 3 || typeName[0] != 'L') continue;
+ char[][] name = CharOperation.splitOn('/', typeName, 1, typeName.length-1);
+ if (CharOperation.equals(name, nonNullAnnotationName) || CharOperation.equals(name, nullableAnnotationName))
+ return true;
+ }
+ return false;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
index 38eff42..e890aa8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,6 +22,9 @@
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 438012 - [1.8][null] Bogus Warning: The nullness annotation is redundant with a default that applies to this location
* Bug 440759 - [1.8][null] @NonNullByDefault should never affect wildcards and uses of a type variable
+ * Bug 443347 - [1.8][null] @NonNullByDefault should not affect constructor arguments of an anonymous instantiation
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Jesper Steen Moller - Contributions for
* Bug 412150 [1.8] [compiler] Enable reflected parameter names during annotation processing
*******************************************************************************/
@@ -37,6 +40,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@@ -578,7 +582,7 @@
sourceMethod.arguments[i].binding.type = this.parameters[i];
}
} else if (sourceMethod != null && (parameter.tagBits & TagBits.AnnotationNonNull) != 0
- && sourceMethod.arguments[i].hasNullTypeAnnotation()) {
+ && sourceMethod.arguments[i].hasNullTypeAnnotation(AnnotationPosition.MAIN_TYPE)) {
sourceMethod.scope.problemReporter().nullAnnotationIsRedundant(sourceMethod, i);
}
}
@@ -589,7 +593,7 @@
if (this.returnType.acceptsNonNullDefault() && (this.returnType.tagBits & TagBits.AnnotationNullMASK) == 0) {
this.returnType = env.createAnnotatedType(this.returnType, new AnnotationBinding[]{env.getNonNullAnnotation()});
} else if (sourceMethod instanceof MethodDeclaration && (this.returnType.tagBits & TagBits.AnnotationNonNull) != 0
- && ((MethodDeclaration)sourceMethod).hasNullTypeAnnotation()) {
+ && ((MethodDeclaration)sourceMethod).hasNullTypeAnnotation(AnnotationPosition.MAIN_TYPE)) {
sourceMethod.scope.problemReporter().nullAnnotationIsRedundant(sourceMethod, -1/*signifies method return*/);
}
}
@@ -682,13 +686,13 @@
ASTNode.resolveAnnotations(methodDecl.scope, methodDecl.annotations, originalMethod);
CompilerOptions options = scope.compilerOptions();
if (options.isAnnotationBasedNullAnalysisEnabled) {
- boolean isJdk18 = options.sourceLevel >= ClassFileConstants.JDK1_8;
- long nullDefaultBits = isJdk18 ? this.defaultNullness
+ boolean usesNullTypeAnnotations = scope.environment().usesNullTypeAnnotations();
+ long nullDefaultBits = usesNullTypeAnnotations ? this.defaultNullness
: this.tagBits & (TagBits.AnnotationNonNullByDefault|TagBits.AnnotationNullUnspecifiedByDefault);
if (nullDefaultBits != 0 && this.declaringClass instanceof SourceTypeBinding) {
SourceTypeBinding declaringSourceType = (SourceTypeBinding) this.declaringClass;
- if (declaringSourceType.checkRedundantNullnessDefaultOne(methodDecl, methodDecl.annotations, nullDefaultBits, isJdk18)) {
- declaringSourceType.checkRedundantNullnessDefaultRecurse(methodDecl, methodDecl.annotations, nullDefaultBits, isJdk18);
+ if (declaringSourceType.checkRedundantNullnessDefaultOne(methodDecl, methodDecl.annotations, nullDefaultBits, usesNullTypeAnnotations)) {
+ declaringSourceType.checkRedundantNullnessDefaultRecurse(methodDecl, methodDecl.annotations, nullDefaultBits, usesNullTypeAnnotations);
}
}
}
@@ -1340,6 +1344,8 @@
}
//pre: null annotation analysis is enabled
public boolean hasNonNullDefaultFor(int location, boolean useTypeAnnotations) {
+ if ((this.modifiers & ExtraCompilerModifiers.AccIsDefaultConstructor) != 0)
+ return false;
if (useTypeAnnotations) {
if (this.defaultNullness != 0)
return (this.defaultNullness & location) != 0;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
index be073d4..0bfe420 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
@@ -419,6 +419,14 @@
return null;
if (!field.isValidBinding())
return field; // answer the error field
+
+ if (receiverType.isInterface() && invocationSite.isQualifiedSuper())
+ return new ProblemFieldBinding(
+ field, // closest match
+ field.declaringClass,
+ fieldName,
+ ProblemReasons.NoProperEnclosingInstance);
+
if (field.isStatic())
return field; // static fields are always accessible
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
index 2e809e3..e6f491d 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java
@@ -27,6 +27,8 @@
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 390889 - [1.8][compiler] Evaluate options to support 1.7- projects against 1.8 JRE.
* Bug 440773 - [1.8][null]DefaultLocation.RETURN_TYPE erroneously affects method parameters in @NonNullByDefault
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 446442 - [1.8] merge null annotations from super methods
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -77,7 +79,7 @@
AbstractMethodDeclaration srcMethod = null;
if (analyseNullAnnotations && this.type.equals(concreteMethod.declaringClass)) // is currentMethod from the current type?
srcMethod = concreteMethod.sourceMethod();
- boolean useTypeAnnotations = this.environment.globalOptions.sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean useTypeAnnotations = this.environment.usesNullTypeAnnotations();
boolean hasReturnNonNullDefault = analyseNullAnnotations && concreteMethod.hasNonNullDefaultFor(Binding.DefaultLocationReturnType, useTypeAnnotations);
boolean hasParameterNonNullDefault = analyseNullAnnotations && concreteMethod.hasNonNullDefaultFor(Binding.DefaultLocationParameter, useTypeAnnotations);
@@ -102,7 +104,7 @@
this.type.addSyntheticBridgeMethod(originalInherited, concreteMethod.original());
}
if (analyseNullAnnotations && !concreteMethod.isStatic() && !abstractMethod.isStatic()) {
- checkNullSpecInheritance(concreteMethod, srcMethod, hasReturnNonNullDefault, hasParameterNonNullDefault, true, abstractMethod, this.type.scope, null);
+ checkNullSpecInheritance(concreteMethod, srcMethod, hasReturnNonNullDefault, hasParameterNonNullDefault, true, abstractMethod, abstractMethods, this.type.scope, null);
}
}
}
@@ -394,17 +396,17 @@
AbstractMethodDeclaration srcMethod = null;
if (this.type.equals(currentMethod.declaringClass)) // is currentMethod from the current type?
srcMethod = currentMethod.sourceMethod();
- boolean useTypeAnnotations = options.sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean useTypeAnnotations = this.environment.usesNullTypeAnnotations();
boolean hasReturnNonNullDefault = currentMethod.hasNonNullDefaultFor(Binding.DefaultLocationReturnType, useTypeAnnotations);
boolean hasParameterNonNullDefault = currentMethod.hasNonNullDefaultFor(Binding.DefaultLocationParameter, useTypeAnnotations);
for (int i = length; --i >= 0;)
if (!currentMethod.isStatic() && !methods[i].isStatic())
- checkNullSpecInheritance(currentMethod, srcMethod, hasReturnNonNullDefault, hasParameterNonNullDefault, true, methods[i], this.type.scope, null);
+ checkNullSpecInheritance(currentMethod, srcMethod, hasReturnNonNullDefault, hasParameterNonNullDefault, true, methods[i], methods, this.type.scope, null);
}
}
void checkNullSpecInheritance(MethodBinding currentMethod, AbstractMethodDeclaration srcMethod,
- boolean hasReturnNonNullDefault, boolean hasParameterNonNullDefault, boolean complain, MethodBinding inheritedMethod, Scope scope, InheritedNonNullnessInfo[] inheritedNonNullnessInfos)
+ boolean hasReturnNonNullDefault, boolean hasParameterNonNullDefault, boolean complain, MethodBinding inheritedMethod, MethodBinding[] allInherited, Scope scope, InheritedNonNullnessInfo[] inheritedNonNullnessInfos)
{
complain &= !currentMethod.isConstructor();
if (!hasReturnNonNullDefault && !hasParameterNonNullDefault && !complain && !this.environment.globalOptions.inheritNullAnnotations) {
@@ -418,7 +420,7 @@
{
this.buddyImplicitNullAnnotationsVerifier.checkImplicitNullAnnotations(currentMethod, srcMethod, complain, scope);
}
- super.checkNullSpecInheritance(currentMethod, srcMethod, hasReturnNonNullDefault, hasParameterNonNullDefault, complain, inheritedMethod, scope, inheritedNonNullnessInfos);
+ super.checkNullSpecInheritance(currentMethod, srcMethod, hasReturnNonNullDefault, hasParameterNonNullDefault, complain, inheritedMethod, allInherited, scope, inheritedNonNullnessInfos);
}
void reportRawReferences() {
@@ -955,11 +957,15 @@
return false; // must hold onto ParameterizedMethod to see if a bridge method is necessary
inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
- return inheritedMethod != null
- && (TypeBinding.equalsEquals(inheritedMethod.returnType, existingMethod.returnType) // need to keep around to produce bridge methods? ...
- || (TypeBinding.notEquals(this.type, existingMethod.declaringClass) // ... not if inheriting the bridge situation from a superclass
- && !existingMethod.declaringClass.isInterface()))
- && doesMethodOverride(existingMethod, inheritedMethod);
+ if (inheritedMethod == null
+ || TypeBinding.notEquals(inheritedMethod.returnType, existingMethod.returnType)) // need to keep around to produce bridge methods? ...
+ return false;
+
+ if (!doesMethodOverride(existingMethod, inheritedMethod))
+ return false;
+
+ return TypeBinding.notEquals(this.type, existingMethod.declaringClass) // ... not if inheriting the bridge situation from a superclass
+ && !existingMethod.declaringClass.isInterface();
}
public boolean isMethodSubsignature(MethodBinding method, MethodBinding inheritedMethod) {
if (!org.aspectj.org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector))
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
index 87d9d6d..6e4a2bf 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NestedTypeBinding.java
@@ -10,6 +10,7 @@
* Stephan Herrmann - Contributions for
* Bug 365662 - [compiler][null] warn on contradictory and redundant null annotations
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
* Keigo Imai - Contribution for bug 388903 - Cannot extend inner class as an anonymous class when it extends the outer class
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -125,16 +126,16 @@
return synthLocal;
}
-protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation[] annotations, long nullBits, boolean isJdk18) {
+protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) {
if (!isPrototype()) throw new IllegalStateException();
ReferenceBinding currentType = this.enclosingType;
do {
- if (!((SourceTypeBinding)currentType).checkRedundantNullnessDefaultOne(location, annotations, nullBits, isJdk18)) {
+ if (!((SourceTypeBinding)currentType).checkRedundantNullnessDefaultOne(location, annotations, nullBits, useNullTypeAnnotations)) {
return;
}
currentType = currentType.enclosingType();
} while (currentType instanceof SourceTypeBinding);
- super.checkRedundantNullnessDefaultRecurse(location, annotations, nullBits, isJdk18);
+ super.checkRedundantNullnessDefaultRecurse(location, annotations, nullBits, useNullTypeAnnotations);
}
/* Answer the receiver's enclosing type... null if the receiver is a top level type.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java
index 5678e93..f099813 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/NullTypeBinding.java
@@ -27,7 +27,7 @@
return; // reject misguided attempt.
}
- public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
+ public TypeBinding unannotated() {
return this;
}
}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java
index edb7934..a8e4bd0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,12 +20,16 @@
* Bug 416182 - [1.8][compiler][null] Contradictory null annotations not rejected
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 434602 - Possible error with inferred null annotations leading to contradictory null annotations
+ * Bug 434483 - [1.8][compiler][inference] Type inference not picked up with method reference
+ * Bug 446442 - [1.8] merge null annotations from super methods
+ * Bug 457079 - Regression: type inference
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Invocation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@@ -39,7 +43,7 @@
public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution {
public TypeBinding[] typeArguments;
- private LookupEnvironment environment;
+ protected LookupEnvironment environment;
public boolean inferredReturnType;
public boolean wasInferred; // only set to true for instances resulting from method invocation inferrence
public boolean isRaw; // set to true for method behaving as raw for substitution purpose
@@ -48,31 +52,11 @@
/**
* Perform inference of generic method type parameters and/or expected type
* <p>
- * In 1.8+ the following discipline has to be observed by callers:
- * Each invocation must be subjected to two levels of inference:
- * </p>
- * <ul>
- * <li> {@link Scope#APPLICABILITY Invocation Applicability Inference}, which may be applied
- * multiple times for the same invocation</li>
- * <li> {@link Scope#INVOCATION_TYPE Invocation Type Inference}, which is finally performed
- * for the selected method and which adds information from the "target type".</li>
- * </ul>
- * <p>
- * Clients can control which parts of the inference should be performed by passing the appropriate
- * flags into argument 'inferenceLevel'. On each call path it must be ensured that one or more
- * invocation applicability inferences are always followed by exactly one invocation type inference
- * (unless errors have been detected).
- * </p>
- * <p>
- * Initial clients are the direct callers of
- * {@link Scope#computeCompatibleMethod(MethodBinding,TypeBinding[],InvocationSite,int)},
- * which should either invoke both levels of inference <em>or</em> delegate the second part to
- * {@link Scope#mostSpecificMethodBinding(MethodBinding[],int,TypeBinding[],InvocationSite,ReferenceBinding)},
- * which is intended to ensure completing the inference on all non-error exits.
+ * In 1.8+ if the expected type is not yet available due to this call being an argument to an outer call which is not overload-resolved yet,
+ * the returned method binding will be a PolyParameterizedGenericMethodBinding.
* </p>
*/
- public static MethodBinding computeCompatibleMethod(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope,
- InvocationSite invocationSite, int inferenceLevel)
+ public static MethodBinding computeCompatibleMethod(MethodBinding originalMethod, TypeBinding[] arguments, Scope scope, InvocationSite invocationSite)
{
ParameterizedGenericMethodBinding methodSubstitute;
TypeVariableBinding[] typeVariables = originalMethod.typeVariables;
@@ -93,94 +77,11 @@
// initializes the map of substitutes (var --> type[][]{ equal, extends, super}
TypeBinding[] parameters = originalMethod.parameters;
-// ==== 1.8: The main driver for inference of generic methods: ====
- InferenceContext18 infCtx18 = null;
CompilerOptions compilerOptions = scope.compilerOptions();
- if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8) {
- if ((inferenceLevel & Scope.APPLICABILITY) != 0)
- infCtx18 = invocationSite.freshInferenceContext(scope);
- else if (invocationSite instanceof Invocation && originalMethod instanceof ParameterizedGenericMethodBinding)
- infCtx18 = ((Invocation) invocationSite).getInferenceContext((ParameterizedGenericMethodBinding) originalMethod);
- }
- if (infCtx18 != null) {
- try {
- BoundSet provisionalResult = null;
- BoundSet result = null;
- if ((inferenceLevel & Scope.APPLICABILITY) != 0) {
-
- // ---- 18.5.1 (Applicability): ----
- boolean isDiamond = originalMethod.isConstructor()
- && invocationSite instanceof Expression
- && ((Expression)invocationSite).isPolyExpression(originalMethod);
- if (arguments.length == parameters.length) {
- infCtx18.inferenceKind = InferenceContext18.CHECK_LOOSE; // TODO: validate if 2 phase checking (strict/loose + vararg) is sufficient.
- infCtx18.inferInvocationApplicability(originalMethod, arguments, isDiamond);
- provisionalResult = infCtx18.solve();
- }
- if (provisionalResult == null && originalMethod.isVarargs()) {
- // check for variable-arity applicability
- infCtx18 = invocationSite.freshInferenceContext(scope); // start over
- infCtx18.inferenceKind = InferenceContext18.CHECK_VARARG;
- infCtx18.inferInvocationApplicability(originalMethod, arguments, isDiamond);
- provisionalResult = infCtx18.solve();
- }
- if (provisionalResult != null && infCtx18.isResolved(provisionalResult)) {
- infCtx18.storedSolution = provisionalResult;
- infCtx18.stepCompleted = InferenceContext18.APPLICABILITY_INFERRED;
- }
- } else {
- provisionalResult = infCtx18.storedSolution;
- }
- result = infCtx18.currentBounds.copy(); // the result after reduction, without effects of resolve()
-
- TypeBinding expectedType = invocationSite.invocationTargetType();
- boolean hasReturnProblem = false;
- boolean invocationTypeInferred = false;
- if ((inferenceLevel & Scope.INVOCATION_TYPE) != 0 // requested?
- && (expectedType != null || !invocationSite.getExpressionContext().definesTargetType())) { // possible?
-
- // ---- 18.5.2 (Invocation type): ----
- result = infCtx18.inferInvocationType(result, expectedType, invocationSite, originalMethod);
- invocationTypeInferred = true;
- hasReturnProblem |= result == null;
- if (hasReturnProblem)
- result = provisionalResult; // let's prefer a type error regarding the return type over reporting no match at all
- } else {
- // we're not yet ready for invocation type inference
- result = provisionalResult;
- }
-
- if (result != null) {
- // assemble the solution etc:
- TypeBinding[] solutions = infCtx18.getSolutions(typeVariables, invocationSite, result);
- if (solutions != null) {
+ if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8)
+ return computeCompatibleMethod18(originalMethod, arguments, scope, invocationSite);
- methodSubstitute = scope.environment().createParameterizedGenericMethod(originalMethod, solutions);
- if (hasReturnProblem) { // illegally working from the provisional result?
- MethodBinding problemMethod = infCtx18.getReturnProblemMethodIfNeeded(expectedType, methodSubstitute);
- if (problemMethod instanceof ProblemMethodBinding)
- return problemMethod;
- }
- if (invocationTypeInferred) {
- if (compilerOptions.isAnnotationBasedNullAnalysisEnabled)
- NullAnnotationMatching.checkForContraditions(methodSubstitute, invocationSite, scope);
- infCtx18.rebindInnerPolies(result, methodSubstitute.parameters);
- return methodSubstitute.boundCheck18(scope, arguments);
- } else {
- if (invocationSite instanceof Invocation)
- ((Invocation) invocationSite).registerInferenceContext(methodSubstitute, infCtx18); // keep context so we can finish later
- return methodSubstitute;
- }
- }
- }
- return null;
- } catch (InferenceFailureException e) {
- // FIXME stop-gap measure
- scope.problemReporter().genericInferenceError(e.getMessage(), invocationSite);
- return null;
- }
- } else {
-// ==== 1.8 ====
+ // 1.7- only.
inferenceContext = new InferenceContext(originalMethod);
methodSubstitute = inferFromArgumentTypes(scope, originalMethod, arguments, parameters, inferenceContext);
if (methodSubstitute == null)
@@ -206,6 +107,34 @@
methodSubstitute = methodSubstitute.inferFromExpectedType(scope, inferenceContext);
if (methodSubstitute == null)
return null;
+ } else if (compilerOptions.sourceLevel == ClassFileConstants.JDK1_7) {
+ // bug 425203 - consider additional constraints to conform to buggy javac behavior
+ if (methodSubstitute.returnType != TypeBinding.VOID) {
+ TypeBinding expectedType = invocationSite.invocationTargetType();
+ // In case of a method like <T> List<T> foo(T arg), solution based on return type
+ // should not be preferred vs solution based on parameter types, so do not attempt
+ // to use return type based inference in this case
+ if (expectedType != null && !originalMethod.returnType.mentionsAny(originalMethod.parameters, -1)) {
+ TypeBinding uncaptured = methodSubstitute.returnType.uncapture(scope);
+ if (!methodSubstitute.returnType.isCompatibleWith(expectedType) &&
+ expectedType.isCompatibleWith(uncaptured)) {
+ InferenceContext oldContext = inferenceContext;
+ inferenceContext = new InferenceContext(originalMethod);
+ // Include additional constraint pertaining to the expected type
+ originalMethod.returnType.collectSubstitutes(scope, expectedType, inferenceContext, TypeConstants.CONSTRAINT_EXTENDS);
+ ParameterizedGenericMethodBinding substitute = inferFromArgumentTypes(scope, originalMethod, arguments, parameters, inferenceContext);
+ if (substitute != null && substitute.returnType.isCompatibleWith(expectedType)) {
+ // Do not use the new solution if it results in incompatibilities in parameter types
+ if ((scope.parameterCompatibilityLevel(substitute, arguments, false)) > Scope.NOT_COMPATIBLE) {
+ methodSubstitute = substitute;
+ } else {
+ inferenceContext = oldContext;
+ }
+ } else {
+ inferenceContext = oldContext;
+ }
+ }
+ }
}
}
}
@@ -258,6 +187,118 @@
return methodSubstitute;
}
+ public static MethodBinding computeCompatibleMethod18(MethodBinding originalMethod, TypeBinding[] arguments, final Scope scope, InvocationSite invocationSite) {
+
+ TypeVariableBinding[] typeVariables = originalMethod.typeVariables;
+ if (invocationSite.checkingPotentialCompatibility()) {
+ // Not interested in a solution, only that there could potentially be one.
+ return scope.environment().createParameterizedGenericMethod(originalMethod, typeVariables);
+ }
+
+ ParameterizedGenericMethodBinding methodSubstitute = null;
+ InferenceContext18 infCtx18 = invocationSite.freshInferenceContext(scope);
+ if (infCtx18 == null)
+ return originalMethod; // per parity with old F & G integration.
+ TypeBinding[] parameters = originalMethod.parameters;
+ CompilerOptions compilerOptions = scope.compilerOptions();
+ boolean invocationTypeInferred = false;
+ boolean requireBoxing = false;
+
+ // See if we should start in loose inference mode.
+ TypeBinding [] argumentsCopy = new TypeBinding[arguments.length];
+ for (int i = 0, length = arguments.length, parametersLength = parameters.length ; i < length; i++) {
+ TypeBinding parameter = i < parametersLength ? parameters[i] : parameters[parametersLength - 1];
+ final TypeBinding argument = arguments[i];
+ if (argument.isPrimitiveType() != parameter.isPrimitiveType()) { // Scope.cCM incorrectly but harmlessly uses isBaseType which answers true for null.
+ argumentsCopy[i] = scope.environment().computeBoxingType(argument);
+ requireBoxing = true; // can't be strict mode, needs at least loose.
+ } else {
+ argumentsCopy[i] = argument;
+ }
+ }
+ arguments = argumentsCopy; // either way, this allows the engine to update arguments without harming the callers.
+
+ LookupEnvironment environment = scope.environment();
+ InferenceContext18 previousContext = environment.currentInferenceContext;
+ if (previousContext == null)
+ environment.currentInferenceContext = infCtx18;
+ try {
+ BoundSet provisionalResult = null;
+ BoundSet result = null;
+ // ---- 18.5.1 (Applicability): ----
+ final boolean isPolyExpression = invocationSite instanceof Expression && ((Expression)invocationSite).isPolyExpression(originalMethod);
+ boolean isDiamond = isPolyExpression && originalMethod.isConstructor();
+ if (arguments.length == parameters.length) {
+ infCtx18.inferenceKind = requireBoxing ? InferenceContext18.CHECK_LOOSE : InferenceContext18.CHECK_STRICT; // engine may still slip into loose mode and adjust level.
+ infCtx18.inferInvocationApplicability(originalMethod, arguments, isDiamond);
+ result = infCtx18.solve(true);
+ }
+ if (result == null && originalMethod.isVarargs()) {
+ // check for variable-arity applicability
+ infCtx18 = invocationSite.freshInferenceContext(scope); // start over
+ infCtx18.inferenceKind = InferenceContext18.CHECK_VARARG;
+ infCtx18.inferInvocationApplicability(originalMethod, arguments, isDiamond);
+ result = infCtx18.solve(true);
+ }
+ if (result == null)
+ return null;
+ if (infCtx18.isResolved(result)) {
+ infCtx18.stepCompleted = InferenceContext18.APPLICABILITY_INFERRED;
+ } else {
+ return null;
+ }
+ // Applicability succeeded, proceed to infer invocation type, if possible.
+ TypeBinding expectedType = invocationSite.invocationTargetType();
+ boolean hasReturnProblem = false;
+ if (expectedType != null || !invocationSite.getExpressionContext().definesTargetType() || !isPolyExpression) {
+ // ---- 18.5.2 (Invocation type): ----
+ provisionalResult = result;
+ result = infCtx18.inferInvocationType(expectedType, invocationSite, originalMethod);
+ invocationTypeInferred = true;
+ hasReturnProblem |= result == null;
+ if (hasReturnProblem)
+ result = provisionalResult; // let's prefer a type error regarding the return type over reporting no match at all
+ }
+ if (result != null) {
+ // assemble the solution etc:
+ TypeBinding[] solutions = infCtx18.getSolutions(typeVariables, invocationSite, result);
+ if (solutions != null) {
+ methodSubstitute = scope.environment().createParameterizedGenericMethod(originalMethod, solutions);
+ if (invocationSite instanceof Invocation)
+ infCtx18.forwardResults(result, (Invocation) invocationSite, methodSubstitute, expectedType);
+ if (hasReturnProblem) { // illegally working from the provisional result?
+ MethodBinding problemMethod = infCtx18.getReturnProblemMethodIfNeeded(expectedType, methodSubstitute);
+ if (problemMethod instanceof ProblemMethodBinding) {
+ return problemMethod;
+ }
+ }
+ if (invocationTypeInferred) {
+ if (compilerOptions.isAnnotationBasedNullAnalysisEnabled)
+ NullAnnotationMatching.checkForContradictions(methodSubstitute, invocationSite, scope);
+ MethodBinding problemMethod = methodSubstitute.boundCheck18(scope, arguments);
+ if (problemMethod != null) {
+ return problemMethod;
+ }
+ } else {
+ methodSubstitute = new PolyParameterizedGenericMethodBinding(methodSubstitute);
+ }
+ if (invocationSite instanceof Invocation)
+ ((Invocation) invocationSite).registerInferenceContext(methodSubstitute, infCtx18); // keep context so we can finish later
+ else if (invocationSite instanceof ReferenceExpression)
+ ((ReferenceExpression) invocationSite).registerInferenceContext(methodSubstitute, infCtx18); // keep context so we can finish later
+ return methodSubstitute;
+ }
+ }
+ return null;
+ } catch (InferenceFailureException e) {
+ // FIXME stop-gap measure
+ scope.problemReporter().genericInferenceError(e.getMessage(), invocationSite);
+ return null;
+ } finally {
+ environment.currentInferenceContext = previousContext;
+ }
+ }
+
MethodBinding boundCheck18(Scope scope, TypeBinding[] arguments) {
Substitution substitution = this;
ParameterizedGenericMethodBinding methodSubstitute = this;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
index 06ea64b..aac99d7 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
@@ -185,6 +185,7 @@
*/
this.tagBits = originalMethod.tagBits & ~TagBits.HasMissingType;
this.parameterNonNullness = originalMethod.parameterNonNullness;
+ this.defaultNullness = originalMethod.defaultNullness;
final TypeVariableBinding[] originalVariables = originalMethod.typeVariables;
Substitution substitution = null;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
index 5d3fd36..99f80e8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2014 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,6 +34,11 @@
* Bug 416182 - [1.8][compiler][null] Contradictory null annotations not rejected
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 438179 - [1.8][null] 'Contradictory null annotations' error on type variable with explicit null-annotation.
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
+ * Bug 446434 - [1.8][null] Enable interned captures also when analysing null type annotations
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 456508 - Unexpected RHS PolyTypeBinding for: <code-snippet>
+ * Bug 390064 - [compiler][resource] Resource leak warning missing when extending parameterized class
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -42,7 +47,9 @@
import java.util.Set;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -62,7 +69,7 @@
public FieldBinding[] fields;
public ReferenceBinding[] memberTypes;
public MethodBinding[] methods;
- private ReferenceBinding enclosingType;
+ protected ReferenceBinding enclosingType;
public ParameterizedTypeBinding(ReferenceBinding type, TypeBinding[] arguments, ReferenceBinding enclosingType, LookupEnvironment environment){
this.environment = environment;
@@ -81,6 +88,7 @@
if (enclosingType != null && enclosingType.hasNullTypeAnnotations())
this.tagBits |= TagBits.HasNullTypeAnnotation;
this.tagBits |= TagBits.HasUnresolvedTypeVariables; // cleared in resolve()
+ this.typeBits = type.typeBits;
}
/**
@@ -124,9 +132,9 @@
}
/**
* Perform capture conversion for a parameterized type with wildcard arguments
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding#capture(Scope,int)
+ * @see org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding#capture(Scope,int, int)
*/
- public TypeBinding capture(Scope scope, int position) {
+ public ParameterizedTypeBinding capture(Scope scope, int start, int end) {
if ((this.tagBits & TagBits.HasDirectWildcard) == 0)
return this;
@@ -138,14 +146,21 @@
ReferenceBinding contextType = scope.enclosingSourceType();
if (contextType != null) contextType = contextType.outermostEnclosingType(); // maybe null when used programmatically by DOM
+ CompilationUnitScope compilationUnitScope = scope.compilationUnitScope();
+ ASTNode cud = compilationUnitScope.referenceContext;
+ long sourceLevel = this.environment.globalOptions.sourceLevel;
+ final boolean needUniqueCapture = sourceLevel >= ClassFileConstants.JDK1_8;
+
for (int i = 0; i < length; i++) {
TypeBinding argument = originalArguments[i];
if (argument.kind() == Binding.WILDCARD_TYPE) { // no capture for intersection types
final WildcardBinding wildcard = (WildcardBinding) argument;
if (wildcard.boundKind == Wildcard.SUPER && wildcard.bound.id == TypeIds.T_JavaLangObject)
capturedArguments[i] = wildcard.bound;
+ else if (needUniqueCapture)
+ capturedArguments[i] = this.environment.createCapturedWildcard(wildcard, contextType, start, end, cud, compilationUnitScope.nextCaptureID());
else
- capturedArguments[i] = new CaptureBinding(wildcard, contextType, position, scope.compilationUnitScope().nextCaptureID());
+ capturedArguments[i] = new CaptureBinding(wildcard, contextType, start, end, cud, compilationUnitScope.nextCaptureID());
} else {
capturedArguments[i] = argument;
}
@@ -669,13 +684,12 @@
if (length == 0) return Binding.NO_METHODS;
parameterizedMethods = new MethodBinding[length];
- CompilerOptions options = this.environment.globalOptions;
- boolean useNullTypeAnnotations = options.isAnnotationBasedNullAnalysisEnabled && options.sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean useNullTypeAnnotations = this.environment.usesNullTypeAnnotations();
for (int i = 0; i < length; i++) {
// substitute methods, so as to get updated declaring class at least
parameterizedMethods[i] = createParameterizedMethod(originalMethods[i]);
if (useNullTypeAnnotations)
- parameterizedMethods[i] = NullAnnotationMatching.checkForContraditions(parameterizedMethods[i], null, null);
+ parameterizedMethods[i] = NullAnnotationMatching.checkForContradictions(parameterizedMethods[i], null, null);
}
if (this.methods == null) {
MethodBinding[] temp = new MethodBinding[length];
@@ -808,6 +822,7 @@
}
}
}
+ if (this.arguments != ParameterizedSingleTypeReference.DIAMOND_TYPE_ARGUMENTS) {
if (this.arguments == null) {
return otherParamType.arguments == null;
}
@@ -818,6 +833,7 @@
if (!this.arguments[i].isTypeArgumentContainedBy(otherArguments[i]))
return false;
}
+ }
return true;
case Binding.RAW_TYPE :
@@ -875,27 +891,17 @@
return isRawType();
}
- public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
- if (!hasTypeAnnotations())
+ public TypeBinding unannotated() {
+ return this.hasTypeAnnotations() ? this.environment.getUnannotatedType(this) : this;
+ }
+
+ @Override
+ public TypeBinding withoutToplevelNullAnnotation() {
+ if (!hasNullTypeAnnotations())
return this;
- if (removeOnlyNullAnnotations && !hasNullTypeAnnotations())
- return this;
- if (removeOnlyNullAnnotations) {
ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.environment.getUnannotatedType(this.type);
AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
- TypeBinding[] newArguments = null;
- if (this.arguments != null) {
- newArguments = new TypeBinding[this.arguments.length];
- for (int i = 0; i < this.arguments.length; i++) {
- newArguments[i] = this.arguments[i].unannotated(removeOnlyNullAnnotations);
- }
- }
- ReferenceBinding newEnclosing = null;
- if (this.enclosingType != null)
- newEnclosing = (ReferenceBinding)this.enclosingType.unannotated(removeOnlyNullAnnotations);
- return this.environment.createParameterizedType(unannotatedGenericType, newArguments, newEnclosing, newAnnotations);
- }
- return this.environment.getUnannotatedType(this);
+ return this.environment.createParameterizedType(unannotatedGenericType, this.arguments, this.enclosingType, newAnnotations);
}
public int kind() {
@@ -961,13 +967,12 @@
MethodBinding[] originalMethods = this.type.methods();
int length = originalMethods.length;
MethodBinding[] parameterizedMethods = new MethodBinding[length];
- CompilerOptions options = this.environment.globalOptions;
- boolean useNullTypeAnnotations = options.isAnnotationBasedNullAnalysisEnabled && options.sourceLevel >= ClassFileConstants.JDK1_8;
+ boolean useNullTypeAnnotations = this.environment.usesNullTypeAnnotations();
for (int i = 0; i < length; i++) {
// substitute all methods, so as to get updated declaring class at least
parameterizedMethods[i] = createParameterizedMethod(originalMethods[i]);
if (useNullTypeAnnotations)
- parameterizedMethods[i] = NullAnnotationMatching.checkForContraditions(parameterizedMethods[i], null, null);
+ parameterizedMethods[i] = NullAnnotationMatching.checkForContradictions(parameterizedMethods[i], null, null);
}
this.methods = parameterizedMethods;
@@ -1391,12 +1396,15 @@
return this.fields;
}
public MethodBinding getSingleAbstractMethod(final Scope scope, boolean replaceWildcards) {
- int index = replaceWildcards ? 0 : 1;
+ return getSingleAbstractMethod(scope, replaceWildcards, -1, -1 /* do not capture */);
+ }
+ public MethodBinding getSingleAbstractMethod(final Scope scope, boolean replaceWildcards, int start, int end) {
+ int index = replaceWildcards ? end < 0 ? 0 : 1 : 2; // capturePosition >= 0 IFF replaceWildcard == true
if (this.singleAbstractMethod != null) {
if (this.singleAbstractMethod[index] != null)
return this.singleAbstractMethod[index];
} else {
- this.singleAbstractMethod = new MethodBinding[2];
+ this.singleAbstractMethod = new MethodBinding[3];
}
if (!isValidBinding())
return null;
@@ -1414,6 +1422,13 @@
} else if (types == null) {
types = NO_TYPES;
}
+ if (end >= 0) {
+ // caller is going to require the sam's parameters to be treated as argument expressions, post substitution capture will lose identity, where substitution results in fan out
+ // capture first and then substitute.
+ for (int i = 0, length = types.length; i < length; i++) {
+ types[i] = types[i].capture(scope, start, end);
+ }
+ }
declaringType = scope.environment().createParameterizedType(genericType, types, genericType.enclosingType());
TypeVariableBinding [] typeParameters = genericType.typeVariables();
for (int i = 0, length = typeParameters.length; i < length; i++) {
@@ -1475,7 +1490,7 @@
try {
ReferenceBinding[] refs = new ReferenceBinding[glb.length];
System.arraycopy(glb, 0, refs, 0, glb.length); // TODO: if an array type plus more types get here, we get ArrayStoreException!
- types[i] = new IntersectionCastTypeBinding(refs, this.environment);
+ types[i] = this.environment.createIntersectionType18(refs);
} catch (ArrayStoreException ase) {
scope.problemReporter().genericInferenceError("Cannot compute glb of "+Arrays.toString(glb), null); //$NON-NLS-1$
return null;
@@ -1499,7 +1514,7 @@
}
}
return types;
- }
+ }/* need this still?
static boolean typeParametersMentioned(TypeBinding upperBound) {
class MentionListener extends TypeBindingVisitor {
private boolean typeParametersMentioned = false;
@@ -1514,7 +1529,7 @@
MentionListener mentionListener = new MentionListener();
TypeBindingVisitor.visit(mentionListener, upperBound);
return mentionListener.typeParametersMentioned();
- }
+ }*/
// AspectJ extension - delegate to the source type (the generic type) as it has a memberFinder for resolving ITDs
public FieldBinding getField(char[] fieldName, boolean resolve, InvocationSite site, Scope scope) {
FieldBinding fb = null;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java
new file mode 100644
index 0000000..97c9ead
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyParameterizedGenericMethodBinding.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
+
+public class PolyParameterizedGenericMethodBinding extends ParameterizedGenericMethodBinding { // confused citizen.
+
+ private ParameterizedGenericMethodBinding wrappedBinding;
+ public PolyParameterizedGenericMethodBinding(ParameterizedGenericMethodBinding applicableMethod) {
+ super(applicableMethod.originalMethod, applicableMethod.typeArguments, applicableMethod.environment);
+ this.wrappedBinding = applicableMethod;
+ }
+
+ public boolean equals(Object other) {
+ if (other instanceof PolyParameterizedGenericMethodBinding) {
+ PolyParameterizedGenericMethodBinding ppgmb = (PolyParameterizedGenericMethodBinding)other;
+ return this.wrappedBinding.equals(ppgmb.wrappedBinding);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return this.wrappedBinding.hashCode();
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java
index 2bb5d60..1f68b25 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java
@@ -37,6 +37,21 @@
return this.vanillaCompatibilty ? this.expression.isCompatibleWith(left, scope) : this.expression.isBoxingCompatibleWith(left, scope);
}
+ @Override
+ public boolean isPotentiallyCompatibleWith(TypeBinding targetType, Scope scope) {
+ return this.expression.isPotentiallyCompatibleWith(targetType, scope);
+ }
+
+ @Override
+ public boolean isPolyType() {
+ return true;
+ }
+
+ @Override
+ public boolean isFunctionalType() {
+ return this.expression.isFunctionalType();
+ }
+
public char[] qualifiedSourceName() {
return readableName();
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.java
index 6a42546..80dbfe9 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemMethodBinding.java
@@ -40,6 +40,10 @@
this.returnType = closestMatch.returnType;
}
}
+@Override
+public MethodBinding shallowOriginal() {
+ return this.closestMatch == null ? this : this.closestMatch.shallowOriginal();
+}
/* API
* Answer the problem id associated with the receiver.
* NoError if the receiver is a valid binding.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
index 0d540e5..b4199da 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java
@@ -40,7 +40,10 @@
final int NonStaticOrAlienTypeReceiver = 20;
final int AttemptToBypassDirectSuper = 21; // super access within default method
final int DefectiveContainerAnnotationType = 22;
- final int ParameterizedMethodExpectedTypeProblem = 23;
+ final int InvocationTypeInferenceFailure = 23;
final int ApplicableMethodOverriddenByInapplicable = 24;
final int ContradictoryNullAnnotations = 25;
+ final int NoSuchMethodOnArray = 26;
+ final int InferredApplicableMethodInapplicable = 27; // 18.5.1 ignores arguments not pertinent to applicability. When these are taken into consideration method could fail applicability
+ final int NoProperEnclosingInstance = 28;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
index 8b55951..2791de4 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java
@@ -14,6 +14,7 @@
* Bug 423504 - [1.8] Implement "18.5.3 Functional Interface Parameterization Inference"
* Bug 425783 - An internal error occurred during: "Requesting Java AST from selection". java.lang.StackOverflowError
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -80,20 +81,13 @@
return new RawTypeBinding(this.actualType(), (ReferenceBinding) outerType, this.environment);
}
- public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
- if (!hasTypeAnnotations())
+ @Override
+ public TypeBinding withoutToplevelNullAnnotation() {
+ if (!hasNullTypeAnnotations())
return this;
- if (removeOnlyNullAnnotations && !hasNullTypeAnnotations())
- return this;
- if (removeOnlyNullAnnotations) {
ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.environment.getUnannotatedType(this.genericType());
AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
- ReferenceBinding newEnclosing = null;
- if (this.enclosingType() != null)
- newEnclosing = (ReferenceBinding)this.enclosingType().unannotated(removeOnlyNullAnnotations);
- return this.environment.createRawType(unannotatedGenericType, newEnclosing, newAnnotations);
- }
- return this.environment.getUnannotatedType(this);
+ return this.environment.createRawType(unannotatedGenericType, this.enclosingType(), newAnnotations);
}
/**
@@ -197,8 +191,8 @@
}
public boolean isProperType(boolean admitCapture18) {
- TypeBinding type = actualType();
- return type != null && type.isProperType(admitCapture18);
+ TypeBinding actualType = actualType();
+ return actualType != null && actualType.isProperType(admitCapture18);
}
protected void initializeArguments() {
@@ -213,6 +207,16 @@
}
@Override
+ public ParameterizedTypeBinding capture(Scope scope, int start, int end) {
+ return this;
+ }
+
+ @Override
+ public TypeBinding uncapture(Scope scope) {
+ return this;
+ }
+
+ @Override
TypeBinding substituteInferenceVariable(InferenceVariable var, TypeBinding substituteType) {
// NEVER substitute the type arguments of a raw type
return this;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java
index cb4fbd1..bc38bc9 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReductionResult.java
@@ -26,7 +26,6 @@
public Object reduce(InferenceContext18 context) { return this; }
public String toString() { return "FALSE"; } //$NON-NLS-1$
};
- /** Used to accept unchecked conversion to make ecj conform with javac bug https://bugs.openjdk.java.net/browse/JDK-8026527 */
// Relation kinds, mimic an enum:
protected static final int COMPATIBLE = 1;
@@ -36,6 +35,7 @@
protected static final int TYPE_ARGUMENT_CONTAINED = 5;
protected static final int CAPTURE = 6;
static final int EXCEPTIONS_CONTAINED = 7;
+ protected static final int POTENTIALLY_COMPATIBLE = 8;
protected TypeBinding right; // note that the LHS differs between sub-classes.
protected int relation;
@@ -44,6 +44,7 @@
switch (relation) {
case SAME: return " = "; //$NON-NLS-1$
case COMPATIBLE: return " \u2192 "; //$NON-NLS-1$
+ case POTENTIALLY_COMPATIBLE: return " \u2192? "; //$NON-NLS-1$
case SUBTYPE: return " <: "; //$NON-NLS-1$
case SUPERTYPE: return " :> "; //$NON-NLS-1$
case TYPE_ARGUMENT_CONTAINED:
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index d0378d1..823b8ad 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -32,9 +32,14 @@
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 431581 - Eclipse compiles what it should not
* Bug 440759 - [1.8][null] @NonNullByDefault should never affect wildcards and uses of a type variable
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ * Bug 446442 - [1.8] merge null annotations from super methods
+ * Bug 456532 - [1.8][null] ReferenceBinding.appendNullAnnotation() includes phantom annotations in error messages
* Jesper S Moller - Contributions for
* bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
* bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
+ * Ulrich Grave <ulrich.grave@gmx.de> - Contributions for
+ * bug 386692 - Missing "unused" warning on "autowired" fields
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -43,9 +48,12 @@
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullAnnotationMatching;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
/*
@@ -883,10 +891,20 @@
}
break;
case 6:
+ if (CharOperation.equals(TypeConstants.ORG, this.compoundName[0])) {
+ if (CharOperation.equals(TypeConstants.SPRING, this.compoundName[1])) {
+ if (CharOperation.equals(TypeConstants.AUTOWIRED, this.compoundName[5])) {
+ if (CharOperation.equals(TypeConstants.ORG_SPRING_AUTOWIRED, this.compoundName)) {
+ this.id = TypeIds.T_OrgSpringframeworkBeansFactoryAnnotationAutowired;
+ }
+ }
+ return;
+ }
if (!CharOperation.equals(TypeConstants.JDT, this.compoundName[2]) || !CharOperation.equals(TypeConstants.ITYPEBINDING, this.compoundName[5]))
return;
if (CharOperation.equals(TypeConstants.ORG_ECLIPSE_JDT_CORE_DOM_ITYPEBINDING, this.compoundName))
this.typeBits |= TypeIds.BitUninternedType;
+ }
break;
case 7 :
if (!CharOperation.equals(TypeConstants.JDT, this.compoundName[2]) || !CharOperation.equals(TypeConstants.TYPEBINDING, this.compoundName[6]))
@@ -897,6 +915,10 @@
}
}
+public void computeId(LookupEnvironment environment) {
+ environment.getUnannotatedType(this);
+}
+
/**
* p.X<T extends Y & I, U extends Y> {} -> Lp/X<TT;TU;>;
*/
@@ -1345,6 +1367,18 @@
return isCompatibleWith(otherLowerBound);
}
}
+ if (otherType instanceof InferenceVariable) {
+ // may interpret InferenceVariable as a joker, but only when within an outer lambda inference:
+ if (captureScope != null) {
+ MethodScope methodScope = captureScope.methodScope();
+ if (methodScope != null) {
+ ReferenceContext referenceContext = methodScope.referenceContext;
+ if (referenceContext instanceof LambdaExpression
+ && ((LambdaExpression)referenceContext).inferenceContext != null)
+ return true;
+ }
+ }
+ }
//$FALL-THROUGH$
case Binding.GENERIC_TYPE :
case Binding.TYPE :
@@ -1365,7 +1399,7 @@
if (this instanceof TypeVariableBinding && captureScope != null) {
TypeVariableBinding typeVariable = (TypeVariableBinding) this;
if (typeVariable.firstBound instanceof ParameterizedTypeBinding) {
- TypeBinding bound = typeVariable.firstBound.capture(captureScope, -1); // no position needed as this capture will never escape this context
+ TypeBinding bound = typeVariable.firstBound.capture(captureScope, -1, -1); // no position needed as this capture will never escape this context
return bound.isCompatibleWith(otherReferenceType);
}
}
@@ -1679,6 +1713,14 @@
protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) {
if (options.isAnnotationBasedNullAnalysisEnabled) {
+ if (options.usesNullTypeAnnotations()) {
+ for (AnnotationBinding annotation : this.typeAnnotations) {
+ TypeBinding annotationType = annotation.getAnnotationType();
+ if (annotationType.id == TypeIds.T_ConfiguredAnnotationNonNull || annotation.type.id == TypeIds.T_ConfiguredAnnotationNullable) {
+ nameBuffer.append('@').append(annotationType.shortReadableName()).append(' ');
+ }
+ }
+ } else {
// restore applied null annotation from tagBits:
if ((this.tagBits & TagBits.AnnotationNonNull) != 0) {
char[][] nonNullAnnotationName = options.nonNullAnnotationName;
@@ -1690,6 +1732,7 @@
}
}
}
+}
public AnnotationHolder retrieveAnnotationHolder(Binding binding, boolean forceInitialization) {
SimpleLookupTable store = storedAnnotations(forceInitialization);
@@ -1969,19 +2012,18 @@
continue;
if (!method.isValidBinding())
throw new InvalidInputException("Not a functional interface"); //$NON-NLS-1$
- if (method.isDefaultMethod()) {
for (int j = 0; j < contractsCount; j++) {
if (contracts[j] == null)
continue;
if (MethodVerifier.doesMethodOverride(method, contracts[j], scope.environment())) {
contractsCount--;
- // abstract method from super type rendered default by present interface ==> contracts[j] = null;
+ // abstract method from super type overridden by present interface ==> contracts[j] = null;
if (j < contractsCount)
System.arraycopy(contracts, j+1, contracts, j, contractsCount - j);
}
}
+ if (method.isDefaultMethod())
continue; // skip default method itself
- }
if (contractsCount == contractsLength) {
System.arraycopy(contracts, 0, contracts = new MethodBinding[contractsLength += 16], 0, contractsCount);
}
@@ -2032,11 +2074,14 @@
final LookupEnvironment environment = scope.environment();
boolean genericMethodSeen = false;
int length = methods.length;
+ boolean analyseNullAnnotations = environment.globalOptions.isAnnotationBasedNullAnalysisEnabled;
next:for (int i = length - 1; i >= 0; --i) {
MethodBinding method = methods[i], otherMethod = null;
if (method.typeVariables != Binding.NO_TYPE_VARIABLES)
genericMethodSeen = true;
+ TypeBinding returnType = method.returnType;
+ TypeBinding[] parameters = method.parameters;
for (int j = 0; j < length; j++) {
if (i == j) continue;
otherMethod = methods[j];
@@ -2050,6 +2095,10 @@
}
if (!MethodVerifier.isSubstituteParameterSubsignature(method, otherMethod, environment) || !MethodVerifier.areReturnTypesCompatible(method, otherMethod, environment))
continue next;
+ if (analyseNullAnnotations) {
+ returnType = NullAnnotationMatching.strongerType(returnType, otherMethod.returnType, environment);
+ parameters = NullAnnotationMatching.weakerTypes(parameters, otherMethod.parameters, environment);
+ }
}
// If we reach here, we found a method that is override equivalent with every other method and is also return type substitutable. Compute kosher exceptions now ...
ReferenceBinding [] exceptions = new ReferenceBinding[0];
@@ -2115,8 +2164,8 @@
}
this.singleAbstractMethod[index] = new MethodBinding(theAbstractMethod.modifiers | ClassFileConstants.AccSynthetic,
theAbstractMethod.selector,
- theAbstractMethod.returnType,
- theAbstractMethod.parameters,
+ returnType,
+ parameters,
exceptions,
theAbstractMethod.declaringClass);
this.singleAbstractMethod[index].typeVariables = theAbstractMethod.typeVariables;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index cd75d5f..351746f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -43,6 +43,13 @@
* Bug 429424 - [1.8][inference] Problem inferring type of method's parameter
* Bug 429958 - [1.8][null] evaluate new DefaultLocation attribute of @NonNullByDefault
* Bug 434570 - Generic type mismatch for parametrized class annotation attribute with inner class
+ * Bug 434483 - [1.8][compiler][inference] Type inference not picked up with method reference
+ * Bug 441734 - [1.8][inference] Generic method with nested parameterized type argument fails on method reference
+ * Bug 452194 - Code no longer compiles in 4.4.1, but with confusing error
+ * Bug 452788 - [1.8][compiler] Type not correctly inferred in lambda expression
+ * Bug 456236 - [1.8][null] Cannot infer type when constructor argument is annotated with @Nullable
+ * Bug 437072 - [compiler][null] Null analysis emits possibly incorrect warning for new int[][] despite @NonNullByDefault
+ * Bug 462083 - [1.8][inference] Java 8 generic return type mismatch with interface involving type parameter.
* Jesper S Moller - Contributions for
* Bug 378674 - "The method can be declared as static" is wrong
* Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
@@ -85,17 +92,6 @@
public static final int NOT_RELATED = 0;
public static final int MORE_GENERIC = 1;
- /*
- * Flags for PGMB.computeCompatibleMethod() and its callers, to request
- * which of two levels of inference should be performed (or both).
- */
- /** Request Invocation Applicability Inference (18.5.1). */
- public static final int APPLICABILITY = 1;
- /** Request Invocation Type Inference (18.5.2). */
- public static final int INVOCATION_TYPE = 2;
- /** Request both {@link #APPLICABILITY} and {@link #INVOCATION_TYPE} inference. */
- public static final int FULL_INFERENCE = APPLICABILITY | INVOCATION_TYPE;
-
public int kind;
public Scope parent;
@@ -554,6 +550,14 @@
}
break;
+ case Binding.INTERSECTION_TYPE18:
+ IntersectionTypeBinding18 intersection = (IntersectionTypeBinding18) originalType;
+ ReferenceBinding[] types = intersection.getIntersectingTypes();
+ TypeBinding[] substitutes = substitute(substitution, types);
+ ReferenceBinding[] refSubsts = new ReferenceBinding[substitutes.length];
+ System.arraycopy(substitutes, 0, refSubsts, 0, substitutes.length);
+ return substitution.environment().createIntersectionType18(refSubsts);
+
case Binding.TYPE:
if (!originalType.isMemberType()) break;
ReferenceBinding originalReferenceType = (ReferenceBinding) originalType;
@@ -691,8 +695,8 @@
* Will answer a substituted method in case the method was generic and type inference got triggered;
* in case the method was originally compatible, then simply answer it back.
*/
- protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite, int inferenceLevel) {
- return computeCompatibleMethod(method, arguments, invocationSite, inferenceLevel, false);
+ protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite) {
+ return computeCompatibleMethod(method, arguments, invocationSite, false);
}
/**
* Internal use only
@@ -700,8 +704,7 @@
* Will answer a substituted method in case the method was generic and type inference got triggered;
* in case the method was originally compatible, then simply answer it back.
*/
- protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments,
- InvocationSite invocationSite, int inferenceLevel, boolean tiebreakingVarargsMethods)
+ protected final MethodBinding computeCompatibleMethod(MethodBinding method, TypeBinding[] arguments, InvocationSite invocationSite, boolean tiebreakingVarargsMethods)
{
TypeBinding[] genericTypeArguments = invocationSite.genericTypeArguments();
TypeBinding[] parameters = method.parameters;
@@ -722,6 +725,7 @@
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330435, inference should kick in only at source 1.5+
if (typeVariables != Binding.NO_TYPE_VARIABLES && compilerOptions.sourceLevel >= ClassFileConstants.JDK1_5) { // generic method
TypeBinding[] newArgs = null;
+ if (compilerOptions.sourceLevel < ClassFileConstants.JDK1_8 || genericTypeArguments != null) { // for 1.8+ inferred calls, we do this inside PGMB.cCM18.
for (int i = 0; i < argLength; i++) {
TypeBinding param = i < paramLength ? parameters[i] : parameters[paramLength - 1];
if (arguments[i].isBaseType() != param.isBaseType()) {
@@ -732,13 +736,18 @@
newArgs[i] = environment().computeBoxingType(arguments[i]);
}
}
+ }
if (newArgs != null)
arguments = newArgs;
- else // ensure that computeCompatibleMethod() below can update arguments without harming our caller: (TODO: always copy before the loop? only in 1.8?)
- System.arraycopy(arguments, 0, arguments=new TypeBinding[argLength], 0, argLength);
- method = ParameterizedGenericMethodBinding.computeCompatibleMethod(method, arguments, this, invocationSite, inferenceLevel);
+ method = ParameterizedGenericMethodBinding.computeCompatibleMethod(method, arguments, this, invocationSite);
if (method == null) return null; // incompatible
if (!method.isValidBinding()) return method; // bound check issue is taking precedence
+ if (compilerOptions.sourceLevel >= ClassFileConstants.JDK1_8 && method instanceof ParameterizedGenericMethodBinding && invocationSite instanceof Invocation) {
+ Invocation invocation = (Invocation) invocationSite;
+ InferenceContext18 infCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) method);
+ if (infCtx != null)
+ return method; // inference is responsible, no need to recheck.
+ }
} else if (genericTypeArguments != null && compilerOptions.complianceLevel < ClassFileConstants.JDK1_7) {
if (method instanceof ParameterizedGenericMethodBinding) {
if (!((ParameterizedGenericMethodBinding) method).wasInferred)
@@ -747,13 +756,15 @@
} else if (!method.isOverriding() || !isOverriddenMethodGeneric(method)) {
return new ProblemMethodBinding(method, method.selector, genericTypeArguments, ProblemReasons.TypeParameterArityMismatch);
}
+ } else if (typeVariables == Binding.NO_TYPE_VARIABLES && method instanceof PolyParameterizedGenericMethodBinding) {
+ return method;
}
if (tiebreakingVarargsMethods) {
if (CompilerOptions.tolerateIllegalAmbiguousVarargsInvocation && compilerOptions.complianceLevel < ClassFileConstants.JDK1_7)
tiebreakingVarargsMethods = false;
}
- if ((parameterCompatibilityLevel18(method, arguments, tiebreakingVarargsMethods, invocationSite)) > NOT_COMPATIBLE) {
+ if ((parameterCompatibilityLevel(method, arguments, tiebreakingVarargsMethods)) > NOT_COMPATIBLE) {
if ((method.tagBits & TagBits.AnnotationPolymorphicSignature) != 0) {
// generate polymorphic method
return this.environment().createPolymorphicMethod(method, arguments);
@@ -765,151 +776,12 @@
// in which case this problem category will be bogus
if (genericTypeArguments != null && typeVariables != Binding.NO_TYPE_VARIABLES)
return new ProblemMethodBinding(method, method.selector, arguments, ProblemReasons.ParameterizedMethodTypeMismatch);
+ // 18.5.1 ignores arguments not pertinent to applicability. When these are taken into consideration method could fail applicability (e.g, lambda shape/arity mismatch ...)
+ if (method instanceof PolyParameterizedGenericMethodBinding) // Not reached, but left in for now.
+ return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.InferredApplicableMethodInapplicable);
return null; // incompatible
}
- private int parameterCompatibilityLevel18(MethodBinding method, TypeBinding[] arguments, boolean tiebreakingVarargsMethods, InvocationSite site) {
- jdk18checks:
- if (site instanceof Invocation && compilerOptions().complianceLevel >= ClassFileConstants.JDK1_8) {
- Invocation invocation = (Invocation) site;
- if (method instanceof ParameterizedGenericMethodBinding) {
- InferenceContext18 infCtx = invocation.getInferenceContext((ParameterizedGenericMethodBinding) method);
- if (infCtx != null) {
- // inference is responsible, no need to recheck
- if (infCtx.isVarArgs())
- return VARARGS_COMPATIBLE;
- return COMPATIBLE;
- }
- }
- // collect inner invocations where the outer did not involve any inference:
- Expression[] invocationArguments = invocation.arguments();
- if (invocationArguments != null) {
- InnerInferenceHelper innerInferenceHelper = invocation.innerInferenceHelper();
- int argLen = invocationArguments.length;
- boolean isVarArgs[] = new boolean[1]; // emulate an in-out parameter for compatibilityLevel18FromInner(..)
- isVarArgs[0] = method.isVarargs() && argLen != method.parameters.length; // if same lengths, isVarArgs can still be updated below
- int level = COMPATIBLE;
- for (int i = 0; i < argLen; i++) {
- TypeBinding argumentType = i < arguments.length ? arguments[i] : null; // length mismatch may happen from CodeSnippetMessageSend.resolveType() in the if (argHasError) block.
- int nextLevel = compatibilityLevel18FromInner(method, innerInferenceHelper, invocationArguments[i], argumentType, argLen, i, isVarArgs);
- if (nextLevel == NOT_COMPATIBLE)
- return nextLevel;
- if (nextLevel == -2)
- break jdk18checks;
- level = Math.max(level, nextLevel);
- }
- return level; // neither NOT_COMPATIBLE nor unknown(-2) seen
- }
- }
- // fall back to old method:
- return parameterCompatibilityLevel(method, arguments, tiebreakingVarargsMethods);
- }
-
- private int compatibilityLevel18FromInner(MethodBinding method, InnerInferenceHelper innerInferenceHelper, Expression invocArg, TypeBinding argType, int argLen, int i, boolean[] isVarArgs)
- {
- int compatible = isVarArgs[0] ? VARARGS_COMPATIBLE : COMPATIBLE;
- TypeBinding resolvedType = invocArg.resolvedType;
- TypeBinding targetType = InferenceContext18.getParameter(method.parameters, i, isVarArgs[0]);
- if (!isVarArgs[0] && shouldTryVarargs(method, resolvedType, targetType)) {
- isVarArgs[0] = true;
- targetType = InferenceContext18.getParameter(method.parameters, i, true);
- }
- if (targetType == null)
- return NOT_COMPATIBLE; // mismatching number of args or other severe problem inside method binding
- int level = -2; // don't know
- if (invocArg instanceof Invocation && resolvedType != null) {
- Invocation innerPoly = (Invocation) invocArg;
- level = parameterCompatibilityLevel(resolvedType, targetType);
- if (level != NOT_COMPATIBLE) {
- if (TypeBinding.notEquals(argType, resolvedType) && innerInferenceHelper != null)
- innerInferenceHelper.registerInnerResult(method, resolvedType, argLen, i);
- return Math.max(compatible, level);
- } else {
- MethodBinding innerBinding = innerPoly.binding(null, false, null); // 1. try without update
- if (innerBinding instanceof ParameterizedGenericMethodBinding) {
- ParameterizedGenericMethodBinding innerParameterized = (ParameterizedGenericMethodBinding) innerBinding;
- InferenceContext18 infCtx18 = innerPoly.getInferenceContext(innerParameterized);
- if (infCtx18 != null && !infCtx18.hasResultFor(targetType)) {
- // not detected as compatible, because inference still needs to complete?
- invocArg.setExpectedType(targetType);
- MethodBinding solution = infCtx18.inferInvocationType(innerPoly, innerParameterized);
- if (solution != null && solution.isValidBinding()) {
- if (innerPoly.updateBindings(solution, targetType)) {
- if (innerInferenceHelper != null)
- innerInferenceHelper.registerInnerResult(method, invocArg.resolvedType, argLen, i);
- }
- if (solution.returnType != null) {
- level = parameterCompatibilityLevel(solution.returnType, targetType);
- if (level != NOT_COMPATIBLE)
- return Math.max(compatible, level);
- }
- }
- invocArg.setExpectedType(null);
- return NOT_COMPATIBLE;
- } else if (innerPoly instanceof AllocationExpression) {
- // not detected as compatible, because its a diamond whose type hasn't yet been inferred?
- TypeBinding[] typeArguments = resolvedType.typeArguments();
- if (typeArguments != null && typeArguments.length == 0) {
- AllocationExpression alloc = (AllocationExpression) innerPoly;
- if ((alloc.type.bits & ASTNode.IsDiamond) != 0) {
- // not-yet-inferred diamond: erasure compatibility should suffice, detail will be checked using inference
- if (resolvedType.isCompatibleWith(targetType.erasure(), this))
- return compatible;
- return NOT_COMPATIBLE;
- }
- }
- }
- } else if (innerPoly instanceof AllocationExpression) {
- MethodBinding updatedMethod = innerPoly.binding(targetType, false, null); // 2. try with updating
- if (updatedMethod != innerBinding && updatedMethod != null) {
- if (updatedMethod.isValidBinding()) {
- if (updatedMethod.declaringClass.isCompatibleWith(targetType))
- return compatible;
- return NOT_COMPATIBLE;
- } else if (updatedMethod.problemId() == ProblemReasons.Ambiguous) {
- level = -2; // neither good nor bad, answer "unknown"
- }
- }
- }
- }
- } else if (invocArg.isPolyExpression()) {
- if (invocArg instanceof ConditionalExpression) {
- ConditionalExpression ce = (ConditionalExpression) invocArg;
- int level1 = compatibilityLevel18FromInner(method, innerInferenceHelper, ce.valueIfTrue, argType, argLen, i, isVarArgs);
- if (level1 == NOT_COMPATIBLE)
- return NOT_COMPATIBLE;
- int level2 = compatibilityLevel18FromInner(method, innerInferenceHelper, ce.valueIfFalse, argType, argLen, i, isVarArgs);
- if (level2 == NOT_COMPATIBLE)
- return NOT_COMPATIBLE;
- return Math.max(level1, level2);
- }
- // LE or RE:
- if (invocArg.isCompatibleWith(targetType, this))
- return COMPATIBLE;
- if (!isVarArgs[0] && method.isVarargs()) { // can't use shouldTryVarargs without a resolvedType, so just try it:
- isVarArgs[0] = true;
- targetType = InferenceContext18.getParameter(method.parameters, i, true);
- if (targetType != null && invocArg.isCompatibleWith(targetType, this))
- return VARARGS_COMPATIBLE;
- }
- return NOT_COMPATIBLE;
- } else if (resolvedType != null && resolvedType.isValidBinding()) {
- // need to handle "normal" expressions too, since mixed poly/standalone argument lists must be fully analyzed.
- return parameterCompatibilityLevel(resolvedType, targetType);
- }
- return level;
- }
-
- private boolean shouldTryVarargs(MethodBinding method, TypeBinding resolvedType, TypeBinding targetType) {
- if (!method.isVarargs())
- return false;
- if (targetType == null)
- return true; // off range
- if (targetType.isArrayType() && resolvedType != null && !resolvedType.isCompatibleWith(targetType, this))
- return true; // not a direct match but hope to improve
- return false;
- }
-
/**
* Connect type variable supertypes, and returns true if no problem was detected
* @param typeParameters
@@ -965,8 +837,8 @@
problemReporter().forwardTypeVariableReference(typeParameter, varSuperType);
typeVariable.tagBits |= TagBits.HierarchyHasProblems;
break firstBound; // do not keep first bound
- }
- }
+ }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=335751
if (compilerOptions().complianceLevel > ClassFileConstants.JDK1_6) {
if (typeVariable.rank >= varSuperType.rank && varSuperType.declaringElement == typeVariable.declaringElement) {
@@ -981,27 +853,27 @@
} else {
set.add(superBinding);
superBinding = ((TypeVariableBinding)superBinding).superclass;
- }
- }
- }
- }
+ }
+ }
+ }
+ }
break;
default :
if (((ReferenceBinding) superType).isFinal()) {
problemReporter().finalVariableBound(typeVariable, typeRef);
- }
+ }
break;
}
ReferenceBinding superRefType = (ReferenceBinding) superType;
if (!superType.isInterface()) {
typeVariable.setSuperClass(superRefType);
- } else {
+ } else {
typeVariable.setSuperInterfaces(new ReferenceBinding[] {superRefType});
- }
+ }
typeVariable.tagBits |= superType.tagBits & TagBits.ContainsNestedTypeReferences;
typeVariable.setFirstBound(superRefType); // first bound used to compute erasure
- }
- }
+ }
+ }
TypeReference[] boundRefs = typeParameter.bounds;
if (boundRefs != null) {
nextBound: for (int j = 0, boundLength = boundRefs.length; j < boundLength; j++) {
@@ -1259,7 +1131,7 @@
InvocationSite invocationSite,
ReferenceBinding classHierarchyStart,
ObjectVector found,
- MethodBinding concreteMatch) {
+ MethodBinding [] concreteMatches) {
int startFoundSize = found.size;
final boolean sourceLevel18 = this.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8;
@@ -1269,23 +1141,29 @@
findMethodInSuperInterfaces(currentType, selector, found, visitedTypes, invocationSite);
currentType = currentType.superclass();
}
- MethodBinding[] candidates = null;
- int candidatesCount = 0;
- MethodBinding problemMethod = null;
+
+ int candidatesCount = concreteMatches == null ? 0 : concreteMatches.length;
int foundSize = found.size;
+ MethodBinding[] candidates = new MethodBinding[foundSize - startFoundSize + candidatesCount];
+ if (concreteMatches != null)
+ System.arraycopy(concreteMatches, 0, candidates, 0, candidatesCount);
+
+ MethodBinding problemMethod = null;
if (foundSize > startFoundSize) {
// argument type compatibility check
final MethodVerifier methodVerifier = environment().methodVerifier();
next:
for (int i = startFoundSize; i < foundSize; i++) {
MethodBinding methodBinding = (MethodBinding) found.elementAt(i);
- MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite, APPLICABILITY);
+ MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite);
if (compatibleMethod != null) {
if (compatibleMethod.isValidBinding()) {
- if (concreteMatch != null) {
- if (methodVerifier.areMethodsCompatible(concreteMatch, compatibleMethod))
+ if (concreteMatches != null) {
+ for (int j = 0, length = concreteMatches.length; j < length; j++) {
+ if (methodVerifier.areMethodsCompatible(concreteMatches[j], compatibleMethod))
continue; // can skip this method since concreteMatch overrides it
}
+ }
if (sourceLevel18 || !(compatibleMethod.isVarargs() && compatibleMethod instanceof ParameterizedGenericMethodBinding)) {
for (int j = 0; j < startFoundSize; j++) {
MethodBinding classMethod = (MethodBinding) found.elementAt(j);
@@ -1293,11 +1171,6 @@
continue next; // can skip this method since classMethod overrides it
}
}
- if (candidatesCount == 0) {
- candidates = new MethodBinding[foundSize - startFoundSize + 1];
- if (concreteMatch != null)
- candidates[candidatesCount++] = concreteMatch;
- }
candidates[candidatesCount++] = compatibleMethod;
} else if (problemMethod == null) {
problemMethod = compatibleMethod;
@@ -1305,15 +1178,14 @@
}
}
}
-
+ MethodBinding concreteMatch = null;
if (candidatesCount < 2) {
- if (concreteMatch == null) {
+ if (concreteMatches == null) {
if (candidatesCount == 0)
return problemMethod; // can be null
- concreteMatch = candidates[0];
}
- // 1.8: Give inference a chance to perform outstanding tasks (18.5.2):
- concreteMatch = inferInvocationType(invocationSite, concreteMatch, argumentTypes);
+ concreteMatch = candidates[0];
+ if (concreteMatch != null)
compilationUnitScope().recordTypeReferences(concreteMatch.thrownExceptions);
return concreteMatch;
}
@@ -1367,9 +1239,20 @@
if (exactMethod != null && exactMethod.typeVariables == Binding.NO_TYPE_VARIABLES && !exactMethod.isBridge()) {
// in >= 1.5 mode, ensure the exactMatch did not match raw types
if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5)
- for (int i = argumentTypes.length; --i >= 0;)
- if (isPossibleSubtypeOfRawType(argumentTypes[i]))
+ for (int i = argumentTypes.length; --i >= 0;) {
+ // workaround for bug 464229: The type * cannot be resolved. It is indirectly referenced from required .class files
+ TypeBinding t = argumentTypes[i].leafComponentType();
+ if (! (t instanceof ReferenceBinding))
+ continue;
+ ReferenceBinding r = (ReferenceBinding)t;
+ if (r.isHierarchyConnected()) {
+ if (isSubtypeOfRawType(r))
+ return null;
+ } else if (r.isRawType()) {
return null;
+ }
+ //TODO: should also check if any supertype of r is raw, but can't do this without resolving the whole hierarchy
+ }
// must find both methods for this case: <S extends A> void foo() {} and <N extends B> N foo() { return null; }
// or find an inherited method when the exact match is to a bridge method
unitScope.recordTypeReferences(exactMethod.thrownExceptions);
@@ -1385,7 +1268,7 @@
// targeting a generic method could find an exact match with variable return type
if (invocationSite.genericTypeArguments() != null) {
// computeCompatibleMethod(..) will return a PolymorphicMethodBinding if needed
- exactMethod = computeCompatibleMethod(exactMethod, argumentTypes, invocationSite, FULL_INFERENCE);
+ exactMethod = computeCompatibleMethod(exactMethod, argumentTypes, invocationSite);
} else if ((exactMethod.tagBits & TagBits.AnnotationPolymorphicSignature) != 0) {
// generate polymorphic method
return this.environment().createPolymorphicMethod(exactMethod, argumentTypes);
@@ -1521,7 +1404,7 @@
unitScope.recordTypeReference(currentType);
currentType.initializeForStaticImports();
- currentType = (ReferenceBinding) currentType.capture(this, invocationSite == null ? 0 : invocationSite.sourceEnd());
+ currentType = (ReferenceBinding) currentType.capture(this, invocationSite == null ? 0 : invocationSite.sourceStart(), invocationSite == null ? 0 : invocationSite.sourceEnd());
if ((field = currentType.getField(fieldName, needResolve, invocationSite, this)) != null) { // AspectJ Extension - was getField(fieldName,needResolve)
if (invisibleFieldsOk) {
return field;
@@ -1725,13 +1608,13 @@
ObjectVector found = new ObjectVector(3);
CompilationUnitScope unitScope = compilationUnitScope();
unitScope.recordTypeReferences(argumentTypes);
-
+ List<TypeBinding> visitedTypes = new ArrayList<TypeBinding>();
if (receiverTypeIsInterface) {
unitScope.recordTypeReference(receiverType);
MethodBinding[] receiverMethods = receiverType.getMethods(selector, argumentTypes.length);
if (receiverMethods.length > 0)
found.addAll(receiverMethods);
- findMethodInSuperInterfaces(receiverType, selector, found, null, invocationSite);
+ findMethodInSuperInterfaces(receiverType, selector, found, visitedTypes, invocationSite);
currentType = getJavaLangObject();
}
@@ -1744,7 +1627,7 @@
MethodVerifier verifier = environment().methodVerifier();
while (currentType != null) {
unitScope.recordTypeReference(currentType);
- currentType = (ReferenceBinding) currentType.capture(this, invocationSite == null ? 0 : invocationSite.sourceEnd());
+ currentType = (ReferenceBinding) currentType.capture(this, invocationSite == null ? 0 : invocationSite.sourceStart(), invocationSite == null ? 0 : invocationSite.sourceEnd());
MethodBinding[] currentMethods = currentType.getMethods(selector, argumentTypes.length);
int currentLength = currentMethods.length;
if (currentLength > 0) {
@@ -1806,22 +1689,13 @@
// argument type compatibility check
for (int i = 0; i < foundSize; i++) {
MethodBinding methodBinding = (MethodBinding) found.elementAt(i);
- MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite, APPLICABILITY);
+ MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite);
if (compatibleMethod != null) {
if (compatibleMethod.isValidBinding()) {
if (foundSize == 1 && compatibleMethod.canBeSeenBy(receiverType, invocationSite, this)) {
// return the single visible match now
if (searchForDefaultAbstractMethod)
- return findDefaultAbstractMethod(receiverType, selector, argumentTypes, invocationSite, classHierarchyStart, found, compatibleMethod);
-// ==== 1.8: Finalize type inference of generic methods: ====
- MethodBinding improved = inferInvocationType(invocationSite, compatibleMethod, argumentTypes);
- if (improved.isValidBinding()) {
- compatibleMethod = improved;
- } else {
- problemMethod = improved;
- continue;
- }
-// ==== 1.8 ====
+ return findDefaultAbstractMethod(receiverType, selector, argumentTypes, invocationSite, classHierarchyStart, found, new MethodBinding [] {compatibleMethod});
unitScope.recordTypeReferences(compatibleMethod.thrownExceptions);
return compatibleMethod;
}
@@ -1900,6 +1774,8 @@
if (diff1 >= diff2)
continue nextMethod;
}
+ if (bestGuess != methodBinding && MethodVerifier.doesMethodOverride(bestGuess, methodBinding, this.environment()))
+ continue;
bestArgMatches = argMatches;
bestGuess = methodBinding;
}
@@ -1950,9 +1826,9 @@
candidate.isStatic() && candidate.declaringClass.isInterface() ? ProblemReasons.NonStaticOrAlienTypeReceiver : ProblemReasons.NotVisible);
case 1 :
if (searchForDefaultAbstractMethod)
- return findDefaultAbstractMethod(receiverType, selector, argumentTypes, invocationSite, classHierarchyStart, found, candidates[0]);
- // 1.8: Give inference a chance to perform outstanding tasks (18.5.2):
- candidate = inferInvocationType(invocationSite, candidates[0], argumentTypes);
+ return findDefaultAbstractMethod(receiverType, selector, argumentTypes, invocationSite, classHierarchyStart, found, new MethodBinding [] { candidates[0] });
+ candidate = candidates[0];
+ if (candidate != null)
unitScope.recordTypeReferences(candidate.thrownExceptions);
return candidate;
default :
@@ -1996,18 +1872,10 @@
if (staticCount > 1)
return mostSpecificMethodBinding(staticCandidates, staticCount, argumentTypes, invocationSite, receiverType);
}
-
- MethodBinding mostSpecificMethod = mostSpecificMethodBinding(candidates, visiblesCount, argumentTypes, invocationSite, receiverType);
- if (searchForDefaultAbstractMethod) { // search interfaces for a better match
- if (mostSpecificMethod.isValidBinding())
- // see if there is a better match in the interfaces - see AutoBoxingTest 99, LookupTest#81
- return findDefaultAbstractMethod(receiverType, selector, argumentTypes, invocationSite, classHierarchyStart, found, mostSpecificMethod);
- // see if there is a match in the interfaces - see LookupTest#84
- MethodBinding interfaceMethod = findDefaultAbstractMethod(receiverType, selector, argumentTypes, invocationSite, classHierarchyStart, found, null);
- if (interfaceMethod != null && interfaceMethod.isValidBinding() /* else return the same error as before */)
- return interfaceMethod;
- }
- return mostSpecificMethod;
+ if (visiblesCount != candidates.length)
+ System.arraycopy(candidates, 0, candidates = new MethodBinding[visiblesCount], 0, visiblesCount);
+ return searchForDefaultAbstractMethod ? findDefaultAbstractMethod(receiverType, selector, argumentTypes, invocationSite, classHierarchyStart, found, candidates)
+ : mostSpecificMethodBinding(candidates, visiblesCount, argumentTypes, invocationSite, receiverType);
}
// Internal use only
@@ -2046,7 +1914,7 @@
}
methodBinding = findMethod(object, selector, argumentTypes, invocationSite, false);
if (methodBinding == null)
- return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NotFound);
+ return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NoSuchMethodOnArray);
return methodBinding;
}
@@ -2067,7 +1935,7 @@
visitedTypes.add(uncaptured);
}
compilationUnitScope().recordTypeReference(currentType);
- currentType = (ReferenceBinding) currentType.capture(this, invocationSite == null ? 0 : invocationSite.sourceEnd());
+ currentType = (ReferenceBinding) currentType.capture(this, invocationSite == null ? 0 : invocationSite.sourceStart(), invocationSite == null ? 0 : invocationSite.sourceEnd());
MethodBinding[] currentMethods = currentType.getMethods(selector);
if (currentMethods.length > 0) {
int foundSize = found.size;
@@ -2404,7 +2272,7 @@
private static final long serialVersionUID = -7996779527641476028L;
}
- // For exact method references. 15.28.1
+ // For exact method references. 15.13.1
private MethodBinding getExactMethod(TypeBinding receiverType, TypeBinding type, char[] selector, InvocationSite invocationSite, MethodBinding candidate) {
if (type == null)
@@ -2419,7 +2287,7 @@
CompilationUnitScope unitScope = compilationUnitScope();
unitScope.recordTypeReference(type);
- type = type.capture(this, invocationSite.sourceEnd());
+ type = type.capture(this, invocationSite.sourceStart(), invocationSite.sourceEnd());
for (int i = 0, typesLength = typePlusSupertypes.length; i < typesLength; i++) {
MethodBinding[] methods = i == 0 ? type.getMethods(selector) : new MethodBinding [] { getExactMethod(receiverType, typePlusSupertypes[i], selector, invocationSite, candidate) };
@@ -2440,7 +2308,7 @@
return candidate;
}
- // For exact method references. 15.28.1
+ // For exact method references. 15.13.1
public MethodBinding getExactMethod(TypeBinding receiverType, char[] selector, InvocationSite invocationSite) {
if (receiverType == null || !receiverType.isValidBinding() || receiverType.isBaseType())
return null;
@@ -2459,7 +2327,10 @@
}
if (exactMethod == null || !exactMethod.canBeSeenBy(invocationSite, this))
return null;
- if (exactMethod.isVarargs() || exactMethod.typeVariables() != Binding.NO_TYPE_VARIABLES && invocationSite.genericTypeArguments() == null)
+
+ final TypeBinding[] typeArguments = invocationSite.genericTypeArguments();
+ TypeVariableBinding[] typeVariables = exactMethod.typeVariables();
+ if (exactMethod.isVarargs() || (typeVariables != Binding.NO_TYPE_VARIABLES && (typeArguments == null || typeArguments.length != typeVariables.length)))
return null;
if (receiverType.isArrayType()) {
@@ -2474,10 +2345,14 @@
{
return environment().createGetClassMethod(receiverType, exactMethod, this);
}
+
+ if (typeVariables != Binding.NO_TYPE_VARIABLES)
+ return environment().createParameterizedGenericMethod(exactMethod, typeArguments);
+
return exactMethod;
}
- // For exact constructor references. 15.28.1
+ // For exact constructor references. 15.13.1
public MethodBinding getExactConstructor(TypeBinding receiverType, InvocationSite invocationSite) {
if (receiverType == null || !receiverType.isValidBinding() || !receiverType.canBeInstantiated() || receiverType.isBaseType())
return null;
@@ -2496,13 +2371,14 @@
MethodBinding exactConstructor = null;
unitScope.recordTypeReference(receiverType);
MethodBinding[] methods = receiverType.getMethods(TypeConstants.INIT);
+ final TypeBinding[] genericTypeArguments = invocationSite.genericTypeArguments();
for (int i = 0, length = methods.length; i < length; i++) {
MethodBinding constructor = methods[i];
if (!constructor.canBeSeenBy(invocationSite, this))
continue;
if (constructor.isVarargs())
return null;
- if (constructor.typeVariables() != Binding.NO_TYPE_VARIABLES && invocationSite.genericTypeArguments() == null)
+ if (constructor.typeVariables() != Binding.NO_TYPE_VARIABLES && genericTypeArguments == null)
return null;
if (exactConstructor == null) {
exactConstructor = constructor;
@@ -2510,6 +2386,14 @@
return null;
}
}
+ if (exactConstructor != null) {
+ final TypeVariableBinding[] typeVariables = exactConstructor.typeVariables();
+ if (typeVariables != Binding.NO_TYPE_VARIABLES) {
+ if (typeVariables.length != genericTypeArguments.length)
+ return null;
+ exactConstructor = environment().createParameterizedGenericMethod(exactConstructor, genericTypeArguments);
+ }
+ }
return exactConstructor;
}
@@ -2542,7 +2426,7 @@
if (methodBinding != null && methodBinding.canBeSeenBy(invocationSite, this)) {
// targeting a non generic constructor with type arguments ?
if (invocationSite.genericTypeArguments() != null)
- methodBinding = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite, FULL_INFERENCE);
+ methodBinding = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite);
return methodBinding;
}
MethodBinding[] methods = receiverType.getMethods(TypeConstants.INIT, argumentTypes.length);
@@ -2556,7 +2440,7 @@
int compatibleIndex = 0;
MethodBinding problemMethod = null;
for (int i = 0, length = methods.length; i < length; i++) {
- MethodBinding compatibleMethod = computeCompatibleMethod(methods[i], argumentTypes, invocationSite, APPLICABILITY);
+ MethodBinding compatibleMethod = computeCompatibleMethod(methods[i], argumentTypes, invocationSite);
if (compatibleMethod != null) {
if (compatibleMethod.isValidBinding())
compatible[compatibleIndex++] = compatibleMethod;
@@ -2584,8 +2468,7 @@
} // AspectJ Extension - completes new if()
}
if (visibleIndex == 1) {
- // 1.8: Give inference a chance to perform outstanding tasks (18.5.2):
- return inferInvocationType(invocationSite, visible[0], argumentTypes);
+ return visible[0];
}
if (visibleIndex == 0)
return new ProblemMethodBinding(
@@ -2849,7 +2732,7 @@
if (foundProblem == null)
foundProblem = possible; // answer as error case match
} else if (possible.isStatic()) {
- MethodBinding compatibleMethod = computeCompatibleMethod(possible, argumentTypes, invocationSite, APPLICABILITY);
+ MethodBinding compatibleMethod = computeCompatibleMethod(possible, argumentTypes, invocationSite);
if (compatibleMethod != null) {
if (compatibleMethod.isValidBinding()) {
if (compatibleMethod.canBeSeenBy(unitScope.fPackage)) {
@@ -3019,7 +2902,8 @@
// retrieve an exact visible match (if possible)
MethodBinding methodBinding = findExactMethod(currentType, selector, argumentTypes, invocationSite);
- if (methodBinding != null) return methodBinding;
+ if (methodBinding != null && methodBinding.isValidBinding())
+ return methodBinding;
methodBinding = findMethod(currentType, selector, argumentTypes, invocationSite, false);
if (methodBinding == null)
@@ -3875,7 +3759,7 @@
return false;
}
- public boolean isPossibleSubtypeOfRawType(TypeBinding paramType) {
+ public boolean isSubtypeOfRawType(TypeBinding paramType) {
TypeBinding t = paramType.leafComponentType();
if (t.isBaseType()) return false;
@@ -3884,8 +3768,7 @@
int nextPosition = 0;
do {
if (currentType.isRawType()) return true;
- if (!currentType.isHierarchyConnected()) return true; // do not fault in super types right now, so assume one is a raw type
-
+ //if (!currentType.isHierarchyConnected()) return true; !! not correct, see bug 460993
ReferenceBinding[] itsInterfaces = currentType.superInterfaces();
if (itsInterfaces != null && itsInterfaces != Binding.NO_SUPERINTERFACES) {
if (interfacesToVisit == null) {
@@ -4487,33 +4370,28 @@
protected final MethodBinding mostSpecificMethodBinding(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, final InvocationSite invocationSite, ReferenceBinding receiverType) {
boolean isJdk18 = compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8;
-
+ if (isJdk18 && invocationSite.checkingPotentialCompatibility()) {
+ if (visibleSize != visible.length)
+ System.arraycopy(visible, 0, visible = new MethodBinding[visibleSize], 0, visibleSize);
+ invocationSite.acceptPotentiallyCompatibleMethods(visible);
+ }
// common part for all compliance levels:
int[] compatibilityLevels = new int[visibleSize];
int compatibleCount = 0;
- for (int i = 0; i < visibleSize; i++) {
- TypeBinding[] argTypes = argumentTypes;
- if (isJdk18 && invocationSite instanceof Invocation) {
- InnerInferenceHelper innerInferenceHelper = ((Invocation)invocationSite).innerInferenceHelper();
- if (innerInferenceHelper != null)
- argTypes = innerInferenceHelper.getArgumentTypesForCandidate(visible[i], argumentTypes);
- }
- if ((compatibilityLevels[i] = parameterCompatibilityLevel(visible[i], argTypes)) != NOT_COMPATIBLE) {
+ for (int i = 0; i < visibleSize; i++)
+ if ((compatibilityLevels[i] = parameterCompatibilityLevel(visible[i], argumentTypes, invocationSite)) != NOT_COMPATIBLE) {
if (i != compatibleCount) {
visible[compatibleCount] = visible[i];
compatibilityLevels[compatibleCount] = compatibilityLevels[i];
}
compatibleCount++;
}
- }
-// TODO: Disabled, because we know a situation where this is expected, see https://bugs.eclipse.org/429490
-// if (compatibleCount != visibleSize) {
-// problemReporter().genericInferenceProblem("(Recovered) Internal inconsistency while checking invocation ambiguity", invocationSite, ProblemSeverities.Warning); //$NON-NLS-1$
-// }
+
if (compatibleCount == 0) {
return new ProblemMethodBinding(visible[0].selector, argumentTypes, ProblemReasons.NotFound);
} else if (compatibleCount == 1) {
- MethodBinding candidate = inferInvocationType(invocationSite, visible[0], argumentTypes);
+ MethodBinding candidate = visible[0];
+ if (candidate != null)
compilationUnitScope().recordTypeReferences(candidate.thrownExceptions);
return candidate;
}
@@ -4522,8 +4400,8 @@
System.arraycopy(compatibilityLevels, 0, compatibilityLevels = new int[compatibleCount], 0, compatibleCount);
}
- MethodBinding[] moreSpecific = new MethodBinding[visibleSize];
+ MethodBinding[] moreSpecific = new MethodBinding[visibleSize];
if (isJdk18) {
// 15.12.2.5 Choosing the Most Specific Method
int count = 0;
@@ -4534,7 +4412,6 @@
int levelj = compatibilityLevels[j];
nextK: for (int k = 0; k < visibleSize; k++) {
if (j == k) continue;
- // TODO do we want to check existing inference contexts whether they can tell us better about the used inferenceKind?
int levelk = compatibilityLevels[k];
if (levelj > -1 && levelk > -1 && levelj != levelk) {
if (levelj < levelk)
@@ -4555,7 +4432,7 @@
} else {
expressions = ((ReferenceExpression)invocationSite).createPseudoExpressions(argumentTypes);
}
- InferenceContext18 ic18 = new InferenceContext18(this, expressions, null);
+ InferenceContext18 ic18 = new InferenceContext18(this, expressions, null, null);
if (!ic18.isMoreSpecificThan(mbj, mbk, levelj == VARARGS_COMPATIBLE, levelk == VARARGS_COMPATIBLE)) {
continue nextJ;
}
@@ -4570,14 +4447,21 @@
continue nextJ;
}
}
+ if (levelj == VARARGS_COMPATIBLE && levelk == VARARGS_COMPATIBLE) {
+ TypeBinding s = InferenceContext18.getParameter(mbjParameters, argumentTypes.length, true);
+ TypeBinding t = InferenceContext18.getParameter(mbkParameters, argumentTypes.length, true);
+ if (TypeBinding.notEquals(s, t) && t.isSubtypeOf(s))
+ continue nextJ;
+ }
}
- }
+ }
moreSpecific[count++] = visible[j];
}
if (count == 0) {
return new ProblemMethodBinding(visible[0], visible[0].selector, visible[0].parameters, ProblemReasons.Ambiguous);
} else if (count == 1) {
- MethodBinding candidate = inferInvocationType(invocationSite, moreSpecific[0], argumentTypes);
+ MethodBinding candidate = moreSpecific[0];
+ if (candidate != null)
compilationUnitScope().recordTypeReferences(candidate.thrownExceptions);
return candidate;
} else {
@@ -4601,6 +4485,9 @@
public boolean receiverIsImplicitThis() { return invocationSite.receiverIsImplicitThis();}
public InferenceContext18 freshInferenceContext(Scope scope) { return null; /* no inference when ignoring genericTypeArgs */ }
public ExpressionContext getExpressionContext() { return ExpressionContext.VANILLA_CONTEXT; }
+ public boolean isQualifiedSuper() { return invocationSite.isQualifiedSuper(); }
+ public boolean checkingPotentialCompatibility() { return false; }
+ public void acceptPotentiallyCompatibleMethods(MethodBinding[] methods) {/* ignore */}
};
int count = 0;
for (int level = 0, max = VARARGS_COMPATIBLE; level <= max; level++) {
@@ -4629,7 +4516,7 @@
}
}
MethodBinding acceptable = computeCompatibleMethod(methodToTest, tiebreakMethod.parameters,
- tieBreakInvocationSite, INVOCATION_TYPE, level == VARARGS_COMPATIBLE);
+ tieBreakInvocationSite, level == VARARGS_COMPATIBLE);
/* There are 4 choices to consider with current & next :
foo(B) & foo(A) where B extends A
1. the 2 methods are equal (both accept each others parameters) -> want to continue
@@ -4653,8 +4540,8 @@
if (count == 1) {
for (int i = 0; i < visibleSize; i++) {
if (moreSpecific[i] != null) {
- // 1.8: Give inference a chance to perform outstanding tasks (18.5.2):
- MethodBinding candidate = inferInvocationType(invocationSite, visible[i], argumentTypes);
+ MethodBinding candidate = visible[i];
+ if (candidate != null)
compilationUnitScope().recordTypeReferences(candidate.thrownExceptions);
return candidate;
}
@@ -4782,8 +4669,7 @@
if (mostSpecificExceptions != null && mostSpecificExceptions != current.thrownExceptions) {
return new MostSpecificExceptionMethodBinding(current, mostSpecificExceptions);
}
- // 1.8: Before returning give inference a chance to perform outstanding tasks (18.5.2):
- return inferInvocationType(invocationSite, current, argumentTypes);
+ return current;
}
}
@@ -4846,6 +4732,49 @@
} while (scope != null);
return lastMethodScope; // may answer null if no method around
}
+
+ // Version that just answers based on inference kind (at 1.8+) when available.
+ public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments, InvocationSite site) {
+ if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8 && method instanceof ParameterizedGenericMethodBinding) {
+ int inferenceKind = InferenceContext18.CHECK_UNKNOWN;
+ InferenceContext18 context = null;
+ if (site instanceof Invocation) {
+ Invocation invocation = (Invocation) site;
+ context = invocation.getInferenceContext((ParameterizedGenericMethodBinding) method);
+ if (context != null)
+ inferenceKind = context.inferenceKind;
+ } else if (site instanceof ReferenceExpression) {
+ ReferenceExpression referenceExpression = (ReferenceExpression) site;
+ context = referenceExpression.getInferenceContext((ParameterizedGenericMethodBinding) method);
+ if (context != null)
+ inferenceKind = context.inferenceKind;
+ }
+ /* 1.8+ Post inference compatibility check policy: For non-functional-type arguments, trust inference. For functional type arguments apply compatibility checks after inference
+ has completed to ensure arguments that were not pertinent to applicability which have only seen potential compatibility checks are actually compatible.
+ */
+ if (site instanceof Invocation && context != null && context.stepCompleted >= InferenceContext18.TYPE_INFERRED) {
+ for (int i = 0, length = arguments.length; i < length; i++) {
+ TypeBinding argument = arguments[i];
+ if (!argument.isFunctionalType())
+ continue;
+ TypeBinding parameter = InferenceContext18.getParameter(method.parameters, i, context.isVarArgs());
+ if (!argument.isCompatibleWith(parameter, this))
+ return NOT_COMPATIBLE;
+ }
+ }
+ switch (inferenceKind) {
+ case InferenceContext18.CHECK_STRICT:
+ return COMPATIBLE;
+ case InferenceContext18.CHECK_LOOSE:
+ return AUTOBOX_COMPATIBLE;
+ case InferenceContext18.CHECK_VARARG:
+ return VARARGS_COMPATIBLE;
+ default:
+ break;
+ }
+ }
+ return parameterCompatibilityLevel(method, arguments, false);
+ }
public int parameterCompatibilityLevel(MethodBinding method, TypeBinding[] arguments) {
return parameterCompatibilityLevel(method, arguments, false);
@@ -5048,7 +4977,7 @@
that could instead be invoked with identical results. Return null if no compatible, visible, most specific method
could be found. This method is modeled after Scope.getConstructor and Scope.getMethod.
*/
- public MethodBinding getStaticFactory (ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, final Invocation allocationSite) {
+ public MethodBinding getStaticFactory (ParameterizedTypeBinding allocationType, ReferenceBinding originalEnclosingType, TypeBinding[] argumentTypes, final InvocationSite allocationSite) {
// allocationType is the diamond type. originalEnclosingType is the real enclosing type ==> may be parameterized, parameterized with own type variables, raw, just plain type or null.
int classTypeVariablesArity = 0;
@@ -5068,7 +4997,7 @@
currentType = currentType.enclosingType();
}
- MethodBinding[] methods = genericType.getMethods(TypeConstants.INIT, argumentTypes.length);
+ MethodBinding[] methods = allocationType.getMethods(TypeConstants.INIT, argumentTypes.length);
MethodBinding [] staticFactories = new MethodBinding[methods.length];
int sfi = 0;
for (int i = 0, length = methods.length; i < length; i++) {
@@ -5087,7 +5016,7 @@
final int factoryArity = classTypeVariablesArity + methodTypeVariablesArity;
final LookupEnvironment environment = environment();
- MethodBinding staticFactory = new SyntheticFactoryMethodBinding(method, environment, originalEnclosingType);
+ MethodBinding staticFactory = new SyntheticFactoryMethodBinding(method.original(), environment, originalEnclosingType);
staticFactory.typeVariables = new TypeVariableBinding[factoryArity];
final SimpleLookupTable map = new SimpleLookupTable(factoryArity);
@@ -5101,13 +5030,13 @@
declaringElement = original.declaringElement;
prime += "'"; //$NON-NLS-1$
}
- map.put(original, staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(original.sourceName, prime.toCharArray()),
+ map.put(original.unannotated(), staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(original.sourceName, prime.toCharArray()),
staticFactory, j, environment));
}
// Rename each type variable U of method
prime += "'"; //$NON-NLS-1$
for (int j = classTypeVariablesArity, k = 0; j < factoryArity; j++, k++) {
- map.put(methodTypeVariables[k],
+ map.put(methodTypeVariables[k].unannotated(),
(staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(methodTypeVariables[k].sourceName, prime.toCharArray()),
staticFactory, j, environment)));
@@ -5121,7 +5050,7 @@
return false;
}
public TypeBinding substitute(TypeVariableBinding typeVariable) {
- TypeBinding retVal = (TypeBinding) map.get(typeVariable);
+ TypeBinding retVal = (TypeBinding) map.get(typeVariable.unannotated());
return retVal == null ? typeVariable : typeVariable.hasTypeAnnotations() ? environment().createAnnotatedType(retVal, typeVariable.getTypeAnnotations()) : retVal;
}
};
@@ -5129,7 +5058,7 @@
// initialize new variable bounds
for (int j = 0; j < factoryArity; j++) {
TypeVariableBinding originalVariable = j < classTypeVariablesArity ? classTypeVariables[j] : methodTypeVariables[j - classTypeVariablesArity];
- TypeVariableBinding substitutedVariable = (TypeVariableBinding) map.get(originalVariable);
+ TypeVariableBinding substitutedVariable = (TypeVariableBinding) map.get(originalVariable.unannotated());
TypeBinding substitutedSuperclass = Scope.substitute(substitution, originalVariable.superclass);
ReferenceBinding[] substitutedInterfaces = Scope.substitute(substitution, originalVariable.superInterfaces);
@@ -5175,7 +5104,7 @@
MethodBinding[] compatible = new MethodBinding[sfi];
int compatibleIndex = 0;
for (int i = 0; i < sfi; i++) {
- MethodBinding compatibleMethod = computeCompatibleMethod(staticFactories[i], argumentTypes, allocationSite, APPLICABILITY);
+ MethodBinding compatibleMethod = computeCompatibleMethod(staticFactories[i], argumentTypes, allocationSite);
if (compatibleMethod != null) {
if (compatibleMethod.isValidBinding())
compatible[compatibleIndex++] = compatibleMethod;
@@ -5185,20 +5114,27 @@
if (compatibleIndex == 0) {
return null;
}
- if (compatibleIndex == 1) {
- // 1.8: Give inference a chance to perform outstanding tasks (18.5.2):
- compatible[0] = inferInvocationType(allocationSite, compatible[0], argumentTypes);
- }
return compatibleIndex == 1 ? compatible[0] : mostSpecificMethodBinding(compatible, compatibleIndex, argumentTypes, allocationSite, allocationType);
}
public boolean validateNullAnnotation(long tagBits, TypeReference typeRef, Annotation[] annotations) {
- long nullAnnotationTagBit = tagBits & (TagBits.AnnotationNullMASK);
- if (nullAnnotationTagBit != 0) {
+ if (typeRef == null)
+ return true;
TypeBinding type = typeRef.resolvedType;
+
+ boolean usesNullTypeAnnotations = this.environment().usesNullTypeAnnotations();
+ long nullAnnotationTagBit;
+ if (usesNullTypeAnnotations) {
+ type = type.leafComponentType(); // if it's an array, the annotation applies to the leaf component type
+ nullAnnotationTagBit = type.tagBits & TagBits.AnnotationNullMASK;
+ } else {
+ nullAnnotationTagBit = tagBits & (TagBits.AnnotationNullMASK);
+ }
+
+ if (nullAnnotationTagBit != 0) {
if (type != null && type.isBaseType()) {
// type annotations are *always* illegal for 'void' (already reported)
- if (!(typeRef.resolvedType.id == TypeIds.T_void && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8))
+ if (!(typeRef.resolvedType.id == TypeIds.T_void && usesNullTypeAnnotations))
problemReporter().illegalAnnotationForBaseType(typeRef, annotations, nullAnnotationTagBit);
return false;
}
@@ -5232,6 +5168,7 @@
methodScope = methodScope.enclosingMethodScope();
}
}
+ MethodBinding enclosingMethod = enclosingType != null ? enclosingType.enclosingMethod() : null;
while (methodScope != null) {
while (methodScope != null && methodScope.referenceContext instanceof LambdaExpression) {
LambdaExpression lambda = (LambdaExpression) methodScope.referenceContext;
@@ -5242,6 +5179,8 @@
if (methodScope != null) {
if (methodScope.referenceContext instanceof MethodDeclaration) {
MethodDeclaration methodDeclaration = (MethodDeclaration) methodScope.referenceContext;
+ if (methodDeclaration.binding == enclosingMethod)
+ break;
methodDeclaration.bits &= ~ASTNode.CanBeStatic;
}
ClassScope enclosingClassScope = methodScope.enclosingClassScope();
@@ -5257,27 +5196,6 @@
}
}
- /**
- * Given a selected applibable method, check if it has an unfinished InferenceContext18 associated.
- * If so perform the outstanding Invocation Type Inference and return the improved method,
- * otherwise return the applicable method unchanged.
- */
- protected MethodBinding inferInvocationType(InvocationSite invocationSite, MethodBinding applicable, TypeBinding[] argumentTypes) {
- if (invocationSite instanceof Invocation) {
- Invocation invocation = (Invocation) invocationSite;
- if (applicable instanceof ParameterizedGenericMethodBinding) {
- ParameterizedGenericMethodBinding parameterizedMethod = (ParameterizedGenericMethodBinding) applicable;
- InferenceContext18 infCtx18 = invocation.getInferenceContext(parameterizedMethod);
- if (infCtx18 != null && !infCtx18.hasResultFor(invocation.invocationTargetType())) {
- return infCtx18.inferInvocationType(invocation, argumentTypes, parameterizedMethod);
- }
- } else {
- ASTNode.resolvePolyExpressionArguments(invocation, applicable, argumentTypes, this);
- }
- }
- return applicable;
- }
-
// AspectJ Extension
/**
* Other scopes can override this method
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.java
index c4ca15b..8926e4a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,10 +7,13 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440474 - [null] textual encoding of external null annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ExternalAnnotationProvider;
public class SignatureWrapper {
public char[] signature;
@@ -18,6 +21,7 @@
public int end;
public int bracket;
private boolean use15specifics;
+ private boolean useExternalAnnotations;
public SignatureWrapper(char[] signature, boolean use15specifics) {
this.signature = signature;
@@ -25,6 +29,13 @@
this.end = this.bracket = -1;
this.use15specifics = use15specifics;
}
+ public SignatureWrapper(char[] signature, boolean use15specifics, boolean useExternalAnnotations) {
+ this.signature = signature;
+ this.start = 0;
+ this.end = this.bracket = -1;
+ this.use15specifics = use15specifics;
+ this.useExternalAnnotations = useExternalAnnotations;
+ }
public SignatureWrapper(char [] signature) {
this(signature, true);
}
@@ -33,8 +44,27 @@
}
public int computeEnd() {
int index = this.start;
- while (this.signature[index] == '[')
- index++;
+ if (this.useExternalAnnotations) {
+ // in addition to '[' tokens accept null annotations after the first '['
+ skipDimensions: while(true) {
+ switch (this.signature[index]) {
+ case ExternalAnnotationProvider.NONNULL :
+ case ExternalAnnotationProvider.NULLABLE :
+ case ExternalAnnotationProvider.NO_ANNOTATION :
+ if (index == this.start)
+ break skipDimensions;
+ //$FALL-THROUGH$
+ case '[':
+ index++;
+ break;
+ default:
+ break skipDimensions;
+ }
+ }
+ } else {
+ while (this.signature[index] == '[')
+ index++;
+ }
switch (this.signature[index]) {
case 'L' :
case 'T' :
@@ -48,7 +78,7 @@
this.end = this.signature.length + 1;
break;
default :
- this.end = this.start;
+ this.end = index;
}
if (this.use15specifics || this.end != this.bracket) {
@@ -91,6 +121,42 @@
return CharOperation.subarray(this.signature, this.start, this.start = this.end); // skip word
}
+ /** similar to nextWord() but don't stop at '.' */
+ public char[] nextName() {
+ this.end = CharOperation.indexOf(';', this.signature, this.start);
+ if (this.bracket <= this.start) // already know it if its > start
+ this.bracket = CharOperation.indexOf('<', this.signature, this.start);
+
+ if (this.bracket > this.start && this.bracket < this.end)
+ this.end = this.bracket;
+
+ return CharOperation.subarray(this.signature, this.start, this.start = this.end); // skip name
+ }
+
+ /** answer the next type (incl. type arguments), but don't advance any cursors */
+ public char[] peekFullType() {
+ int s = this.start, b = this.bracket, e = this.end;
+ int peekEnd = skipAngleContents(computeEnd());
+ this.start = s;
+ this.bracket = b;
+ this.end = e;
+ return CharOperation.subarray(this.signature, s, peekEnd+1);
+ }
+
+ /**
+ * assuming a previously stored start of 's' followed by a call to computeEnd()
+ * now retrieve the content between these bounds including trailing angle content
+ */
+ public char[] getFrom(int s) {
+ if (this.end == this.bracket) {
+ this.end = skipAngleContents(this.bracket);
+ this.start = this.end + 1;
+ }
+ return CharOperation.subarray(this.signature, s, this.end+1);
+ }
+ public char[] tail() {
+ return CharOperation.subarray(this.signature, this.start, this.signature.length);
+ }
public String toString() {
return new String(this.signature) + " @ " + this.start; //$NON-NLS-1$
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index 9013d0d..585e749 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,6 +34,11 @@
* Bug 432348 - [1.8] Internal compiler error (NPE) after upgrade to 1.8
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 435570 - [1.8][null] @NonNullByDefault illegally tries to affect "throws E"
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 457210 - [1.8][compiler][null] Wrong Nullness errors given on full build build but not on incremental build?
+ * Bug 461250 - ArrayIndexOutOfBoundsException in SourceTypeBinding.fields
+ * Bug 466713 - Null Annotations: NullPointerException using <int @Nullable []> as Type Param
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
* Till Brychcy - Contributions for
@@ -60,6 +65,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationPosition;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
@@ -737,7 +743,7 @@
*/
public SyntheticMethodBinding addSyntheticBridgeMethod(MethodBinding inheritedMethodToBridge, MethodBinding targetMethod) {
if (!isPrototype()) throw new IllegalStateException();
- if (isInterface()) return null; // only classes & enums get bridge methods
+ if (isInterface() && this.scope.compilerOptions().sourceLevel <= ClassFileConstants.JDK1_7) return null; // only classes & enums get bridge methods, interfaces too at 1.8+
// targetMethod may be inherited
if (TypeBinding.equalsEquals(inheritedMethodToBridge.returnType.erasure(), targetMethod.returnType.erasure())
&& inheritedMethodToBridge.areParameterErasuresEqual(targetMethod)) {
@@ -888,18 +894,29 @@
return uniqueKey;
}
-void faultInTypesForFieldsAndMethods() {
- if (!isPrototype()) throw new IllegalStateException();
+private void checkAnnotationsInType() {
// check @Deprecated annotation
getAnnotationTagBits(); // marks as deprecated by side effect
ReferenceBinding enclosingType = enclosingType();
if (enclosingType != null && enclosingType.isViewedAsDeprecated() && !isDeprecated())
this.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly;
+
+ for (int i = 0, length = this.memberTypes.length; i < length; i++)
+ ((SourceTypeBinding) this.memberTypes[i]).checkAnnotationsInType();
+}
+
+void faultInTypesForFieldsAndMethods() {
+ if (!isPrototype()) throw new IllegalStateException();
+ checkAnnotationsInType();
+ internalFaultInTypeForFieldsAndMethods();
+}
+
+private void internalFaultInTypeForFieldsAndMethods() {
fields();
methods();
for (int i = 0, length = this.memberTypes.length; i < length; i++)
- ((SourceTypeBinding) this.memberTypes[i]).faultInTypesForFieldsAndMethods();
+ ((SourceTypeBinding) this.memberTypes[i]).internalFaultInTypeForFieldsAndMethods();
}
// NOTE: the type of each field of a source type is resolved when needed
public FieldBinding[] fields() {
@@ -924,11 +941,12 @@
ReferenceBinding.sortFields(this.fields, 0, length);
this.tagBits |= TagBits.AreFieldsSorted;
}
- for (int i = 0, length = this.fields.length; i < length; i++) {
- if (resolveTypeFor(this.fields[i]) == null) {
+ FieldBinding[] fieldsSnapshot = this.fields;
+ for (int i = 0, length = fieldsSnapshot.length; i < length; i++) {
+ if (resolveTypeFor(fieldsSnapshot[i]) == null) {
// do not alter original field array until resolution is over, due to reentrance (143259)
- if (resolvedFields == this.fields) {
- System.arraycopy(this.fields, 0, resolvedFields = new FieldBinding[length], 0, length);
+ if (resolvedFields == fieldsSnapshot) {
+ System.arraycopy(fieldsSnapshot, 0, resolvedFields = new FieldBinding[length], 0, length);
}
resolvedFields[i] = null;
failed++;
@@ -1033,7 +1051,6 @@
}
if ((this.tagBits & TagBits.AnnotationDeprecated) != 0)
this.modifiers |= ClassFileConstants.AccDeprecated;
- evaluateNullAnnotations(this.tagBits);
}
return this.tagBits;
}
@@ -1913,7 +1930,7 @@
if ((resolvedExceptionType.tagBits & TagBits.HasMissingType) != 0) {
method.tagBits |= TagBits.HasMissingType;
}
- if (exceptionTypes[i].hasNullTypeAnnotation()) {
+ if (exceptionTypes[i].hasNullTypeAnnotation(AnnotationPosition.ANY)) {
methodDecl.scope.problemReporter().nullAnnotationUnsupportedLocation(exceptionTypes[i]);
}
method.modifiers |= (resolvedExceptionType.modifiers & ExtraCompilerModifiers.AccGenericSignature);
@@ -2050,20 +2067,17 @@
long nullTagBits = method.tagBits & TagBits.AnnotationNullMASK;
if (nullTagBits != 0) {
TypeReference returnTypeRef = ((MethodDeclaration)methodDecl).returnType;
- if (compilerOptions.sourceLevel < ClassFileConstants.JDK1_8) {
+ if (this.scope.environment().usesNullTypeAnnotations()) {
if (!this.scope.validateNullAnnotation(nullTagBits, returnTypeRef, methodDecl.annotations))
+ method.returnType.tagBits &= ~TagBits.AnnotationNullMASK;
method.tagBits &= ~TagBits.AnnotationNullMASK;
} else {
- if (nullTagBits != (method.returnType.tagBits & TagBits.AnnotationNullMASK)) {
- if (!this.scope.validateNullAnnotation(nullTagBits, returnTypeRef, methodDecl.annotations)) {
- method.returnType.tagBits &= ~TagBits.AnnotationNullMASK;
- }
+ if (!this.scope.validateNullAnnotation(nullTagBits, returnTypeRef, methodDecl.annotations))
method.tagBits &= ~TagBits.AnnotationNullMASK;
}
}
}
}
- }
if (compilerOptions.storeAnnotations)
createArgumentBindings(method, compilerOptions); // need annotations resolved already at this point
if (foundReturnTypeProblem)
@@ -2103,12 +2117,27 @@
}
}
-private void evaluateNullAnnotations(long annotationTagBits) {
+public void evaluateNullAnnotations() {
if (!isPrototype()) throw new IllegalStateException();
-
- if (this.nullnessDefaultInitialized > 0 || !this.scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled)
+ // AspectJ added guard for null scope (happens for aspects in the 'BcelWorld.hasUnsatisfiedDependency' chain call
+ if (this.nullnessDefaultInitialized > 0 || this.scope==null || !this.scope.compilerOptions().isAnnotationBasedNullAnalysisEnabled)
return;
+
+ if ((this.tagBits & TagBits.AnnotationNullMASK) != 0) {
+ Annotation[] annotations = this.scope.referenceContext.annotations;
+ for (int i = 0; i < annotations.length; i++) {
+ ReferenceBinding annotationType = annotations[i].getCompilerAnnotation().getAnnotationType();
+ if (annotationType != null) {
+ if (annotationType.id == TypeIds.T_ConfiguredAnnotationNonNull
+ || annotationType.id == TypeIds.T_ConfiguredAnnotationNullable) {
+ this.scope.problemReporter().nullAnnotationUnsupportedLocation(annotations[i]);
+ this.tagBits &= ~TagBits.AnnotationNullMASK;
+ }
+ }
+ }
+ }
+
boolean isPackageInfo = CharOperation.equals(this.sourceName, TypeConstants.PACKAGE_INFO_NAME);
PackageBinding pkg = getPackage();
boolean isInDefaultPkg = (pkg.compoundName == CharOperation.NO_CHAR_CHAR);
@@ -2130,14 +2159,14 @@
}
}
this.nullnessDefaultInitialized = 1;
- boolean isJdk18 = this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8;
- if (isJdk18) {
+ boolean usesNullTypeAnnotations = this.scope.environment().usesNullTypeAnnotations();
+ if (usesNullTypeAnnotations) {
if (this.defaultNullness != 0) {
if (isPackageInfo) {
pkg.defaultNullness = this.defaultNullness;
} else {
TypeDeclaration typeDecl = this.scope.referenceContext;
- checkRedundantNullnessDefaultRecurse(typeDecl, typeDecl.annotations, this.defaultNullness, isJdk18);
+ checkRedundantNullnessDefaultRecurse(typeDecl, typeDecl.annotations, this.defaultNullness, true);
}
} else if (isPackageInfo || (isInDefaultPkg && !(this instanceof NestedTypeBinding))) {
this.scope.problemReporter().missingNonNullByDefaultAnnotation(this.scope.referenceContext);
@@ -2145,12 +2174,23 @@
pkg.defaultNullness = NULL_UNSPECIFIED_BY_DEFAULT;
}
} else {
- // transfer nullness info from tagBits to this.nullnessDefaultAnnotation
+ // transfer nullness info from tagBits to this.defaultNullness
+ long annotationTagBits = this.tagBits;
int newDefaultNullness = NO_NULL_DEFAULT;
- if ((annotationTagBits & TagBits.AnnotationNullUnspecifiedByDefault) != 0)
+ if ((annotationTagBits & TagBits.AnnotationNullUnspecifiedByDefault) != 0) {
newDefaultNullness = NULL_UNSPECIFIED_BY_DEFAULT;
- else if ((annotationTagBits & TagBits.AnnotationNonNullByDefault) != 0)
+ } else if ((annotationTagBits & TagBits.AnnotationNonNullByDefault) != 0) {
+ newDefaultNullness = NONNULL_BY_DEFAULT;
+ } else if (this.defaultNullness != 0) {
+ // NNBD with argument while NN & NU are SE5 annotations, revert to old default & encoding.
+ if (this.defaultNullness == NULL_UNSPECIFIED_BY_DEFAULT) {
+ annotationTagBits = TagBits.AnnotationNullUnspecifiedByDefault;
+ newDefaultNullness = NULL_UNSPECIFIED_BY_DEFAULT;
+ } else {
+ annotationTagBits = TagBits.AnnotationNonNullByDefault;
newDefaultNullness = NONNULL_BY_DEFAULT;
+ }
+ }
if (newDefaultNullness != NO_NULL_DEFAULT) {
if (isPackageInfo) {
pkg.defaultNullness = newDefaultNullness;
@@ -2187,17 +2227,17 @@
* Recursively check if the given annotations are redundant with equal annotations at an enclosing level.
* @param location fallback location to report the warning against (if we can't blame a specific annotation)
* @param annotations search these for the annotation that should be blamed in warning messages
- * @param nullBits in 1.7- times these are the annotationTagBits, in 1.8+ the bitvector from {@link Binding#NullnessDefaultMASK}
- * @param isJdk18 toggles the interpretation of 'nullBits'
+ * @param nullBits when using declaration annotations these are the annotationTagBits, for type annotations the bitvector from {@link Binding#NullnessDefaultMASK}
+ * @param useNullTypeAnnotations toggles the interpretation of 'nullBits'
*
* @pre null annotation analysis is enabled
*/
-protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation[] annotations, long nullBits, boolean isJdk18) {
+protected void checkRedundantNullnessDefaultRecurse(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) {
if (!isPrototype()) throw new IllegalStateException();
if (this.fPackage.defaultNullness != NO_NULL_DEFAULT) {
- boolean isRedundant = isJdk18
+ boolean isRedundant = useNullTypeAnnotations
? this.fPackage.defaultNullness == nullBits
: (this.fPackage.defaultNullness == NONNULL_BY_DEFAULT
&& ((nullBits & TagBits.AnnotationNonNullByDefault) != 0));
@@ -2209,13 +2249,13 @@
}
// return: should caller continue searching?
-protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean isJdk18) {
+protected boolean checkRedundantNullnessDefaultOne(ASTNode location, Annotation[] annotations, long nullBits, boolean useNullTypeAnnotations) {
if (!isPrototype()) throw new IllegalStateException();
int thisDefault = getNullDefault();
if (thisDefault != NO_NULL_DEFAULT) {
- boolean isRedundant = isJdk18
+ boolean isRedundant = useNullTypeAnnotations
? thisDefault == nullBits
: (nullBits & TagBits.AnnotationNonNullByDefault) != 0;
if (isRedundant) {
@@ -2608,14 +2648,17 @@
((SourceTypeBinding) this.memberTypes[i]).verifyMethods(verifier);
}
-public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
- if (removeOnlyNullAnnotations) {
+public TypeBinding unannotated() {
+ return this.prototype;
+}
+
+@Override
+public TypeBinding withoutToplevelNullAnnotation() {
if (!hasNullTypeAnnotations())
return this;
AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
if (newAnnotations.length > 0)
return this.environment.createAnnotatedType(this.prototype, newAnnotations);
- }
return this.prototype;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.java
index 199533e..54ab5c0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SourceTypeCollisionException.java
@@ -16,10 +16,4 @@
private static final long serialVersionUID = 4798247636899127380L;
public ICompilationUnit[] newAnnotationProcessorUnits;
- /**
- * Javadoc on {@link javax.annotation.processing.RoundEnvironment#processingOver()} claims that
- * types generated by last round of annotation processing should not be subject to a subsequent rounds
- * of annotation processing. So this flag have to be added to handle last round of annotation processing gracefully.
- */
- public boolean afterLastAnnotationProcessingRound = false;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
index 1565c6f..1c770c1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticFactoryMethodBinding.java
@@ -29,13 +29,20 @@
this.enclosingType = enclosingType;
}
- /** Apply the given type arguments on the (declaring class of the) actual constructor being represented by this factory method. */
- public ParameterizedMethodBinding applyTypeArgumentsOnConstructor(TypeBinding[] typeArguments) {
+ public MethodBinding getConstructor() {
+ return this.staticFactoryFor;
+ }
+
+ /** Apply the given type arguments on the (declaring class of the) actual constructor being represented by this factory method and
+ if method type arguments is not empty materialize the parameterized generic constructor
+ */
+ public ParameterizedMethodBinding applyTypeArgumentsOnConstructor(TypeBinding[] typeArguments, TypeBinding[] constructorTypeArguments) {
ReferenceBinding parameterizedType = this.environment.createParameterizedType(this.declaringClass, typeArguments,
this.enclosingType);
for (MethodBinding parameterizedMethod : parameterizedType.methods()) {
if (parameterizedMethod.original() == this.staticFactoryFor)
- return (ParameterizedMethodBinding) parameterizedMethod;
+ return constructorTypeArguments.length > 0 ? this.environment.createParameterizedGenericMethod(parameterizedMethod, constructorTypeArguments) :
+ (ParameterizedMethodBinding) parameterizedMethod;
if (parameterizedMethod instanceof ProblemMethodBinding) {
MethodBinding closestMatch = ((ProblemMethodBinding)parameterizedMethod).closestMatch;
if (closestMatch instanceof ParameterizedMethodBinding && closestMatch.original() == this.staticFactoryFor)
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
index 86a3e78..fcf34aa 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* bug 400710 - [1.8][compiler] synthetic access to default method generates wrong code
+ * Bug 459967 - [null] compiler should know about nullness of special methods like MyEnum.valueOf()
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
*******************************************************************************/
@@ -347,6 +348,14 @@
this.modifiers = ClassFileConstants.AccSynthetic | ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic;
this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
this.returnType = arrayType;
+ LookupEnvironment environment = declaringClass.environment;
+ if (environment.globalOptions.isAnnotationBasedNullAnalysisEnabled) {
+ // mark X[]::new and X[]::clone as returning 'X @NonNull' (don't wait (cf. markNonNull()), because we're called as late as codeGen):
+ if (environment.usesNullTypeAnnotations())
+ this.returnType = environment.createAnnotatedType(this.returnType, new AnnotationBinding[]{ environment.getNonNullAnnotation() });
+ else
+ this.tagBits |= TagBits.AnnotationNonNull;
+ }
this.parameters = new TypeBinding[] { purpose == SyntheticMethodBinding.ArrayConstructor ? TypeBinding.INT : (TypeBinding) arrayType};
this.thrownExceptions = Binding.NO_EXCEPTIONS;
this.purpose = purpose;
@@ -550,6 +559,28 @@
public LambdaExpression sourceLambda() {
return this.lambda;
}
+ public void markNonNull(LookupEnvironment environment) {
+ // deferred update of the return type
+ switch (this.purpose) {
+ case EnumValues:
+ if (environment.usesNullTypeAnnotations()) {
+ TypeBinding elementType = ((ArrayBinding)this.returnType).leafComponentType();
+ AnnotationBinding nonNullAnnotation = environment.getNonNullAnnotation();
+ elementType = environment.createAnnotatedType(elementType, new AnnotationBinding[]{ environment.getNonNullAnnotation() });
+ this.returnType = environment.createArrayType(elementType, 1, new AnnotationBinding[]{ nonNullAnnotation, null });
+ } else {
+ this.tagBits |= TagBits.AnnotationNonNull;
+ }
+ return;
+ case EnumValueOf:
+ if (environment.usesNullTypeAnnotations()) {
+ this.returnType = environment.createAnnotatedType(this.returnType, new AnnotationBinding[]{ environment.getNonNullAnnotation() });
+ } else {
+ this.tagBits |= TagBits.AnnotationNonNull;
+ }
+ return;
+ }
+ }
// AspectJ Extension
public SyntheticMethodBinding(MethodBinding myBinding) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
index c66024f..8622506 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
@@ -138,7 +138,7 @@
long AnnotationSuppressWarnings = ASTNode.Bit51L;
/** @since 3.7 - java 7 safe vargs invocation */
long AnnotationSafeVarargs = ASTNode.Bit52L;
- /** @since 3.7 - java 7 MethodHandle.invokeExact(..)/invokeGeneric(..)*/
+ /** @since 3.7 - java 7 MethodHandle.invokeExact(..)/invoke(..)*/
long AnnotationPolymorphicSignature = ASTNode.Bit53L;
/** @since 3.8 null annotation for MethodBinding or LocalVariableBinding (argument): */
long AnnotationNullable = ASTNode.Bit56L;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
index 52f12c3..f7fbea7 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java
@@ -26,6 +26,8 @@
* Bug 435962 - [RC2] StackOverFlowError when building
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 440759 - [1.8][null] @NonNullByDefault should never affect wildcards and uses of a type variable
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
+ * Bug 446434 - [1.8][null] Enable interned captures also when analysing null type annotations
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
*******************************************************************************/
@@ -97,9 +99,9 @@
super();
}
-public TypeBinding(TypeBinding prototype) { // faithfully copy all instance state - clone operation should specialize/override suitably.
+public TypeBinding(TypeBinding prototype) { // faithfully copy most instance state - clone operation should specialize/override suitably.
this.id = prototype.id;
- this.tagBits = prototype.tagBits;
+ this.tagBits = prototype.tagBits & ~TagBits.AnnotationNullMASK;
}
/**
@@ -181,7 +183,7 @@
/**
* Perform capture conversion on a given type (only effective on parameterized type with wildcards)
*/
-public TypeBinding capture(Scope scope, int position) {
+public TypeBinding capture(Scope scope, int start, int end) {
return this;
}
@@ -252,6 +254,13 @@
return 0;
}
+/* Answer the receiver's enclosing method ... null if the receiver is not a local type.
+ */
+public MethodBinding enclosingMethod() {
+ return null;
+}
+
+
/* Answer the receiver's enclosing type... null if the receiver is a top level type or is an array or a non reference type.
*/
public ReferenceBinding enclosingType() {
@@ -432,6 +441,16 @@
}
}
}
+ break;
+ case Binding.INTERSECTION_TYPE18:
+ IntersectionTypeBinding18 itb18 = (IntersectionTypeBinding18) this;
+ ReferenceBinding[] intersectingTypes = itb18.getIntersectingTypes();
+ for (int i = 0, length = intersectingTypes.length; i < length; i++) {
+ TypeBinding superType = intersectingTypes[i].findSuperTypeOriginatingFrom(otherType);
+ if (superType != null)
+ return superType;
+ }
+ break;
}
return null;
}
@@ -595,6 +614,31 @@
// version that allows to capture a type bound using 'scope':
public abstract boolean isCompatibleWith(TypeBinding right, /*@Nullable*/ Scope scope);
+public boolean isPotentiallyCompatibleWith(TypeBinding right, /*@Nullable*/ Scope scope) {
+ return isCompatibleWith(right, scope);
+}
+
+/* Answer true if the receiver type can be assigned to the argument type (right) with boxing/unboxing applied.
+ */
+public boolean isBoxingCompatibleWith(TypeBinding right, /*@NonNull */ Scope scope) {
+
+ if (right == null)
+ return false;
+
+ if (TypeBinding.equalsEquals(this, right))
+ return true;
+
+ if (this.isCompatibleWith(right, scope))
+ return true;
+
+ if (this.isBaseType() != right.isBaseType()) {
+ TypeBinding convertedType = scope.environment().computeBoxingType(this);
+ if (TypeBinding.equalsEquals(convertedType, right) || convertedType.isCompatibleWith(right, scope))
+ return true;
+ }
+ return false;
+}
+
public boolean isEnum() {
return false;
}
@@ -692,7 +736,7 @@
return false;
}
-public boolean isIntersectionCastType() {
+public boolean isIntersectionType18() {
return false;
}
@@ -739,6 +783,11 @@
public boolean isProperType(boolean admitCapture18) {
return true;
}
+
+public boolean isPolyType() {
+ return false;
+}
+
/**
* Substitute all occurrences of 'var' within the current type by 'substituteType.
* @param var an inference variable (JLS8 18.1.1)
@@ -1209,6 +1258,12 @@
TypeBinding otherBound = otherWildcard.bound;
switch (otherWildcard.boundKind) {
case Wildcard.EXTENDS:
+ if (otherBound instanceof IntersectionTypeBinding18) {
+ TypeBinding [] intersectingTypes = ((IntersectionTypeBinding18) otherBound).intersectingTypes;
+ for (int i = 0, length = intersectingTypes.length; i < length; i++)
+ if (TypeBinding.equalsEquals(intersectingTypes[i], this))
+ return true;
+ }
if (TypeBinding.equalsEquals(otherBound, this))
return true; // ? extends T <= ? extends ? extends T
if (upperBound == null)
@@ -1221,6 +1276,12 @@
return upperBound.isCompatibleWith(otherBound);
case Wildcard.SUPER:
+ if (otherBound instanceof IntersectionTypeBinding18) {
+ TypeBinding [] intersectingTypes = ((IntersectionTypeBinding18) otherBound).intersectingTypes;
+ for (int i = 0, length = intersectingTypes.length; i < length; i++)
+ if (TypeBinding.equalsEquals(intersectingTypes[i], this))
+ return true;
+ }
if (TypeBinding.equalsEquals(otherBound, this))
return true; // ? super T <= ? super ? super T
if (lowerBound == null)
@@ -1402,17 +1463,24 @@
case Binding.PARAMETERIZED_TYPE :
case Binding.RAW_TYPE :
case Binding.ARRAY_TYPE :
- return erasure().unannotated(false);
+ return erasure().unannotated();
default :
- return this.unannotated(false);
+ return this.unannotated();
}
}
/**
* Return this type minus its type annotations
- * @param removeOnlyNullAnnotations if true only null type annotations are removed, otherwise all type annotations.
*/
-public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
+public TypeBinding unannotated() {
+ return this;
+}
+
+/**
+ * Return this type minus its toplevel null annotations. Any annotations on type arguments or
+ * bounds are retained.
+ */
+public TypeBinding withoutToplevelNullAnnotation() {
return this;
}
@@ -1472,6 +1540,11 @@
}
}
+// return a name that can be passed to Signature.createTypeSignature
+public char [] signableName() {
+ return readableName();
+}
+
/**
* Answer the receiver classfile signature.
* Arrays & base types do not distinguish between signature() & constantPoolName().
@@ -1600,4 +1673,8 @@
public void exitRecursiveFunction() {
// empty, subclasses to override
}
+
+public boolean isFunctionalType() {
+ return false;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java
index 1e6b202..cc565b2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBindingVisitor.java
@@ -42,7 +42,7 @@
return true; // continue traversal.
}
- public boolean visit(IntersectionCastTypeBinding intersectionCastTypeBinding) {
+ public boolean visit(IntersectionTypeBinding18 intersectionTypeBinding18) {
return true; // continue traversal.
}
@@ -50,6 +50,10 @@
return true; // continue traversal.
}
+ public boolean visit(PolyTypeBinding polyTypeBinding) {
+ return true; // continue traversal.
+ }
+
public static void visit(TypeBindingVisitor visitor, ReferenceBinding[] types) {
for (int i = 0, length = types == null ? 0 : types.length; i < length; i++) {
visit(visitor, types[i]);
@@ -124,10 +128,14 @@
}
break;
- case Binding.INTERSECTION_CAST_TYPE:
- IntersectionCastTypeBinding intersectionCastTypeBinding = (IntersectionCastTypeBinding) type;
- if (visitor.visit(intersectionCastTypeBinding))
- visit(visitor, intersectionCastTypeBinding.intersectingTypes);
+ case Binding.INTERSECTION_TYPE18:
+ IntersectionTypeBinding18 intersectionTypeBinding18 = (IntersectionTypeBinding18) type;
+ if (visitor.visit(intersectionTypeBinding18))
+ visit(visitor, intersectionTypeBinding18.intersectingTypes);
+ break;
+
+ case Binding.POLY_TYPE:
+ visitor.visit((PolyTypeBinding) type);
break;
default:
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
index 0f03295..f485927 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeBound.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG and others.
+ * Copyright (c) 2013, 2015 GK Software AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,14 +33,28 @@
/** Create a true type bound or a dependency. */
TypeBound(InferenceVariable inferenceVariable, TypeBinding typeBinding, int relation) {
- this.left = inferenceVariable;
- this.right = safeType(typeBinding);
- this.relation = relation;
+ this(inferenceVariable, typeBinding, relation, false);
}
TypeBound(InferenceVariable inferenceVariable, TypeBinding typeBinding, int relation, boolean isSoft) {
this.left = inferenceVariable;
this.right = safeType(typeBinding);
+ if (((inferenceVariable.tagBits | this.right.tagBits) & TagBits.AnnotationNullMASK) != 0) {
+ if ((inferenceVariable.tagBits & TagBits.AnnotationNullMASK) == (this.right.tagBits & TagBits.AnnotationNullMASK)) {
+ // strip off identical nullness on both sides:
+ this.left = (InferenceVariable) inferenceVariable.withoutToplevelNullAnnotation();
+ this.right = this.right.withoutToplevelNullAnnotation();
+ } else {
+ long mask = 0;
+ // extract hint, e.g.: T#0 <: @NonNull Right => T#0 hinted as @NonNull
+ switch (relation) {
+ case SAME: mask = TagBits.AnnotationNullMASK; break;
+ case SUBTYPE: mask = TagBits.AnnotationNonNull; break; // sub of @Nullable is irrelevant
+ case SUPERTYPE: mask = TagBits.AnnotationNullable; break; // super of @NonNull is irrelevant
+ }
+ inferenceVariable.prototype().nullHints |= this.right.tagBits & mask;
+ }
+ }
this.relation = relation;
this.isSoft = isSoft;
}
@@ -65,7 +79,7 @@
public boolean equals(Object obj) {
if (obj instanceof TypeBound) {
TypeBound other = (TypeBound) obj;
- return TypeBinding.equalsEquals(this.left, other.left) && TypeBinding.equalsEquals(this.right, other.right) && this.relation == other.relation;
+ return (this.relation == other.relation) && TypeBinding.equalsEquals(this.left, other.left) && TypeBinding.equalsEquals(this.right, other.right);
}
return false;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
index 5a810fc..771c9d4 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,6 +22,8 @@
* Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 405104 - [1.8][compiler][codegen] Implement support for serializeable lambdas
+ * Ulrich Grave <ulrich.grave@gmx.de> - Contributions for
+ * bug 386692 - Missing "unused" warning on "autowired" fields
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -65,6 +67,7 @@
char[] WILDCARD_PLUS = { '+' };
char[] WILDCARD_CAPTURE_NAME_PREFIX = "capture#".toCharArray(); //$NON-NLS-1$
char[] WILDCARD_CAPTURE_NAME_SUFFIX = "-of ".toCharArray(); //$NON-NLS-1$
+ char[] WILDCARD_CAPTURE_SIGNABLE_NAME_SUFFIX = "capture-of ".toCharArray(); //$NON-NLS-1$
char[] WILDCARD_CAPTURE = { '!' };
char[] CAPTURE18 = { '^' };
char[] BYTE = "byte".toCharArray(); //$NON-NLS-1$
@@ -118,6 +121,7 @@
char[] TYPEBINDING = "TypeBinding".toCharArray(); //$NON-NLS-1$
char[] DOM = "dom".toCharArray(); //$NON-NLS-1$
char[] ITYPEBINDING = "ITypeBinding".toCharArray(); //$NON-NLS-1$
+ char[] SPRING = "springframework".toCharArray(); //$NON-NLS-1$
// Constant compound names
char[][] JAVA_LANG = {JAVA, LANG};
@@ -329,6 +333,13 @@
// detail for the above:
char[] OPTIONAL = "optional".toCharArray(); //$NON-NLS-1$
+ // Spring @Autowired annotation
+ char [] AUTOWIRED = "Autowired".toCharArray(); //$NON-NLS-1$
+ char [] BEANS = "beans".toCharArray(); //$NON-NLS-1$
+ char [] FACTORY = "factory".toCharArray(); //$NON-NLS-1$
+ char[][] ORG_SPRING_AUTOWIRED = new char[][] {ORG, SPRING, BEANS, FACTORY, ANNOTATION, AUTOWIRED};
+ char[] REQUIRED = "required".toCharArray(); //$NON-NLS-1$
+
// Constraints for generic type argument inference
int CONSTRAINT_EQUAL = 0; // Actual = Formal
int CONSTRAINT_EXTENDS = 1; // Actual << Formal
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
index 8602c55..3321786 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,8 @@
* bug 382069 - [null] Make the null analysis consider JUnit's assertNotNull similarly to assertions
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* Bug 412153 - [1.8][compiler] Check validity of annotations which may be repeatable
+ * Ulrich Grave <ulrich.grave@gmx.de> - Contributions for
+ * bug 386692 - Missing "unused" warning on "autowired" fields
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -127,11 +129,16 @@
// new in 3.9 to identify known @Inject annotations
final int T_JavaxInjectInject = 80;
final int T_ComGoogleInjectInject = 81;
+
+ // @Autowired
+ final int T_OrgSpringframeworkBeansFactoryAnnotationAutowired = 82;
+
// Java 8 - JEP 120
final int T_JavaLangAnnotationRepeatable = 90;
// If you add new type id, make sure to bump up T_LastWellKnownTypeId if there is a cross over.
final int T_LastWellKnownTypeId = 128;
+
final int NoId = Integer.MAX_VALUE;
public static final int IMPLICIT_CONVERSION_MASK = 0xFF;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
index 4e6f0b0..0ac4cf8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 IBM Corporation and others.
+ * Copyright (c) 2013, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,10 +9,15 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* Bug 434602 - Possible error with inferred null annotations leading to contradictory null annotations
+ * Bug 456497 - [1.8][null] during inference nullness from target type is lost against weaker hint from applicability analysis
+ * Bug 456487 - [1.8][null] @Nullable type variant of @NonNull-constrained type parameter causes grief
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
+import java.util.HashMap;
+
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
@@ -57,22 +62,116 @@
*/
public class TypeSystem {
+ public final class HashedParameterizedTypes {
+
+ private final class InternalParameterizedTypeBinding extends ParameterizedTypeBinding {
+
+ public InternalParameterizedTypeBinding(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType, LookupEnvironment environment) {
+ super(genericType, typeArguments, enclosingType, environment);
+ }
+
+ public boolean equals(Object other) {
+ ParameterizedTypeBinding that = (ParameterizedTypeBinding) other; // homogeneous container.
+ return this.type == that.type && this.enclosingType == that.enclosingType && Util.effectivelyEqual(this.arguments, that.arguments); //$IDENTITY-COMPARISON$
+ }
+
+ public int hashCode() {
+ int hashCode = this.type.hashCode() + 13 * (this.enclosingType != null ? this.enclosingType.hashCode() : 0);
+ for (int i = 0, length = this.arguments == null ? 0 : this.arguments.length; i < length; i++) {
+ hashCode += (i + 1) * this.arguments[i].id * this.arguments[i].hashCode();
+ }
+ return hashCode;
+ }
+ }
+
+ HashMap<ParameterizedTypeBinding, ParameterizedTypeBinding []> hashedParameterizedTypes = new HashMap<ParameterizedTypeBinding, ParameterizedTypeBinding[]>(256);
+
+ ParameterizedTypeBinding get(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType, AnnotationBinding[] annotations) {
+
+ ReferenceBinding unannotatedGenericType = (ReferenceBinding) getUnannotatedType(genericType);
+ int typeArgumentsLength = typeArguments == null ? 0: typeArguments.length;
+ TypeBinding [] unannotatedTypeArguments = typeArguments == null ? null : new TypeBinding[typeArgumentsLength];
+ for (int i = 0; i < typeArgumentsLength; i++) {
+ unannotatedTypeArguments[i] = getUnannotatedType(typeArguments[i]);
+ }
+ ReferenceBinding unannotatedEnclosingType = enclosingType == null ? null : (ReferenceBinding) getUnannotatedType(enclosingType);
+
+ ParameterizedTypeBinding typeParameterization = new InternalParameterizedTypeBinding(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, TypeSystem.this.environment);
+ ReferenceBinding genericTypeToMatch = unannotatedGenericType, enclosingTypeToMatch = unannotatedEnclosingType;
+ TypeBinding [] typeArgumentsToMatch = unannotatedTypeArguments;
+ if (TypeSystem.this instanceof AnnotatableTypeSystem) {
+ genericTypeToMatch = genericType;
+ enclosingTypeToMatch = enclosingType;
+ typeArgumentsToMatch = typeArguments;
+ }
+ ParameterizedTypeBinding [] parameterizedTypeBindings = this.hashedParameterizedTypes.get(typeParameterization);
+ for (int i = 0, length = parameterizedTypeBindings == null ? 0 : parameterizedTypeBindings.length; i < length; i++) {
+ ParameterizedTypeBinding parameterizedType = parameterizedTypeBindings[i];
+ if (parameterizedType.actualType() != genericTypeToMatch) { //$IDENTITY-COMPARISON$
+ continue;
+ }
+ if (parameterizedType.enclosingType() != enclosingTypeToMatch //$IDENTITY-COMPARISON$
+ || !Util.effectivelyEqual(parameterizedType.typeArguments(), typeArgumentsToMatch))
+ continue;
+ if (Util.effectivelyEqual(annotations, parameterizedType.getTypeAnnotations()))
+ return parameterizedType;
+ }
+
+ return null;
+ }
+
+ void put (ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType, ParameterizedTypeBinding parameterizedType) {
+ ReferenceBinding unannotatedGenericType = (ReferenceBinding) getUnannotatedType(genericType);
+ int typeArgumentsLength = typeArguments == null ? 0: typeArguments.length;
+ TypeBinding [] unannotatedTypeArguments = typeArguments == null ? null : new TypeBinding[typeArgumentsLength];
+ for (int i = 0; i < typeArgumentsLength; i++) {
+ unannotatedTypeArguments[i] = getUnannotatedType(typeArguments[i]);
+ }
+ ReferenceBinding unannotatedEnclosingType = enclosingType == null ? null : (ReferenceBinding) getUnannotatedType(enclosingType);
+
+ ParameterizedTypeBinding typeParameterization = new InternalParameterizedTypeBinding(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, TypeSystem.this.environment);
+
+ ParameterizedTypeBinding [] parameterizedTypeBindings = this.hashedParameterizedTypes.get(typeParameterization);
+ int slot;
+ if (parameterizedTypeBindings == null) {
+ slot = 0;
+ parameterizedTypeBindings = new ParameterizedTypeBinding[1];
+ } else {
+ slot = parameterizedTypeBindings.length;
+ System.arraycopy(parameterizedTypeBindings, 0, parameterizedTypeBindings = new ParameterizedTypeBinding[slot + 1], 0, slot);
+ }
+ parameterizedTypeBindings[slot] = parameterizedType;
+ this.hashedParameterizedTypes.put(typeParameterization, parameterizedTypeBindings);
+ }
+ }
+
private int typeid = TypeIds.T_LastWellKnownTypeId;
private TypeBinding [][] types;
+ protected HashedParameterizedTypes parameterizedTypes; // auxiliary fast lookup table for parameterized types.
private SimpleLookupTable annotationTypes; // cannot store in types, since AnnotationBinding is not a TypeBinding and we don't want types to operate at Binding level.
- private LookupEnvironment environment;
+ LookupEnvironment environment;
public TypeSystem(LookupEnvironment environment) {
this.environment = environment;
this.annotationTypes = new SimpleLookupTable(16);
this.typeid = TypeIds.T_LastWellKnownTypeId;
this.types = new TypeBinding[TypeIds.T_LastWellKnownTypeId * 2][];
+ this.parameterizedTypes = new HashedParameterizedTypes();
}
// Given a type, answer its unannotated aka naked prototype. This is also a convenient way to "register" a type with TypeSystem and have it id stamped.
public final TypeBinding getUnannotatedType(TypeBinding type) {
- if (type.isUnresolvedType() && CharOperation.indexOf('$', type.sourceName()) > 0)
- type = BinaryTypeBinding.resolveType(type, this.environment, true); // to ensure unique id assignment (when enclosing type is parameterized, inner type is also)
+ UnresolvedReferenceBinding urb = null;
+ if (type.isUnresolvedType() && CharOperation.indexOf('$', type.sourceName()) > 0) {
+ urb = (UnresolvedReferenceBinding) type;
+ boolean mayTolerateMissingType = this.environment.mayTolerateMissingType;
+ this.environment.mayTolerateMissingType = true;
+ try {
+ type = BinaryTypeBinding.resolveType(type, this.environment, true); // to ensure unique id assignment (when enclosing type is parameterized, inner type is also)
+ } finally {
+ this.environment.mayTolerateMissingType = mayTolerateMissingType;
+ }
+ }
if (type.id == TypeIds.NoId) {
if (type.hasTypeAnnotations())
throw new IllegalStateException();
@@ -80,6 +179,8 @@
if (this.typeid == typesLength)
System.arraycopy(this.types, 0, this.types = new TypeBinding[typesLength * 2][], 0, typesLength);
this.types[type.id = this.typeid++] = new TypeBinding[4];
+ if (urb != null)
+ urb.id = type.id;
} else {
TypeBinding nakedType = this.types[type.id] == null ? null : this.types[type.id][0];
if (type.hasTypeAnnotations() && nakedType == null)
@@ -91,7 +192,27 @@
return this.types[type.id][0] = type;
}
-
+
+ /**
+ * Forcefully register the given type as a derived type.
+ * If it itself is already registered as the key unannotated type of its family,
+ * create a clone to play that role from now on and swap types in the types cache.
+ */
+ public void forceRegisterAsDerived(TypeBinding derived) {
+ int id = derived.id;
+ if (id != TypeIds.NoId && this.types[id] != null) {
+ TypeBinding unannotated = this.types[id][0];
+ if (unannotated == derived) { //$IDENTITY-COMPARISON$
+ // was previously registered as unannotated, replace by a fresh clone to remain unannotated:
+ this.types[id][0] = unannotated = derived.clone(null);
+ }
+ // proceed as normal:
+ cacheDerivedType(unannotated, derived);
+ } else {
+ throw new IllegalStateException("Type was not yet registered as expected: "+derived); //$NON-NLS-1$
+ }
+ }
+
// Given a type, return all its variously annotated versions.
public TypeBinding[] getAnnotatedTypes(TypeBinding type) {
return Binding.NO_TYPES;
@@ -99,8 +220,14 @@
/* Note: parameters will not have type type annotations if lookup environment directly uses TypeSystem as its typeSystem. When ATS is used however
they may be annotated and we need to materialize the unannotated versions and work on them.
+
+ See ArrayBinding.swapUnresolved for further special case handling if incoming leafType is a URB that would resolve to a raw type later.
*/
public ArrayBinding getArrayType(TypeBinding leafType, int dimensions) {
+ if (leafType instanceof ArrayBinding) {
+ dimensions += leafType.dimensions();
+ leafType = leafType.leafComponentType();
+ }
TypeBinding unannotatedLeafType = getUnannotatedType(leafType);
TypeBinding[] derivedTypes = this.types[unannotatedLeafType.id];
int i, length = derivedTypes.length;
@@ -144,32 +271,21 @@
unannotatedTypeArguments[i] = getUnannotatedType(typeArguments[i]);
}
ReferenceBinding unannotatedEnclosingType = enclosingType == null ? null : (ReferenceBinding) getUnannotatedType(enclosingType);
-
- TypeBinding[] derivedTypes = this.types[unannotatedGenericType.id];
- int i, length = derivedTypes.length;
- for (i = 0 ; i < length; i++) {
- TypeBinding derivedType = derivedTypes[i];
- if (derivedType == null)
- break;
- if (!derivedType.isParameterizedType() || derivedType.actualType() != unannotatedGenericType || derivedType.hasTypeAnnotations()) //$IDENTITY-COMPARISON$
- continue;
- if (derivedType.enclosingType() == unannotatedEnclosingType && Util.effectivelyEqual(derivedType.typeArguments(), unannotatedTypeArguments)) //$IDENTITY-COMPARISON$
- return (ParameterizedTypeBinding) derivedType;
- }
- if (i == length) {
- System.arraycopy(derivedTypes, 0, derivedTypes = new TypeBinding[length * 2], 0, length);
- this.types[unannotatedGenericType.id] = derivedTypes;
- }
- TypeBinding parameterizedType = derivedTypes[i] = new ParameterizedTypeBinding(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, this.environment);
-
+ ParameterizedTypeBinding parameterizedType = this.parameterizedTypes.get(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, Binding.NO_ANNOTATIONS);
+ if (parameterizedType != null)
+ return parameterizedType;
+
+ parameterizedType = new ParameterizedTypeBinding(unannotatedGenericType, unannotatedTypeArguments, unannotatedEnclosingType, this.environment);
+ cacheDerivedType(unannotatedGenericType, parameterizedType);
+ this.parameterizedTypes.put(genericType, typeArguments, enclosingType, parameterizedType);
int typesLength = this.types.length;
if (this.typeid == typesLength)
System.arraycopy(this.types, 0, this.types = new TypeBinding[typesLength * 2][], 0, typesLength);
this.types[this.typeid] = new TypeBinding[1];
return (ParameterizedTypeBinding) (this.types[parameterizedType.id = this.typeid++][0] = parameterizedType);
}
-
+
public ParameterizedTypeBinding getParameterizedType(ReferenceBinding genericType, TypeBinding[] typeArguments, ReferenceBinding enclosingType, AnnotationBinding[] annotations) {
return getParameterizedType(genericType, typeArguments, enclosingType);
}
@@ -252,6 +368,48 @@
return (WildcardBinding) (this.types[wildcard.id = this.typeid++][0] = wildcard);
}
+ // No need for an override in ATS, since interning is position specific and either the wildcard there is annotated or not.
+ public final CaptureBinding getCapturedWildcard(WildcardBinding wildcard, ReferenceBinding contextType, int start, int end, ASTNode cud, int id) {
+
+ WildcardBinding unannotatedWildcard = (WildcardBinding) getUnannotatedType(wildcard);
+ TypeBinding[] derivedTypes = this.types[unannotatedWildcard.id]; // by construction, cachedInfo != null now.
+ int i, length = derivedTypes.length;
+
+ /* Search backwards looking at recent captures, if we encounter a capture from a different compilation unit, this is a fresh uninterned capture.
+ While compiling one file, we may reach into another file to build structure, we should not compile method bodies there, so we expect to see
+ all captures from the same file together without being interleaved by captures from other files.
+ */
+ int nullSlot = length;
+ for (i = length - 1; i >= -1; --i) {
+ if (i == -1) {
+ i = nullSlot;
+ break;
+ }
+ TypeBinding derivedType = derivedTypes[i];
+ if (derivedType == null) {
+ nullSlot = i;
+ continue;
+ }
+ if (!derivedType.isCapture())
+ continue;
+ CaptureBinding prior = (CaptureBinding) derivedType;
+ if (prior.cud != cud) { // Searching further to the left is futile, exit the loop.
+ i = nullSlot;
+ break;
+ }
+ if (prior.sourceType != contextType || prior.start != start || prior.end != end) //$IDENTITY-COMPARISON$
+ continue;
+ return prior;
+ }
+
+ if (i == length) {
+ System.arraycopy(derivedTypes, 0, derivedTypes = new TypeBinding[length * 2], 0, length);
+ this.types[unannotatedWildcard.id] = derivedTypes;
+ }
+ return (CaptureBinding) (derivedTypes[i] = new CaptureBinding(wildcard, contextType, start, end, cud, id));
+ // the above constructor already registers the capture, don't repeat that here
+ }
+
public WildcardBinding getWildcard(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, AnnotationBinding[] annotations) {
return getWildcard(genericType, rank, bound, otherBounds, boundKind);
}
@@ -270,10 +428,20 @@
throw new IllegalStateException();
TypeBinding[] derivedTypes = this.types[keyType.id];
- int i = 0, length = derivedTypes.length;
- while (i < length && derivedTypes[i] != null) {
- i++;
- }
+ // binary search for the *earliest* slot with a null reference. By design and construction, a null value will never be followed by a valid derived type.
+ int first, last,length = derivedTypes.length;
+ first = 0; last = length;
+ int i = (first + last) / 2;
+ do {
+ if (derivedTypes[i] == null) {
+ if (i == first || i > 0 && derivedTypes[i - 1] != null)
+ break;
+ last = i - 1;
+ } else {
+ first = i + 1;
+ }
+ i = (first + last) / 2;
+ } while (i < length && first <= last);
if (i == length) {
System.arraycopy(derivedTypes, 0, derivedTypes = new TypeBinding[length * 2], 0, length);
this.types[keyType.id] = derivedTypes;
@@ -329,14 +497,21 @@
this.annotationTypes = new SimpleLookupTable(16);
this.typeid = TypeIds.T_LastWellKnownTypeId;
this.types = new TypeBinding[TypeIds.T_LastWellKnownTypeId * 2][];
+ this.parameterizedTypes = new HashedParameterizedTypes();
}
public void updateCaches(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType) {
final int unresolvedTypeId = unresolvedType.id;
if (unresolvedTypeId != TypeIds.NoId) {
- if (this.types[unresolvedTypeId] != null && this.types[unresolvedTypeId][0] == unresolvedType) { //$IDENTITY-COMPARISON$
- resolvedType.id = unresolvedTypeId;
- this.types[unresolvedTypeId][0] = resolvedType;
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=432977
+ TypeBinding[] derivedTypes = this.types[unresolvedTypeId];
+ for (int i = 0, length = derivedTypes == null ? 0 : derivedTypes.length; i < length; i++) {
+ if (derivedTypes[i] == null)
+ break;
+ if (derivedTypes[i] == unresolvedType) { //$IDENTITY-COMPARISON$
+ resolvedType.id = unresolvedTypeId;
+ derivedTypes[i] = resolvedType;
+ }
}
}
if (this.annotationTypes.get(unresolvedType) != null) { // update the key
@@ -350,7 +525,7 @@
}
}
- public final TypeBinding getIntersectionCastType(ReferenceBinding[] intersectingTypes) {
+ public final TypeBinding getIntersectionType18(ReferenceBinding[] intersectingTypes) {
int intersectingTypesLength = intersectingTypes == null ? 0 : intersectingTypes.length;
if (intersectingTypesLength == 0)
return null;
@@ -365,7 +540,7 @@
TypeBinding derivedType = derivedTypes[i];
if (derivedType == null)
break;
- if (!derivedType.isIntersectionCastType())
+ if (!derivedType.isIntersectionType18())
continue;
ReferenceBinding [] priorIntersectingTypes = derivedType.getIntersectingTypes();
if (priorIntersectingTypes.length != intersectingTypesLength)
@@ -376,7 +551,7 @@
}
return derivedType;
}
- return cacheDerivedType(keyType, new IntersectionCastTypeBinding(intersectingTypes, this.environment));
+ return cacheDerivedType(keyType, new IntersectionTypeBinding18(intersectingTypes, this.environment));
}
/**
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
index 1db63ed..ca05956 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,12 @@
* Bug 438179 - [1.8][null] 'Contradictory null annotations' error on type variable with explicit null-annotation.
* Bug 440143 - [1.8][null] one more case of contradictory null annotations regarding type variables
* Bug 440759 - [1.8][null] @NonNullByDefault should never affect wildcards and uses of a type variable
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
+ * Bug 456497 - [1.8][null] during inference nullness from target type is lost against weaker hint from applicability analysis
+ * Bug 456459 - Discrepancy between Eclipse compiler and javac - Enums, interfaces, and generics
+ * Bug 456487 - [1.8][null] @Nullable type variant of @NonNull-constrained type parameter causes grief
+ * Bug 462790 - [null] NPE in Expression.computeConversion()
+ * Bug 456532 - [1.8][null] ReferenceBinding.appendNullAnnotation() includes phantom annotations in error messages
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -70,8 +76,19 @@
this.tagBits |= TagBits.HasTypeVariable;
this.environment = environment;
this.typeBits = TypeIds.BitUninitialized;
+ computeId(environment);
}
+ // for subclass CaptureBinding
+ protected TypeVariableBinding(char[] sourceName, LookupEnvironment environment) {
+ this.sourceName = sourceName;
+ this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat type var as public
+ this.tagBits |= TagBits.HasTypeVariable;
+ this.environment = environment;
+ this.typeBits = TypeIds.BitUninitialized;
+ // don't yet compute the ID!
+ }
+
public TypeVariableBinding(TypeVariableBinding prototype) {
super(prototype);
this.declaringElement = prototype.declaringElement;
@@ -94,7 +111,7 @@
if (argumentType instanceof TypeVariableBinding && scope != null) {
TypeBinding bound = ((TypeVariableBinding)argumentType).firstBound;
if (bound instanceof ParameterizedTypeBinding) {
- int code2 = boundCheck(substitution, bound.capture(scope, -1), scope); // no position needed as this capture will never escape this context
+ int code2 = boundCheck(substitution, bound.capture(scope, -1, -1), scope); // no position needed as this capture will never escape this context
return Math.min(code, code2);
}
}
@@ -140,7 +157,8 @@
return TypeConstants.MISMATCH;
}
} else {
- if (!wildcardBound.isTypeVariable() && !substitutedSuperType.isTypeVariable()) {
+ if (denotesRelevantSuperClass(wildcardBound) && denotesRelevantSuperClass(substitutedSuperType)) {
+ // non-object real superclass should have produced a valid 'match' above
return TypeConstants.MISMATCH;
}
}
@@ -218,6 +236,13 @@
return unchecked ? TypeConstants.UNCHECKED : TypeConstants.OK;
}
+ boolean denotesRelevantSuperClass(TypeBinding type) {
+ if (!type.isTypeVariable() && !type.isInterface() && type.id != TypeIds.T_JavaLangObject)
+ return true;
+ ReferenceBinding aSuperClass = type.superclass();
+ return aSuperClass != null && aSuperClass.id != TypeIds.T_JavaLangObject && !aSuperClass.isTypeVariable();
+ }
+
public int boundsCount() {
if (this.firstBound == null) {
return 0;
@@ -704,12 +729,10 @@
public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) {
if (getClass() == TypeVariableBinding.class) {
- // TVB only: if the declaration already carries type annotations,
- // clone the unannotated binding first to ensure TypeSystem.getUnnanotatedType() will see it at position 0:
- TypeBinding unannotated = clone(null);
- this.environment.getUnannotatedType(unannotated); // register unannotated
- this.id = unannotated.id; // transfer fresh id
- this.environment.typeSystem.cacheDerivedType(this, unannotated, this); // register this
+ // TVB only: if the declaration itself carries type annotations,
+ // make sure TypeSystem will still have an unannotated variant at position 0, to answer getUnannotated()
+ // (in this case the unannotated type is never explicit in source code, that's why we need this charade).
+ this.environment.typeSystem.forceRegisterAsDerived(this);
} else {
this.environment.getUnannotatedType(this); // exposes original TVB/capture to type system for id stamping purposes.
}
@@ -787,18 +810,39 @@
return readableName;
}
- public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
- if (!hasTypeAnnotations())
- return this;
- if (removeOnlyNullAnnotations && !hasNullTypeAnnotations())
+ protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) {
+ int oldSize = nameBuffer.length();
+ super.appendNullAnnotation(nameBuffer, options);
+ if (oldSize == nameBuffer.length()) { // nothing appended in super.appendNullAnnotation()?
+ if (hasNullTypeAnnotations()) {
+ // see if the prototype has null type annotations:
+ TypeVariableBinding[] typeVariables = null;
+ if (this.declaringElement instanceof ReferenceBinding) {
+ typeVariables = ((ReferenceBinding) this.declaringElement).typeVariables();
+ } else if (this.declaringElement instanceof MethodBinding) {
+ typeVariables = ((MethodBinding) this.declaringElement).typeVariables();
+ }
+ if (typeVariables != null && typeVariables.length > this.rank) {
+ TypeVariableBinding prototype = typeVariables[this.rank];
+ if (prototype != this)//$IDENTITY-COMPARISON$
+ prototype.appendNullAnnotation(nameBuffer, options);
+ }
+ }
+ }
+ }
+
+ public TypeBinding unannotated() {
+ return this.hasTypeAnnotations() ? this.environment.getUnannotatedType(this) : this;
+ }
+
+ @Override
+ public TypeBinding withoutToplevelNullAnnotation() {
+ if (!hasNullTypeAnnotations())
return this;
TypeBinding unannotated = this.environment.getUnannotatedType(this);
- if (removeOnlyNullAnnotations) {
- AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
- if (newAnnotations.length > 0)
- return this.environment.createAnnotatedType(unannotated, newAnnotations);
- // FIXME: selectively keep type annotations on bounds
- }
+ AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations);
+ if (newAnnotations.length > 0)
+ return this.environment.createAnnotatedType(unannotated, newAnnotations);
return unannotated;
}
/**
@@ -852,7 +896,7 @@
this.tagBits &= ~TagBits.AnnotationNullMASK;
} else {
// implicit annotation: let the new one override
- return boundType.unannotated(true);
+ return boundType.withoutToplevelNullAnnotation();
}
return boundType;
}
@@ -875,10 +919,11 @@
public TypeBinding setFirstBound(TypeBinding firstBound) {
this.firstBound = firstBound;
if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
- TypeBinding [] annotatedTypes = this.environment.getAnnotatedTypes(this);
+ TypeBinding [] annotatedTypes = getDerivedTypesForDeferredInitialization();
for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
TypeVariableBinding annotatedType = (TypeVariableBinding) annotatedTypes[i];
- annotatedType.firstBound = firstBound;
+ if (annotatedType.firstBound == null)
+ annotatedType.firstBound = firstBound;
}
}
if (firstBound != null && firstBound.hasNullTypeAnnotations())
@@ -891,10 +936,11 @@
public ReferenceBinding setSuperClass(ReferenceBinding superclass) {
this.superclass = superclass;
if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
- TypeBinding [] annotatedTypes = this.environment.getAnnotatedTypes(this);
+ TypeBinding [] annotatedTypes = getDerivedTypesForDeferredInitialization();
for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
TypeVariableBinding annotatedType = (TypeVariableBinding) annotatedTypes[i];
- annotatedType.superclass = superclass;
+ if (annotatedType.superclass == null)
+ annotatedType.superclass = superclass;
}
}
return superclass;
@@ -905,21 +951,26 @@
public ReferenceBinding [] setSuperInterfaces(ReferenceBinding[] superInterfaces) {
this.superInterfaces = superInterfaces;
if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
- TypeBinding [] annotatedTypes = this.environment.getAnnotatedTypes(this);
+ TypeBinding [] annotatedTypes = getDerivedTypesForDeferredInitialization();
for (int i = 0, length = annotatedTypes == null ? 0 : annotatedTypes.length; i < length; i++) {
TypeVariableBinding annotatedType = (TypeVariableBinding) annotatedTypes[i];
- annotatedType.superInterfaces = superInterfaces;
+ if (annotatedType.superInterfaces == null)
+ annotatedType.superInterfaces = superInterfaces;
}
}
return superInterfaces;
}
+ protected TypeBinding[] getDerivedTypesForDeferredInitialization() {
+ return this.environment.getAnnotatedTypes(this);
+ }
+
public TypeBinding combineTypeAnnotations(TypeBinding substitute) {
if (hasTypeAnnotations()) {
// may need to merge annotations from the original variable and from substitution:
if (hasRelevantTypeUseNullAnnotations()) {
// explicit type use null annotation overrides any annots on type parameter and concrete type arguments
- substitute = substitute.unannotated(true);
+ substitute = substitute.withoutToplevelNullAnnotation();
}
if (this.typeAnnotations != Binding.NO_ANNOTATIONS)
return this.environment.createAnnotatedType(substitute, this.typeAnnotations);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
index 56df9f3..fa122f8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java
@@ -11,6 +11,7 @@
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 392384 - [1.8][compiler][null] Restore nullness info from type annotations in class files
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
+ * Bug 467032 - TYPE_USE Null Annotations: IllegalStateException with annotated arrays of Enum when accessed via BinaryTypeBinding
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -39,8 +40,8 @@
}
public TypeBinding clone(TypeBinding outerType) {
- if (this.resolvedType != null || this.depth() > 0)
- throw new IllegalStateException();
+ if (this.resolvedType != null)
+ return this.resolvedType.clone(outerType);
UnresolvedReferenceBinding copy = new UnresolvedReferenceBinding(this);
this.addWrapper(copy, null);
return copy;
@@ -109,6 +110,9 @@
// create a proxy for the missing BinaryType
targetType = environment.createMissingType(null, this.compoundName);
}
+ if (targetType.id != TypeIds.NoId) {
+ this.id = targetType.id;
+ }
setResolvedType(targetType, environment);
}
if (convertGenericToRawType) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
index 720fa69..b41eb33 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
* Stephan Herrmann - Contribution for
* bug 331649 - [compiler][null] consider null annotations for fields
* Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
+ * Bug 458396 - NPE in CodeStream.invoke()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -40,6 +41,14 @@
return this.constant;
}
+ /**
+ * Call this variant during resolve / analyse, so we can handle the case
+ * when a tentative lambda resolve triggers resolving of outside code.
+ */
+ public Constant constant(Scope scope) {
+ return constant();
+ }
+
public abstract AnnotationBinding[] getAnnotations();
public final boolean isBlankFinal(){
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java
index 2fb4a49..71555f2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/VoidTypeBinding.java
@@ -27,7 +27,7 @@
return; // reject misguided attempt.
}
- public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
+ public TypeBinding unannotated() {
return this;
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
index ea8892a..d686302 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java
@@ -20,6 +20,7 @@
* Bug 435962 - [RC2] StackOverFlowError when building
* Bug 438458 - [1.8][null] clean up handling of null type annotations wrt type variables
* Bug 440759 - [1.8][null] @NonNullByDefault should never affect wildcards and uses of a type variable
+ * Bug 441693 - [1.8][null] Bogus warning for type argument annotated with @NonNull
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.lookup;
@@ -86,7 +87,7 @@
} catch (ArrayStoreException ase) {
return this.bound;
}
- return new IntersectionCastTypeBinding(allBounds, this.environment);
+ return this.environment.createIntersectionType18(allBounds);
}
public ReferenceBinding actualType() {
@@ -885,24 +886,16 @@
return this.typeVariable;
}
- public TypeBinding unannotated(boolean removeOnlyNullAnnotations) {
- if (!hasTypeAnnotations())
+ public TypeBinding unannotated() {
+ return this.hasTypeAnnotations() ? this.environment.getUnannotatedType(this) : this;
+ }
+
+ @Override
+ public TypeBinding withoutToplevelNullAnnotation() {
+ if (!hasNullTypeAnnotations())
return this;
- if (removeOnlyNullAnnotations && !hasNullTypeAnnotations())
- return this;
- ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.genericType.unannotated(removeOnlyNullAnnotations);
- if (removeOnlyNullAnnotations) {
- // cf. structure of uncapture():
- TypeBinding unannotatedBound = this.bound != null ? this.bound.unannotated(removeOnlyNullAnnotations) : null;
- int length = 0;
- TypeBinding [] unannotatedOtherBounds = this.otherBounds == null ? null : new TypeBinding[length = this.otherBounds.length];
- for (int i = 0; i < length; i++) {
- unannotatedOtherBounds[i] = this.otherBounds[i] == null ? null : this.otherBounds[i].unannotated(removeOnlyNullAnnotations);
- }
- AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(getTypeAnnotations());
- return this.environment.createWildcard(unannotatedGenericType, this.rank, unannotatedBound, unannotatedOtherBounds, this.boundKind, newAnnotations);
- }
- return unannotatedGenericType;
+ AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(getTypeAnnotations());
+ return this.environment.createWildcard(this.genericType, this.rank, this.bound, this.otherBounds, this.boundKind, newAnnotations);
}
@Override
public TypeBinding uncapture(Scope scope) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/CommitRollbackParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/CommitRollbackParser.java
deleted file mode 100644
index 8cfabf4..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/CommitRollbackParser.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.compiler.parser;
-
-import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
-
-public abstract class CommitRollbackParser implements TerminalTokens, ParserBasicInformation {
-
- // resumeOnSyntaxError codes:
- protected static final int HALT = 0; // halt and throw up hands.
- protected static final int RESTART = 1; // stacks adjusted, alternate goal from check point.
- protected static final int RESUME = 2; // stacks untouched, just continue from where left off.
-
- public Scanner scanner;
- public int currentToken;
-
- public CommitRollbackParser snapShot;
- private static final int[] RECOVERY_TOKENS = new int [] { TokenNameSEMICOLON, TokenNameRPAREN,};
-
- protected CommitRollbackParser createSnapShotParser() {
- return new Parser();
- }
-
- protected void commit() {
- if (this.snapShot == null) {
- this.snapShot = createSnapShotParser();
- }
- this.snapShot.copyState(this);
- }
-
- public void copyState(CommitRollbackParser commitRollbackParser) {
- // Subclasses should implement.
- }
-
- protected int getNextToken() {
- try {
- return this.scanner.getNextToken();
- } catch (InvalidInputException e) {
- return TokenNameEOF;
- }
- }
-
- protected void shouldStackAssistNode() {
- // Not relevant here.
- }
-
- // We get here on real syntax error or syntax error triggered by fake EOF at completion site, never due to triggered recovery.
- protected int fallBackToSpringForward(Statement unused) {
- int nextToken;
- boolean atCompletionSite = false;
- int automatonState = automatonState();
-
- // If triggered fake EOF at completion site, see if the real next token would have passed muster.
- if (this.currentToken == TokenNameEOF) {
- if (this.scanner.eofPosition < this.scanner.source.length) {
- atCompletionSite = true;
- this.scanner.eofPosition = this.scanner.source.length;
- nextToken = getNextToken();
- if (automatonWillShift(nextToken, automatonState)) {
- this.currentToken = nextToken;
- return RESUME;
- }
- } else {
- nextToken = TokenNameEOF;
- }
- } else {
- nextToken = this.currentToken;
- }
- if (nextToken == TokenNameEOF)
- return HALT; // don't know how to proceed.
- this.scanner.ungetToken(nextToken); // spit out what has been bitten more than we can chew.
- // OK, next token is no good to resume "in place", attempt some local repair. FIXME: need to make sure we don't get stuck keep reducing empty statements !!
- for (int i = 0, length = RECOVERY_TOKENS.length; i < length; i++) {
- if (automatonWillShift(RECOVERY_TOKENS[i], automatonState)) {
- this.currentToken = RECOVERY_TOKENS[i];
- return RESUME;
- }
- }
- // OK, no in place resumption, no local repair, fast forward to next statement.
- if (this.snapShot == null)
- return RESTART;
-
- this.copyState(this.snapShot);
- if (atCompletionSite) {
- this.currentToken = TokenNameSEMICOLON;
- shouldStackAssistNode();
- return RESUME;
- }
- this.currentToken = this.scanner.fastForward(unused);
- return RESUME;
- }
-
- public abstract int automatonState();
-
- public abstract boolean automatonWillShift(int nextToken, int lastAction);
-}
-
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 41c43d5..d2fd885 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -999,2478 +999,2480 @@
optimizedConcatNodeLists();
}
// This method is part of an automatic generation : do NOT edit-modify
+ // This method is part of an automatic generation : do NOT edit-modify
protected void consumeRule(int act) {
-switch ( act ) {
- case 39 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); } //$NON-NLS-1$
- consumePrimitiveType();
- break;
+ switch ( act ) {
+ case 39 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); } //$NON-NLS-1$
+ consumePrimitiveType();
+ break;
+
+ case 53 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
+ consumeReferenceType();
+ break;
+
+ case 57 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); } //$NON-NLS-1$
+ consumeClassOrInterfaceName();
+ break;
+
+ case 58 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); } //$NON-NLS-1$
+ consumeClassOrInterface();
+ break;
+
+ case 59 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); } //$NON-NLS-1$
+ consumeGenericType();
+ break;
+
+ case 60 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$
+ consumeGenericTypeWithDiamond();
+ break;
+
+ case 61 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); } //$NON-NLS-1$
+ consumeArrayTypeWithTypeArgumentsName();
+ break;
+
+ case 62 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$
+ consumePrimitiveArrayType();
+ break;
+
+ case 63 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$
+ consumeNameArrayType();
+ break;
+
+ case 64 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$
+ consumeGenericTypeNameArrayType();
+ break;
+
+ case 65 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$
+ consumeGenericTypeArrayType();
+ break;
+
+ case 71 : if (DEBUG) { System.out.println("AjName ::= AjSimpleName"); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations();
+ break;
+
+ case 72 : if (DEBUG) { System.out.println("AjName ::= AjQualifiedName"); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations();
+ break;
+
+ case 81 : if (DEBUG) { System.out.println("AjQualifiedName ::= AjName DOT SimpleNameOrAj"); } //$NON-NLS-1$
+ consumeQualifiedName();
+ break;
+
+ case 84 : if (DEBUG) { System.out.println("Name ::= SimpleName"); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations();
+ break;
+
+ case 89 : if (DEBUG) { System.out.println("UnannotatableName ::= UnannotatableName DOT SimpleName"); } //$NON-NLS-1$
+ consumeUnannotatableQualifiedName();
+ break;
+
+ case 90 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT JavaIdentifier"); } //$NON-NLS-1$
+ consumeQualifiedName(false);
+ break;
+
+ case 91 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT TypeAnnotations JavaIdentifier"); } //$NON-NLS-1$
+ consumeQualifiedName(true);
+ break;
+
+ case 92 : if (DEBUG) { System.out.println("TypeAnnotationsopt ::="); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations();
+ break;
+
+ case 96 : if (DEBUG) { System.out.println("TypeAnnotations0 ::= TypeAnnotations0 TypeAnnotation"); } //$NON-NLS-1$
+ consumeOneMoreTypeAnnotation();
+ break;
+
+ case 97 : if (DEBUG) { System.out.println("TypeAnnotation ::= NormalTypeAnnotation"); } //$NON-NLS-1$
+ consumeTypeAnnotation();
+ break;
+
+ case 98 : if (DEBUG) { System.out.println("TypeAnnotation ::= MarkerTypeAnnotation"); } //$NON-NLS-1$
+ consumeTypeAnnotation();
+ break;
+
+ case 99 : if (DEBUG) { System.out.println("TypeAnnotation ::= SingleMemberTypeAnnotation"); } //$NON-NLS-1$
+ consumeTypeAnnotation();
+ break;
+
+ case 100 : if (DEBUG) { System.out.println("TypeAnnotationName ::= AT308 UnannotatableName"); } //$NON-NLS-1$
+ consumeAnnotationName() ;
+ break;
+
+ case 101 : if (DEBUG) { System.out.println("NormalTypeAnnotation ::= TypeAnnotationName LPAREN..."); } //$NON-NLS-1$
+ consumeNormalAnnotation(true) ;
+ break;
+
+ case 102 : if (DEBUG) { System.out.println("MarkerTypeAnnotation ::= TypeAnnotationName"); } //$NON-NLS-1$
+ consumeMarkerAnnotation(true) ;
+ break;
+
+ case 103 : if (DEBUG) { System.out.println("SingleMemberTypeAnnotation ::= TypeAnnotationName LPAREN"); } //$NON-NLS-1$
+ consumeSingleMemberAnnotation(true) ;
+ break;
+
+ case 104 : if (DEBUG) { System.out.println("RejectTypeAnnotations ::="); } //$NON-NLS-1$
+ consumeNonTypeUseName();
+ break;
+
+ case 105 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations();
+ break;
+
+ case 106 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); } //$NON-NLS-1$
+ consumeExplicitThisParameter(false);
+ break;
+
+ case 107 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= UnannotatableName DOT..."); } //$NON-NLS-1$
+ consumeExplicitThisParameter(true);
+ break;
+
+ case 108 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= VariableDeclaratorId"); } //$NON-NLS-1$
+ consumeVariableDeclaratorIdParameter();
+ break;
+
+ case 109 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$
+ consumeCompilationUnit();
+ break;
+
+ case 110 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$
+ consumeInternalCompilationUnit();
+ break;
+
+ case 111 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ consumeInternalCompilationUnit();
+ break;
+
+ case 112 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ consumeInternalCompilationUnitWithTypes();
+ break;
+
+ case 113 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ consumeInternalCompilationUnitWithTypes();
+ break;
+
+ case 114 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
+ consumeInternalCompilationUnit();
+ break;
+
+ case 115 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$
+ consumeInternalCompilationUnitWithTypes();
+ break;
+
+ case 116 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
+ consumeInternalCompilationUnitWithTypes();
+ break;
+
+ case 117 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$
+ consumeEmptyInternalCompilationUnit();
+ break;
+
+ case 118 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$
+ consumeReduceImports();
+ break;
+
+ case 119 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$
+ consumeEnterCompilationUnit();
+ break;
+
+ case 135 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
+ consumeCatchHeader();
+ break;
+
+ case 137 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$
+ consumeImportDeclarations();
+ break;
+
+ case 139 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$
+ consumeTypeDeclarations();
+ break;
+
+ case 140 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$
+ consumePackageDeclaration();
+ break;
+
+ case 141 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$
+ consumePackageDeclarationNameWithModifiers();
+ break;
+
+ case 142 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$
+ consumePackageDeclarationName();
+ break;
+
+ case 143 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$
+ consumePackageComment();
+ break;
+
+ case 148 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$
+ consumeImportDeclaration();
+ break;
+
+ case 149 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name..."); } //$NON-NLS-1$
+ consumeSingleTypeImportDeclarationName();
+ break;
+
+ case 150 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
+ consumeImportDeclaration();
+ break;
+
+ case 151 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$
+ consumeTypeImportOnDemandDeclarationName();
+ break;
+
+ case 154 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeEmptyTypeDeclaration();
+ break;
+
+ case 158 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$
+ consumeModifiers2();
+ break;
+
+ case 171 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$
+ consumeAnnotationAsModifier();
+ break;
+
+ case 184 : if (DEBUG) { System.out.println("AspectDeclaration ::= AspectHeader AspectBody"); } //$NON-NLS-1$
+ consumeAspectDeclaration();
+ break;
+
+ case 185 : if (DEBUG) { System.out.println("AspectHeader ::= AspectHeaderName ClassHeaderExtendsopt"); } //$NON-NLS-1$
+ consumeAspectHeader();
+ break;
+
+ case 188 : if (DEBUG) { System.out.println("AspectHeaderName ::= AspectHeaderName1 TypeParameters"); } //$NON-NLS-1$
+ consumeAspectHeaderNameWithTypeParameters(false);
+ break;
+
+ case 189 : if (DEBUG) { System.out.println("AspectHeaderName ::= AspectHeaderName2 TypeParameters"); } //$NON-NLS-1$
+ consumeAspectHeaderNameWithTypeParameters(true);
+ break;
+
+ case 190 : if (DEBUG) { System.out.println("AspectHeaderName1 ::= Modifiersopt aspect Identifier"); } //$NON-NLS-1$
+ consumeAspectHeaderName(false);
+ break;
+
+ case 191 : if (DEBUG) { System.out.println("AspectHeaderName2 ::= Modifiersopt privileged..."); } //$NON-NLS-1$
+ consumeAspectHeaderName(true);
+ break;
+
+ case 193 : if (DEBUG) { System.out.println("AspectHeaderRest ::= AspectHeaderRestStart PseudoTokens"); } //$NON-NLS-1$
+ consumeAspectHeaderRest();
+ break;
+
+ case 194 : if (DEBUG) { System.out.println("AspectHeaderRestStart ::= Identifier"); } //$NON-NLS-1$
+ consumePseudoTokenIdentifier();
+ break;
+
+ case 197 : if (DEBUG) { System.out.println("AspectBodyDeclarations ::= AspectBodyDeclarations..."); } //$NON-NLS-1$
+ consumeClassBodyDeclarations();
+ break;
+
+ case 198 : if (DEBUG) { System.out.println("AspectBodyDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyClassBodyDeclarationsopt();
+ break;
+
+ case 199 : if (DEBUG) { System.out.println("AspectBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ consumeClassBodyDeclarationsopt();
+ break;
+
+ case 200 : if (DEBUG) { System.out.println("AspectBodyDeclaration ::=..."); } //$NON-NLS-1$
+ consumeClassBodyDeclarationInAspect();
+ break;
+
+ case 204 : if (DEBUG) { System.out.println("ClassBodyDeclarationNoAroundMethod ::= Diet NestedMethod"); } //$NON-NLS-1$
+ consumeClassBodyDeclaration();
+ break;
+
+ case 214 : if (DEBUG) { System.out.println("ClassMemberDeclarationNoAroundMethod ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeEmptyTypeDeclaration();
+ break;
- case 53 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
- consumeReferenceType();
- break;
+ case 216 : if (DEBUG) { System.out.println("MethodDeclarationNoAround ::= MethodHeaderNoAround..."); } //$NON-NLS-1$
+ // set to true to consume a method with a body
+ consumeMethodDeclaration(true,false);
+ break;
+
+ case 217 : if (DEBUG) { System.out.println("AbstractMethodDeclarationNoAround ::=..."); } //$NON-NLS-1$
+ // set to false to consume a method without body
+ consumeMethodDeclaration(false,false);
+ break;
+
+ case 218 : if (DEBUG) { System.out.println("MethodHeaderNoAround ::= MethodHeaderNameNoAround..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 219 : if (DEBUG) { System.out.println("MethodHeaderNameNoAround ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
+ consumeMethodHeaderNameWithTypeParameters(false);
+ break;
+
+ case 220 : if (DEBUG) { System.out.println("MethodHeaderNameNoAround ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ consumeMethodHeaderName(false);
+ break;
+
+ case 221 : if (DEBUG) { System.out.println("PointcutDeclaration ::= PointcutHeader..."); } //$NON-NLS-1$
+ consumeEmptyPointcutDeclaration();
+ break;
+
+ case 222 : if (DEBUG) { System.out.println("PointcutDeclaration ::= PointcutHeader..."); } //$NON-NLS-1$
+ consumePointcutDeclaration();
+ break;
+
+ case 223 : if (DEBUG) { System.out.println("PointcutHeader ::= Modifiersopt pointcut JavaIdentifier"); } //$NON-NLS-1$
+ consumePointcutHeader();
+ break;
+
+ case 226 : if (DEBUG) { System.out.println("AroundDeclaration ::= AroundHeader MethodBody"); } //$NON-NLS-1$
+ consumeAroundDeclaration();
+ break;
+
+ case 227 : if (DEBUG) { System.out.println("AroundHeader ::= AroundHeaderName FormalParameterListopt"); } //$NON-NLS-1$
+ consumeAroundHeader();
+ break;
+
+ case 228 : if (DEBUG) { System.out.println("AroundHeaderName ::= Modifiersopt Type around LPAREN"); } //$NON-NLS-1$
+ consumeAroundHeaderName();
+ break;
+
+ case 229 : if (DEBUG) { System.out.println("AroundHeaderName ::= Modifiersopt around LPAREN"); } //$NON-NLS-1$
+ consumeAroundHeaderNameMissingReturnType();
+ break;
+
+ case 230 : if (DEBUG) { System.out.println("BasicAdviceDeclaration ::= BasicAdviceHeader MethodBody"); } //$NON-NLS-1$
+ consumeBasicAdviceDeclaration();
+ break;
+
+ case 233 : if (DEBUG) { System.out.println("BeforeAdviceHeader ::= BeforeAdviceHeaderName..."); } //$NON-NLS-1$
+ consumeBasicAdviceHeader();
+ break;
+
+ case 234 : if (DEBUG) { System.out.println("AfterAdviceHeader ::= AfterAdviceHeaderName..."); } //$NON-NLS-1$
+ consumeBasicAdviceHeader();
+ break;
+
+ case 235 : if (DEBUG) { System.out.println("BeforeAdviceHeaderName ::= Modifiersopt before LPAREN"); } //$NON-NLS-1$
+ consumeBasicAdviceHeaderName(false);
+ break;
+
+ case 236 : if (DEBUG) { System.out.println("AfterAdviceHeaderName ::= Modifiersopt after LPAREN"); } //$NON-NLS-1$
+ consumeBasicAdviceHeaderName(true);
+ break;
+
+ case 237 : if (DEBUG) { System.out.println("ExtraParamopt ::= Identifier LPAREN FormalParameter..."); } //$NON-NLS-1$
+ consumeExtraParameterWithFormal();
+ break;
+
+ case 238 : if (DEBUG) { System.out.println("ExtraParamopt ::= Identifier LPAREN RPAREN"); } //$NON-NLS-1$
+ consumeExtraParameterNoFormal();
+ break;
+
+ case 239 : if (DEBUG) { System.out.println("ExtraParamopt ::= Identifier"); } //$NON-NLS-1$
+ consumeExtraParameterNoFormal();
+ break;
+
+ case 241 : if (DEBUG) { System.out.println("OnType ::= JavaIdentifier"); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations();
+ break;
+
+ case 242 : if (DEBUG) { System.out.println("OnType ::= OnType DOT JavaIdentifier"); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations(); consumeQualifiedName();
+ break;
+
+ case 247 : if (DEBUG) { System.out.println("InterTypeMethodDeclaration ::= InterTypeMethodHeader..."); } //$NON-NLS-1$
+ // set to true to consume a method with a body
+ consumeInterTypeMethodDeclaration(true);
+ break;
+
+ case 248 : if (DEBUG) { System.out.println("InterTypeMethodHeader ::= InterTypeMethodHeaderName..."); } //$NON-NLS-1$
+ consumeInterTypeMethodHeader();
+ break;
+
+ case 249 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
+ consumeInterTypeMethodHeaderName(false,false);
+ break;
+
+ case 250 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
+ consumeInterTypeMethodHeaderNameIllegallyUsingTypePattern("*");
+ break;
+
+ case 251 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
+ consumeInterTypeMethodHeaderNameIllegallyUsingTypePattern("+");
+ break;
+
+ case 252 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
+ consumeInterTypeMethodHeaderName(false,true);
+ break;
+
+ case 253 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeInterTypeMethodHeaderName(true,false);
+ break;
+
+ case 254 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeInterTypeMethodHeaderName(true,true);
+ break;
+
+ case 255 : if (DEBUG) { System.out.println("AbstractInterTypeMethodDeclaration ::=..."); } //$NON-NLS-1$
+ // set to false to consume a method without body
+ consumeInterTypeMethodDeclaration(false);
+ break;
+
+ case 256 : if (DEBUG) { System.out.println("TypeParametersAsReference ::= TypeParameters"); } //$NON-NLS-1$
+ convertTypeParametersToSingleTypeReferences();
+ break;
+
+ case 257 : if (DEBUG) { System.out.println("InterTypeConstructorDeclaration ::=..."); } //$NON-NLS-1$
+ // set to true to consume a method with a body
+ consumeInterTypeConstructorDeclaration();
+ break;
+
+ case 258 : if (DEBUG) { System.out.println("InterTypeConstructorHeader ::=..."); } //$NON-NLS-1$
+ consumeInterTypeConstructorHeader();
+ break;
+
+ case 259 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name DOT"); } //$NON-NLS-1$
+ consumeInterTypeConstructorHeaderName(false,false);
+ break;
+
+ case 260 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name DOT"); } //$NON-NLS-1$
+ consumeInterTypeConstructorHeaderNameIllegallyUsingTypePattern("*");
+ break;
+
+ case 261 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name..."); } //$NON-NLS-1$
+ consumeInterTypeConstructorHeaderNameIllegallyUsingTypePattern("+");
+ break;
+
+ case 262 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeInterTypeConstructorHeaderName(true,false);
+ break;
+
+ case 263 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeInterTypeConstructorHeaderName(false,true);
+ break;
+
+ case 264 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeInterTypeConstructorHeaderName(true,true);
+ break;
+
+ case 265 : if (DEBUG) { System.out.println("InterTypeFieldDeclaration ::= InterTypeFieldHeader..."); } //$NON-NLS-1$
+ consumeInterTypeFieldDeclaration();
+ break;
+
+ case 266 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType DOT..."); } //$NON-NLS-1$
+ consumeInterTypeFieldHeader(false);
+ break;
+
+ case 267 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType DOT..."); } //$NON-NLS-1$
+ consumeInterTypeFieldHeaderIllegallyAttemptingToUseATypePattern("*");
+ break;
+
+ case 268 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType PLUS"); } //$NON-NLS-1$
+ consumeInterTypeFieldHeaderIllegallyAttemptingToUseATypePattern("+");
+ break;
+
+ case 269 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType..."); } //$NON-NLS-1$
+ consumeInterTypeFieldHeader(true);
+ break;
+
+ case 270 : if (DEBUG) { System.out.println("InterTypeFieldBody ::="); } //$NON-NLS-1$
+ consumeExitITDVariableWithoutInitializer();
+ break;
+
+ case 271 : if (DEBUG) { System.out.println("InterTypeFieldBody ::= EQUAL ForceNoDiet..."); } //$NON-NLS-1$
+ consumeExitITDVariableWithInitializer();
+ break;
+
+ case 273 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareHeader PseudoTokens..."); } //$NON-NLS-1$
+ consumeDeclareDeclaration();
+ break;
+
+ case 274 : if (DEBUG) { System.out.println("DeclareHeader ::= declare Identifier COLON"); } //$NON-NLS-1$
+ consumeDeclareHeader();
+ break;
+
+ case 275 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareAnnotationHeader..."); } //$NON-NLS-1$
+ consumeDeclareAnnotation(' ');
+ break;
+
+ case 276 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareAnnotationHeader..."); } //$NON-NLS-1$
+ consumeDeclareAnnotation('+');
+ break;
+
+ case 277 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareAnnotationHeader..."); } //$NON-NLS-1$
+ consumeDeclareAnnotation('-');
+ break;
+
+ case 280 : if (DEBUG) { System.out.println("DeclareAnnotationHeader ::= declare AT Identifier COLON"); } //$NON-NLS-1$
+ consumeDeclareAnnotationHeader();
+ break;
+
+ case 283 : if (DEBUG) { System.out.println("PseudoTokens ::= PseudoTokens ColonPseudoToken"); } //$NON-NLS-1$
+ consumePseudoTokens();
+ break;
+
+ case 284 : if (DEBUG) { System.out.println("PseudoTokens ::= PseudoTokens PseudoToken"); } //$NON-NLS-1$
+ consumePseudoTokens();
+ break;
+
+ case 286 : if (DEBUG) { System.out.println("PseudoTokensNoColon ::= PseudoTokensNoColon PseudoToken"); } //$NON-NLS-1$
+ consumePseudoTokens();
+ break;
+
+ case 287 : if (DEBUG) { System.out.println("ColonPseudoToken ::= COLON"); } //$NON-NLS-1$
+ consumePseudoToken(":");
+ break;
+
+ case 288 : if (DEBUG) { System.out.println("PseudoToken ::= JavaIdentifier"); } //$NON-NLS-1$
+ consumePseudoTokenIdentifier();
+ break;
+
+ case 289 : if (DEBUG) { System.out.println("PseudoToken ::= LPAREN"); } //$NON-NLS-1$
+ consumePseudoToken("(");
+ break;
+
+ case 290 : if (DEBUG) { System.out.println("PseudoToken ::= RPAREN"); } //$NON-NLS-1$
+ consumePseudoToken(")");
+ break;
+
+ case 291 : if (DEBUG) { System.out.println("PseudoToken ::= DOT"); } //$NON-NLS-1$
+ consumePseudoToken(".");
+ break;
+
+ case 292 : if (DEBUG) { System.out.println("PseudoToken ::= MULTIPLY"); } //$NON-NLS-1$
+ consumePseudoToken("*");
+ break;
+
+ case 293 : if (DEBUG) { System.out.println("PseudoToken ::= PLUS"); } //$NON-NLS-1$
+ consumePseudoToken("+");
+ break;
+
+ case 294 : if (DEBUG) { System.out.println("PseudoToken ::= EQUAL"); } //$NON-NLS-1$
+ consumePseudoToken("=");
+ break;
+
+ case 295 : if (DEBUG) { System.out.println("PseudoToken ::= AND_AND"); } //$NON-NLS-1$
+ consumePseudoToken("&&");
+ break;
+
+ case 296 : if (DEBUG) { System.out.println("PseudoToken ::= OR_OR"); } //$NON-NLS-1$
+ consumePseudoToken("||");
+ break;
+
+ case 297 : if (DEBUG) { System.out.println("PseudoToken ::= NOT"); } //$NON-NLS-1$
+ consumePseudoToken("!");
+ break;
+
+ case 298 : if (DEBUG) { System.out.println("PseudoToken ::= COMMA"); } //$NON-NLS-1$
+ consumePseudoToken(",");
+ break;
+
+ case 299 : if (DEBUG) { System.out.println("PseudoToken ::= LBRACKET"); } //$NON-NLS-1$
+ consumePseudoToken("[");
+ break;
+
+ case 300 : if (DEBUG) { System.out.println("PseudoToken ::= RBRACKET"); } //$NON-NLS-1$
+ consumePseudoToken("]");
+ break;
+
+ case 301 : if (DEBUG) { System.out.println("PseudoToken ::= AT"); } //$NON-NLS-1$
+ consumePseudoToken("@");
+ break;
+
+ case 302 : if (DEBUG) { System.out.println("PseudoToken ::= ELLIPSIS"); } //$NON-NLS-1$
+ consumePseudoToken("...");
+ break;
+
+ case 303 : if (DEBUG) { System.out.println("PseudoToken ::= QUESTION"); } //$NON-NLS-1$
+ consumePseudoToken("?");
+ break;
+
+ case 304 : if (DEBUG) { System.out.println("PseudoToken ::= LESS"); } //$NON-NLS-1$
+ consumePseudoToken("<");
+ break;
+
+ case 305 : if (DEBUG) { System.out.println("PseudoToken ::= GREATER"); } //$NON-NLS-1$
+ consumePseudoToken(">");
+ break;
+
+ case 306 : if (DEBUG) { System.out.println("PseudoToken ::= RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumePseudoToken(">>");
+ break;
+
+ case 307 : if (DEBUG) { System.out.println("PseudoToken ::= UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumePseudoToken(">>>");
+ break;
+
+ case 308 : if (DEBUG) { System.out.println("PseudoToken ::= AND"); } //$NON-NLS-1$
+ consumePseudoToken("&");
+ break;
+
+ case 309 : if (DEBUG) { System.out.println("PseudoToken ::= NOT_EQUAL"); } //$NON-NLS-1$
+ consumePseudoToken("!=");
+ break;
+
+ case 310 : if (DEBUG) { System.out.println("PseudoToken ::= PrimitiveType"); } //$NON-NLS-1$
+ consumePseudoTokenPrimitiveType();
+ break;
+
+ case 311 : if (DEBUG) { System.out.println("PseudoToken ::= SimpleModifier"); } //$NON-NLS-1$
+ consumePseudoTokenModifier();
+ break;
+
+ case 312 : if (DEBUG) { System.out.println("PseudoToken ::= Literal"); } //$NON-NLS-1$
+ consumePseudoTokenLiteral();
+ break;
+
+ case 313 : if (DEBUG) { System.out.println("PseudoToken ::= this"); } //$NON-NLS-1$
+ consumePseudoToken("this", 1, true);
+ break;
+
+ case 314 : if (DEBUG) { System.out.println("PseudoToken ::= class"); } //$NON-NLS-1$
+ consumePseudoToken("class", 1, true);
+ break;
+
+ case 315 : if (DEBUG) { System.out.println("PseudoToken ::= super"); } //$NON-NLS-1$
+ consumePseudoToken("super", 1, true);
+ break;
+
+ case 316 : if (DEBUG) { System.out.println("PseudoToken ::= if LPAREN Expression RPAREN"); } //$NON-NLS-1$
+ consumePseudoTokenIf();
+ break;
+
+ case 317 : if (DEBUG) { System.out.println("PseudoToken ::= assert"); } //$NON-NLS-1$
+ consumePseudoToken("assert", 1, true);
+ break;
+
+ case 318 : if (DEBUG) { System.out.println("PseudoToken ::= import"); } //$NON-NLS-1$
+ consumePseudoToken("import", 1, true);
+ break;
+
+ case 319 : if (DEBUG) { System.out.println("PseudoToken ::= package"); } //$NON-NLS-1$
+ consumePseudoToken("package", 1, true);
+ break;
+
+ case 320 : if (DEBUG) { System.out.println("PseudoToken ::= throw"); } //$NON-NLS-1$
+ consumePseudoToken("throw", 1, true);
+ break;
+
+ case 321 : if (DEBUG) { System.out.println("PseudoToken ::= new"); } //$NON-NLS-1$
+ consumePseudoToken("new", 1, true);
+ break;
+
+ case 322 : if (DEBUG) { System.out.println("PseudoToken ::= do"); } //$NON-NLS-1$
+ consumePseudoToken("do", 1, true);
+ break;
+
+ case 323 : if (DEBUG) { System.out.println("PseudoToken ::= for"); } //$NON-NLS-1$
+ consumePseudoToken("for", 1, true);
+ break;
+
+ case 324 : if (DEBUG) { System.out.println("PseudoToken ::= switch"); } //$NON-NLS-1$
+ consumePseudoToken("switch", 1, true);
+ break;
+
+ case 325 : if (DEBUG) { System.out.println("PseudoToken ::= try"); } //$NON-NLS-1$
+ consumePseudoToken("try", 1, true);
+ break;
+
+ case 326 : if (DEBUG) { System.out.println("PseudoToken ::= while"); } //$NON-NLS-1$
+ consumePseudoToken("while", 1, true);
+ break;
+
+ case 327 : if (DEBUG) { System.out.println("PseudoToken ::= break"); } //$NON-NLS-1$
+ consumePseudoToken("break", 1, true);
+ break;
+
+ case 328 : if (DEBUG) { System.out.println("PseudoToken ::= continue"); } //$NON-NLS-1$
+ consumePseudoToken("continue", 1, true);
+ break;
+
+ case 329 : if (DEBUG) { System.out.println("PseudoToken ::= return"); } //$NON-NLS-1$
+ consumePseudoToken("return", 1, true);
+ break;
+
+ case 330 : if (DEBUG) { System.out.println("PseudoToken ::= case"); } //$NON-NLS-1$
+ consumePseudoToken("case", 1, true);
+ break;
+
+ case 331 : if (DEBUG) { System.out.println("PseudoToken ::= catch"); } //$NON-NLS-1$
+ consumePseudoToken("catch", 0, true);
+ break;
+
+ case 332 : if (DEBUG) { System.out.println("PseudoToken ::= instanceof"); } //$NON-NLS-1$
+ consumePseudoToken("instanceof", 0, true);
+ break;
+
+ case 333 : if (DEBUG) { System.out.println("PseudoToken ::= else"); } //$NON-NLS-1$
+ consumePseudoToken("else", 0, true);
+ break;
+
+ case 334 : if (DEBUG) { System.out.println("PseudoToken ::= extends"); } //$NON-NLS-1$
+ consumePseudoToken("extends", 0, true);
+ break;
+
+ case 335 : if (DEBUG) { System.out.println("PseudoToken ::= finally"); } //$NON-NLS-1$
+ consumePseudoToken("finally", 0, true);
+ break;
+
+ case 336 : if (DEBUG) { System.out.println("PseudoToken ::= implements"); } //$NON-NLS-1$
+ consumePseudoToken("implements", 0, true);
+ break;
+
+ case 337 : if (DEBUG) { System.out.println("PseudoToken ::= throws"); } //$NON-NLS-1$
+ consumePseudoToken("throws", 0, true);
+ break;
+
+ case 338 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$
+ consumeClassDeclaration();
+ break;
+
+ case 339 : if (DEBUG) { System.out.println("IntertypeClassDeclaration ::= IntertypeClassHeader..."); } //$NON-NLS-1$
+ consumeIntertypeClassDeclaration();
+ break;
+
+ case 340 : if (DEBUG) { System.out.println("IntertypeClassHeader ::= IntertypeClassHeaderName..."); } //$NON-NLS-1$
+ consumeIntertypeClassHeader();
+ break;
+
+ case 341 : if (DEBUG) { System.out.println("IntertypeClassHeaderName ::= IntertypeClassHeaderName1"); } //$NON-NLS-1$
+ consumeIntertypeTypeHeaderNameWithTypeParameters();
+ break;
+
+ case 343 : if (DEBUG) { System.out.println("IntertypeClassHeaderName1 ::= Modifiersopt class OnType"); } //$NON-NLS-1$
+ consumeIntertypeClassHeaderName(false);
+ break;
+
+ case 344 : if (DEBUG) { System.out.println("InterTypeClassHeaderName1 ::= Modifiersopt class OnType"); } //$NON-NLS-1$
+ consumeIntertypeClassHeaderName(true);
+ break;
+
+ case 345 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$
+ consumeClassHeader();
+ break;
+
+ case 346 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$
+ consumeTypeHeaderNameWithTypeParameters();
+ break;
+
+ case 348 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class JavaIdentifier"); } //$NON-NLS-1$
+ consumeClassHeaderName1();
+ break;
+
+ case 349 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$
+ consumeClassHeaderExtends();
+ break;
+
+ case 350 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$
+ consumeClassHeaderImplements();
+ break;
+
+ case 352 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$
+ consumeInterfaceTypeList();
+ break;
+
+ case 353 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
+ consumeInterfaceType();
+ break;
+
+ case 356 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$
+ consumeClassBodyDeclarations();
+ break;
+
+ case 360 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$
+ consumeClassBodyDeclaration();
+ break;
+
+ case 361 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$
+ consumeDiet();
+ break;
- case 57 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); } //$NON-NLS-1$
- consumeClassOrInterfaceName();
- break;
+ case 362 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$
+ consumeClassBodyDeclaration();
+ break;
+
+ case 363 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$
+ consumeCreateInitializer();
+ break;
- case 58 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); } //$NON-NLS-1$
- consumeClassOrInterface();
- break;
+ case 370 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeEmptyTypeDeclaration();
+ break;
- case 59 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); } //$NON-NLS-1$
- consumeGenericType();
- break;
+ case 373 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ consumeFieldDeclaration();
+ break;
+
+ case 375 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$
+ consumeVariableDeclarators();
+ break;
+
+ case 378 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$
+ consumeEnterVariable();
+ break;
+
+ case 379 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$
+ consumeExitVariableWithInitialization();
+ break;
+
+ case 380 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$
+ consumeExitVariableWithoutInitialization();
+ break;
+
+ case 381 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$
+ consumeForceNoDiet();
+ break;
+
+ case 382 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$
+ consumeRestoreDiet();
+ break;
+
+ case 387 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
+ // set to true to consume a method with a body
+ consumeMethodDeclaration(true, false);
+ break;
+
+ case 388 : if (DEBUG) { System.out.println("MethodDeclaration ::= DefaultMethodHeader MethodBody"); } //$NON-NLS-1$
+ // set to true to consume a method with a body
+ consumeMethodDeclaration(true, true);
+ break;
+
+ case 389 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$
+ // set to false to consume a method without body
+ consumeMethodDeclaration(false, false);
+ break;
+
+ case 390 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 391 : if (DEBUG) { System.out.println("DefaultMethodHeader ::= DefaultMethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 392 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$
+ consumeMethodHeaderNameWithTypeParameters(false);
+ break;
+
+ case 393 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type JavaIdentifier..."); } //$NON-NLS-1$
+ consumeMethodHeaderName(false);
+ break;
+
+ case 394 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
+ consumeMethodHeaderNameWithTypeParameters(false);
+ break;
+
+ case 395 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault Type..."); } //$NON-NLS-1$
+ consumeMethodHeaderName(false);
+ break;
+
+ case 396 : if (DEBUG) { System.out.println("ModifiersWithDefault ::= Modifiersopt default..."); } //$NON-NLS-1$
+ consumePushCombineModifiers();
+ break;
+
+ case 397 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
+ consumeMethodHeaderRightParen();
+ break;
+
+ case 398 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$
+ consumeMethodHeaderExtendedDims();
+ break;
+
+ case 399 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$
+ consumeMethodHeaderThrowsClause();
+ break;
+
+ case 400 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$
+ consumeConstructorHeader();
+ break;
+
+ case 401 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$
+ consumeConstructorHeaderNameWithTypeParameters();
+ break;
+
+ case 402 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$
+ consumeConstructorHeaderName();
+ break;
+
+ case 403 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt aspect LPAREN"); } //$NON-NLS-1$
+ consumeConstructorHeaderName();
+ break;
+
+ case 405 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$
+ consumeFormalParameterList();
+ break;
+
+ case 406 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ consumeFormalParameter(false);
+ break;
+
+ case 407 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ consumeFormalParameter(true);
+ break;
+
+ case 408 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type AT308DOTDOTDOT..."); } //$NON-NLS-1$
+ consumeFormalParameter(true);
+ break;
+
+ case 409 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$
+ consumeCatchFormalParameter();
+ break;
+
+ case 410 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$
+ consumeCatchType();
+ break;
+
+ case 411 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$
+ consumeUnionTypeAsClassType();
+ break;
+
+ case 412 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$
+ consumeUnionType();
+ break;
+
+ case 414 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$
+ consumeClassTypeList();
+ break;
+
+ case 415 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$
+ consumeClassTypeElt();
+ break;
+
+ case 416 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$
+ consumeMethodBody();
+ break;
+
+ case 417 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$
+ consumeNestedMethod();
+ break;
+
+ case 418 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$
+ consumeStaticInitializer();
+ break;
- case 60 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$
- consumeGenericTypeWithDiamond();
- break;
+ case 419 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$
+ consumeStaticOnly();
+ break;
+
+ case 420 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$
+ consumeConstructorDeclaration() ;
+ break;
+
+ case 421 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$
+ consumeInvalidConstructorDeclaration() ;
+ break;
+
+ case 422 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(0, THIS_CALL);
+ break;
+
+ case 423 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);
+ break;
+
+ case 424 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(0,SUPER_CALL);
+ break;
+
+ case 425 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);
+ break;
+
+ case 426 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(1, SUPER_CALL);
+ break;
+
+ case 427 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);
+ break;
+
+ case 428 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(2, SUPER_CALL);
+ break;
+
+ case 429 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);
+ break;
+
+ case 430 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(1, THIS_CALL);
+ break;
+
+ case 431 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);
+ break;
+
+ case 432 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(2, THIS_CALL);
+ break;
+
+ case 433 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);
+ break;
+
+ case 434 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$
+ consumeInterfaceDeclaration();
+ break;
+
+ case 435 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$
+ consumeInterfaceHeader();
+ break;
+
+ case 436 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$
+ consumeTypeHeaderNameWithTypeParameters();
+ break;
+
+ case 438 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$
+ consumeInterfaceHeaderName1();
+ break;
+
+ case 439 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$
+ consumeInterfaceHeaderExtends();
+ break;
+
+ case 442 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$
+ consumeInterfaceMemberDeclarations();
+ break;
+
+ case 443 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeEmptyTypeDeclaration();
+ break;
+
+ case 445 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
+ consumeInterfaceMethodDeclaration(false);
+ break;
+
+ case 446 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
+ consumeInterfaceMethodDeclaration(false);
+ break;
+
+ case 447 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
+ consumeInterfaceMethodDeclaration(true);
+ break;
+
+ case 448 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
+ consumeInvalidConstructorDeclaration(true);
+ break;
+
+ case 449 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
+ consumeInvalidConstructorDeclaration(false);
+ break;
+
+ case 460 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$
+ consumePushLeftBrace();
+ break;
+
+ case 461 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$
+ consumeEmptyArrayInitializer();
+ break;
+
+ case 462 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
+ consumeArrayInitializer();
+ break;
+
+ case 463 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
+ consumeArrayInitializer();
+ break;
+
+ case 465 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$
+ consumeVariableInitializers();
+ break;
+
+ case 466 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$
+ consumeBlock();
+ break;
+
+ case 467 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$
+ consumeOpenBlock() ;
+ break;
+
+ case 468 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$
+ consumeBlockStatement() ;
+ break;
+
+ case 469 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$
+ consumeBlockStatements() ;
+ break;
+
+ case 476 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$
+ consumeInvalidInterfaceDeclaration();
+ break;
+
+ case 477 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$
+ consumeInvalidAnnotationTypeDeclaration();
+ break;
+
+ case 478 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$
+ consumeInvalidEnumDeclaration();
+ break;
+
+ case 479 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$
+ consumeLocalVariableDeclarationStatement();
+ break;
+
+ case 480 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$
+ consumeLocalVariableDeclaration();
+ break;
+
+ case 481 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$
+ consumeLocalVariableDeclaration();
+ break;
+
+ case 482 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$
+ consumePushModifiers();
+ break;
+
+ case 483 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$
+ consumePushModifiersForHeader();
+ break;
+
+ case 484 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$
+ consumePushRealModifiers();
+ break;
+
+ case 511 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeEmptyStatement();
+ break;
+
+ case 512 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$
+ consumeStatementLabel() ;
+ break;
+
+ case 513 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$
+ consumeStatementLabel() ;
+ break;
+
+ case 514 : if (DEBUG) { System.out.println("Label ::= JavaIdentifier"); } //$NON-NLS-1$
+ consumeLabel() ;
+ break;
+
+ case 515 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$
+ consumeExpressionStatement();
+ break;
+
+ case 524 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementIfNoElse();
+ break;
+
+ case 525 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementIfWithElse();
+ break;
+
+ case 526 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$
+ consumeStatementIfWithElse();
+ break;
+
+ case 527 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementSwitch() ;
+ break;
+
+ case 528 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$
+ consumeEmptySwitchBlock() ;
+ break;
+
+ case 531 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$
+ consumeSwitchBlock() ;
+ break;
+
+ case 533 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$
+ consumeSwitchBlockStatements() ;
+ break;
+
+ case 534 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$
+ consumeSwitchBlockStatement() ;
+ break;
+
+ case 536 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$
+ consumeSwitchLabels() ;
+ break;
+
+ case 537 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); } //$NON-NLS-1$
+ consumeCaseLabel();
+ break;
+
+ case 538 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$
+ consumeDefaultLabel();
+ break;
+
+ case 539 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementWhile() ;
+ break;
+
+ case 540 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$
+ consumeStatementWhile() ;
+ break;
+
+ case 541 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$
+ consumeStatementDo() ;
+ break;
+
+ case 542 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$
+ consumeStatementFor() ;
+ break;
+
+ case 543 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$
+ consumeStatementFor() ;
+ break;
+
+ case 544 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$
+ consumeForInit() ;
+ break;
+
+ case 548 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$
+ consumeStatementExpressionList() ;
+ break;
+
+ case 549 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$
+ consumeSimpleAssertStatement() ;
+ break;
+
+ case 550 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$
+ consumeAssertStatement() ;
+ break;
+
+ case 551 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementBreak() ;
+ break;
+
+ case 552 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementBreakWithLabel() ;
+ break;
+
+ case 553 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementContinue() ;
+ break;
+
+ case 554 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementContinueWithLabel() ;
+ break;
+
+ case 555 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementReturn() ;
+ break;
+
+ case 556 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementThrow();
+ break;
+
+ case 557 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$
+ consumeStatementSynchronized();
+ break;
+
+ case 558 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$
+ consumeOnlySynchronized();
+ break;
+
+ case 559 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$
+ consumeStatementTry(false, false);
+ break;
+
+ case 560 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$
+ consumeStatementTry(true, false);
+ break;
+
+ case 561 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
+ consumeStatementTry(false, true);
+ break;
+
+ case 562 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
+ consumeStatementTry(true, true);
+ break;
+
+ case 563 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$
+ consumeResourceSpecification();
+ break;
+
+ case 564 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$
+ consumeResourceOptionalTrailingSemiColon(false);
+ break;
+
+ case 565 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeResourceOptionalTrailingSemiColon(true);
+ break;
+
+ case 566 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$
+ consumeSingleResource();
+ break;
+
+ case 567 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$
+ consumeMultipleResources();
+ break;
+
+ case 568 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeResourceOptionalTrailingSemiColon(true);
+ break;
+
+ case 569 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$
+ consumeResourceAsLocalVariableDeclaration();
+ break;
+
+ case 570 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$
+ consumeResourceAsLocalVariableDeclaration();
+ break;
+
+ case 572 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$
+ consumeExitTryBlock();
+ break;
+
+ case 574 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$
+ consumeCatches();
+ break;
+
+ case 575 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
+ consumeStatementCatch() ;
+ break;
+
+ case 577 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$
+ consumeLeftParen();
+ break;
+
+ case 578 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$
+ consumeRightParen();
+ break;
+
+ case 583 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayThis();
+ break;
+
+ case 584 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
+ consumePrimaryNoNewArray();
+ break;
+
+ case 585 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayWithName();
+ break;
+
+ case 588 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayNameThis();
+ break;
+
+ case 589 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayNameSuper();
+ break;
+
+ case 590 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayName();
+ break;
+
+ case 591 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayArrayType();
+ break;
+
+ case 592 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayPrimitiveArrayType();
+ break;
+
+ case 593 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayPrimitiveType();
+ break;
+
+ case 599 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
+ consumeReferenceExpressionTypeArgumentsAndTrunk(false);
+ break;
+
+ case 600 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
+ consumeReferenceExpressionTypeArgumentsAndTrunk(true);
+ break;
+
+ case 601 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$
+ consumeReferenceExpressionTypeForm(true);
+ break;
+
+ case 602 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$
+ consumeReferenceExpressionTypeForm(false);
+ break;
+
+ case 603 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$
+ consumeReferenceExpressionGenericTypeForm();
+ break;
+
+ case 604 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$
+ consumeReferenceExpressionPrimaryForm();
+ break;
+
+ case 605 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$
+ consumeReferenceExpressionSuperForm();
+ break;
+
+ case 606 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$
+ consumeEmptyTypeArguments();
+ break;
+
+ case 608 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$
+ consumeIdentifierOrNew(false);
+ break;
+
+ case 609 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$
+ consumeIdentifierOrNew(true);
+ break;
+
+ case 610 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$
+ consumeLambdaExpression();
+ break;
+
+ case 611 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$
+ consumeNestedLambda();
+ break;
+
+ case 612 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$
+ consumeTypeElidedLambdaParameter(false);
+ break;
+
+ case 618 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$
+ consumeFormalParameterList();
+ break;
+
+ case 619 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$
+ consumeTypeElidedLambdaParameter(true);
+ break;
+
+ case 622 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$
+ consumeElidedLeftBraceAndReturn();
+ break;
+
+ case 623 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$
+ consumeAllocationHeader();
+ break;
+
+ case 624 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionWithTypeArguments();
+ break;
+
+ case 625 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpression();
+ break;
+
+ case 626 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
+ break;
+
+ case 627 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualified() ;
+ break;
+
+ case 628 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualified() ;
+ break;
+
+ case 629 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
+ break;
+
+ case 630 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$
+ consumeEnterInstanceCreationArgumentList();
+ break;
+
+ case 631 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionName() ;
+ break;
+
+ case 632 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$
+ consumeClassBodyopt();
+ break;
+
+ case 634 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
+ consumeEnterAnonymousClassBody(false);
+ break;
+
+ case 635 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$
+ consumeClassBodyopt();
+ break;
+
+ case 637 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
+ consumeEnterAnonymousClassBody(true);
+ break;
+
+ case 639 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$
+ consumeArgumentList();
+ break;
+
+ case 640 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$
+ consumeArrayCreationHeader();
+ break;
+
+ case 641 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$
+ consumeArrayCreationHeader();
+ break;
+
+ case 642 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithoutInitializer();
+ break;
+
+ case 643 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithInitializer();
+ break;
+
+ case 644 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithoutInitializer();
+ break;
+
+ case 645 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithInitializer();
+ break;
+
+ case 647 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$
+ consumeDimWithOrWithOutExprs();
+ break;
+
+ case 649 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$
+ consumeDimWithOrWithOutExpr();
+ break;
+
+ case 650 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$
+ consumeDims();
+ break;
+
+ case 653 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
+ consumeOneDimLoop(false);
+ break;
+
+ case 654 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$
+ consumeOneDimLoop(true);
+ break;
+
+ case 655 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT JavaIdentifier"); } //$NON-NLS-1$
+ consumeFieldAccess(false);
+ break;
+
+ case 656 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT JavaIdentifier"); } //$NON-NLS-1$
+ consumeFieldAccess(true);
+ break;
+
+ case 657 : if (DEBUG) { System.out.println("MethodInvocation ::= NameOrAj LPAREN ArgumentListopt..."); } //$NON-NLS-1$
+ consumeMethodInvocationName();
+ break;
+
+ case 658 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationNameWithTypeArguments();
+ break;
+
+ case 659 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationPrimaryWithTypeArguments();
+ break;
+
+ case 660 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT JavaIdentifier LPAREN"); } //$NON-NLS-1$
+ consumeMethodInvocationPrimary();
+ break;
+
+ case 661 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationSuperWithTypeArguments();
+ break;
+
+ case 662 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT JavaIdentifier LPAREN..."); } //$NON-NLS-1$
+ consumeMethodInvocationSuper();
+ break;
+
+ case 663 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
+ consumeArrayAccess(true);
+ break;
+
+ case 664 : if (DEBUG) { System.out.println("ArrayAccess ::= AjName LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
+ consumeArrayAccess(true);
+ break;
+
+ case 665 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$
+ consumeArrayAccess(false);
+ break;
+
+ case 666 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$
+ consumeArrayAccess(false);
+ break;
+
+ case 668 : if (DEBUG) { System.out.println("PostfixExpression ::= NameOrAj"); } //$NON-NLS-1$
+ consumePostfixExpression();
+ break;
+
+ case 671 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS,true);
+ break;
+
+ case 672 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS,true);
+ break;
+
+ case 673 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$
+ consumePushPosition();
+ break;
+
+ case 676 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 677 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 679 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS,false);
+ break;
+
+ case 680 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS,false);
+ break;
+
+ case 682 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.TWIDDLE);
+ break;
+
+ case 683 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.NOT);
+ break;
+
+ case 685 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$
+ consumeCastExpressionWithPrimitiveType();
+ break;
+
+ case 686 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
+ consumeCastExpressionWithGenericsArray();
+ break;
+
+ case 687 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
+ consumeCastExpressionWithQualifiedGenericsArray();
+ break;
+
+ case 688 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$
+ consumeCastExpressionLL1();
+ break;
+
+ case 689 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$
+ consumeCastExpressionLL1WithBounds();
+ break;
+
+ case 690 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$
+ consumeCastExpressionWithNameArray();
+ break;
+
+ case 691 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$
+ consumeZeroAdditionalBounds();
+ break;
+
+ case 695 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$
+ consumeOnlyTypeArgumentsForCastExpression();
+ break;
+
+ case 696 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$
+ consumeInsideCastExpression();
+ break;
+
+ case 697 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$
+ consumeInsideCastExpressionLL1();
+ break;
+
+ case 698 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$
+ consumeInsideCastExpressionLL1WithBounds ();
+ break;
+
+ case 699 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$
+ consumeInsideCastExpressionWithQualifiedGenerics();
+ break;
+
+ case 701 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MULTIPLY);
+ break;
+
+ case 702 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.DIVIDE);
+ break;
+
+ case 703 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.REMAINDER);
+ break;
+
+ case 705 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 706 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 708 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
+ break;
+
+ case 709 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
+ break;
+
+ case 710 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 712 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS);
+ break;
+
+ case 713 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER);
+ break;
+
+ case 714 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS_EQUAL);
+ break;
+
+ case 715 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
+ break;
+
+ case 717 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$
+ consumeInstanceOfExpression();
+ break;
+
+ case 719 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
+ break;
+
+ case 720 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.NOT_EQUAL);
+ break;
+
+ case 722 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND);
+ break;
+
+ case 724 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.XOR);
+ break;
+
+ case 726 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR);
+ break;
+
+ case 728 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND_AND);
+ break;
+
+ case 730 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR_OR);
+ break;
+
+ case 732 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
+ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
+ break;
+
+ case 735 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$
+ consumeAssignment();
+ break;
+
+ case 737 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$
+ ignoreExpressionAssignment();
+ break;
+
+ case 738 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(EQUAL);
+ break;
+
+ case 739 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(MULTIPLY);
+ break;
+
+ case 740 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(DIVIDE);
+ break;
+
+ case 741 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(REMAINDER);
+ break;
+
+ case 742 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(PLUS);
+ break;
+
+ case 743 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(MINUS);
+ break;
+
+ case 744 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(LEFT_SHIFT);
+ break;
+
+ case 745 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(RIGHT_SHIFT);
+ break;
+
+ case 746 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 747 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(AND);
+ break;
+
+ case 748 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(XOR);
+ break;
+
+ case 749 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(OR);
+ break;
+
+ case 750 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$
+ consumeExpression();
+ break;
+
+ case 753 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$
+ consumeEmptyExpression();
+ break;
+
+ case 758 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyClassBodyDeclarationsopt();
+ break;
+
+ case 759 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ consumeClassBodyDeclarationsopt();
+ break;
+
+ case 760 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$
+ consumeDefaultModifiers();
+ break;
+
+ case 761 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$
+ consumeModifiers();
+ break;
+
+ case 762 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$
+ consumeEmptyBlockStatementsopt();
+ break;
+
+ case 764 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$
+ consumeEmptyDimsopt();
+ break;
+
+ case 766 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$
+ consumeEmptyArgumentListopt();
+ break;
+
+ case 770 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$
+ consumeFormalParameterListopt();
+ break;
+
+ case 774 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyInterfaceMemberDeclarationsopt();
+ break;
+
+ case 775 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ consumeInterfaceMemberDeclarationsopt();
+ break;
+
+ case 776 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$
+ consumeNestedType();
+ break;
- case 61 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); } //$NON-NLS-1$
- consumeArrayTypeWithTypeArgumentsName();
- break;
-
- case 62 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$
- consumePrimitiveArrayType();
- break;
-
- case 63 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$
- consumeNameArrayType();
- break;
-
- case 64 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$
- consumeGenericTypeNameArrayType();
- break;
-
- case 65 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$
- consumeGenericTypeArrayType();
- break;
-
- case 71 : if (DEBUG) { System.out.println("AjName ::= AjSimpleName"); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
- break;
-
- case 72 : if (DEBUG) { System.out.println("AjName ::= AjQualifiedName"); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
- break;
-
- case 81 : if (DEBUG) { System.out.println("AjQualifiedName ::= AjName DOT SimpleNameOrAj"); } //$NON-NLS-1$
- consumeQualifiedName();
- break;
-
- case 84 : if (DEBUG) { System.out.println("Name ::= SimpleName"); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
- break;
-
- case 89 : if (DEBUG) { System.out.println("UnannotatableName ::= UnannotatableName DOT SimpleName"); } //$NON-NLS-1$
- consumeUnannotatableQualifiedName();
- break;
-
- case 90 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT JavaIdentifier"); } //$NON-NLS-1$
- consumeQualifiedName(false);
- break;
-
- case 91 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT TypeAnnotations JavaIdentifier"); } //$NON-NLS-1$
- consumeQualifiedName(true);
- break;
-
- case 92 : if (DEBUG) { System.out.println("TypeAnnotationsopt ::="); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
- break;
-
- case 96 : if (DEBUG) { System.out.println("TypeAnnotations0 ::= TypeAnnotations0 TypeAnnotation"); } //$NON-NLS-1$
- consumeOneMoreTypeAnnotation();
- break;
-
- case 97 : if (DEBUG) { System.out.println("TypeAnnotation ::= NormalTypeAnnotation"); } //$NON-NLS-1$
- consumeTypeAnnotation();
- break;
-
- case 98 : if (DEBUG) { System.out.println("TypeAnnotation ::= MarkerTypeAnnotation"); } //$NON-NLS-1$
- consumeTypeAnnotation();
- break;
-
- case 99 : if (DEBUG) { System.out.println("TypeAnnotation ::= SingleMemberTypeAnnotation"); } //$NON-NLS-1$
- consumeTypeAnnotation();
- break;
-
- case 100 : if (DEBUG) { System.out.println("TypeAnnotationName ::= AT308 UnannotatableName"); } //$NON-NLS-1$
- consumeAnnotationName() ;
- break;
-
- case 101 : if (DEBUG) { System.out.println("NormalTypeAnnotation ::= TypeAnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeNormalAnnotation(true) ;
- break;
-
- case 102 : if (DEBUG) { System.out.println("MarkerTypeAnnotation ::= TypeAnnotationName"); } //$NON-NLS-1$
- consumeMarkerAnnotation(true) ;
- break;
-
- case 103 : if (DEBUG) { System.out.println("SingleMemberTypeAnnotation ::= TypeAnnotationName LPAREN"); } //$NON-NLS-1$
- consumeSingleMemberAnnotation(true) ;
- break;
-
- case 104 : if (DEBUG) { System.out.println("RejectTypeAnnotations ::="); } //$NON-NLS-1$
- consumeNonTypeUseName();
- break;
-
- case 105 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
- break;
-
- case 106 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); } //$NON-NLS-1$
- consumeExplicitThisParameter(false);
- break;
-
- case 107 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= UnannotatableName DOT..."); } //$NON-NLS-1$
- consumeExplicitThisParameter(true);
- break;
-
- case 108 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= VariableDeclaratorId"); } //$NON-NLS-1$
- consumeVariableDeclaratorIdParameter();
- break;
-
- case 109 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$
- consumeCompilationUnit();
- break;
-
- case 110 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$
- consumeInternalCompilationUnit();
- break;
-
- case 111 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
- consumeInternalCompilationUnit();
- break;
-
- case 112 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
- break;
-
- case 113 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
- break;
-
- case 114 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
- consumeInternalCompilationUnit();
- break;
-
- case 115 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
- break;
-
- case 116 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
- consumeInternalCompilationUnitWithTypes();
- break;
-
- case 117 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$
- consumeEmptyInternalCompilationUnit();
- break;
-
- case 118 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$
- consumeReduceImports();
- break;
-
- case 119 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$
- consumeEnterCompilationUnit();
- break;
-
- case 135 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
- consumeCatchHeader();
- break;
-
- case 137 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$
- consumeImportDeclarations();
- break;
-
- case 139 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$
- consumeTypeDeclarations();
- break;
-
- case 140 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$
- consumePackageDeclaration();
- break;
-
- case 141 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$
- consumePackageDeclarationNameWithModifiers();
- break;
-
- case 142 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$
- consumePackageDeclarationName();
- break;
-
- case 143 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$
- consumePackageComment();
- break;
-
- case 148 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
- break;
-
- case 149 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import Name..."); } //$NON-NLS-1$
- consumeSingleTypeImportDeclarationName();
- break;
-
- case 150 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
- break;
-
- case 151 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$
- consumeTypeImportOnDemandDeclarationName();
- break;
-
- case 154 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
- break;
-
- case 158 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$
- consumeModifiers2();
- break;
-
- case 171 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$
- consumeAnnotationAsModifier();
- break;
-
- case 184 : if (DEBUG) { System.out.println("AspectDeclaration ::= AspectHeader AspectBody"); } //$NON-NLS-1$
- consumeAspectDeclaration();
- break;
-
- case 185 : if (DEBUG) { System.out.println("AspectHeader ::= AspectHeaderName ClassHeaderExtendsopt"); } //$NON-NLS-1$
- consumeAspectHeader();
- break;
-
- case 188 : if (DEBUG) { System.out.println("AspectHeaderName ::= AspectHeaderName1 TypeParameters"); } //$NON-NLS-1$
- consumeAspectHeaderNameWithTypeParameters(false);
- break;
-
- case 189 : if (DEBUG) { System.out.println("AspectHeaderName ::= AspectHeaderName2 TypeParameters"); } //$NON-NLS-1$
- consumeAspectHeaderNameWithTypeParameters(true);
- break;
-
- case 190 : if (DEBUG) { System.out.println("AspectHeaderName1 ::= Modifiersopt aspect Identifier"); } //$NON-NLS-1$
- consumeAspectHeaderName(false);
- break;
-
- case 191 : if (DEBUG) { System.out.println("AspectHeaderName2 ::= Modifiersopt privileged..."); } //$NON-NLS-1$
- consumeAspectHeaderName(true);
- break;
-
- case 193 : if (DEBUG) { System.out.println("AspectHeaderRest ::= AspectHeaderRestStart PseudoTokens"); } //$NON-NLS-1$
- consumeAspectHeaderRest();
- break;
-
- case 194 : if (DEBUG) { System.out.println("AspectHeaderRestStart ::= Identifier"); } //$NON-NLS-1$
- consumePseudoTokenIdentifier();
- break;
-
- case 197 : if (DEBUG) { System.out.println("AspectBodyDeclarations ::= AspectBodyDeclarations..."); } //$NON-NLS-1$
- consumeClassBodyDeclarations();
- break;
-
- case 198 : if (DEBUG) { System.out.println("AspectBodyDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyClassBodyDeclarationsopt();
- break;
-
- case 199 : if (DEBUG) { System.out.println("AspectBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeClassBodyDeclarationsopt();
- break;
-
- case 200 : if (DEBUG) { System.out.println("AspectBodyDeclaration ::=..."); } //$NON-NLS-1$
- consumeClassBodyDeclarationInAspect();
- break;
-
- case 204 : if (DEBUG) { System.out.println("ClassBodyDeclarationNoAroundMethod ::= Diet NestedMethod"); } //$NON-NLS-1$
- consumeClassBodyDeclaration();
- break;
-
- case 214 : if (DEBUG) { System.out.println("ClassMemberDeclarationNoAroundMethod ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
- break;
-
- case 216 : if (DEBUG) { System.out.println("MethodDeclarationNoAround ::= MethodHeaderNoAround..."); } //$NON-NLS-1$
- // set to true to consume a method with a body
-consumeMethodDeclaration(true,false);
- break;
-
- case 217 : if (DEBUG) { System.out.println("AbstractMethodDeclarationNoAround ::=..."); } //$NON-NLS-1$
- // set to false to consume a method without body
-consumeMethodDeclaration(false,false);
- break;
-
- case 218 : if (DEBUG) { System.out.println("MethodHeaderNoAround ::= MethodHeaderNameNoAround..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 219 : if (DEBUG) { System.out.println("MethodHeaderNameNoAround ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(false);
- break;
-
- case 220 : if (DEBUG) { System.out.println("MethodHeaderNameNoAround ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeMethodHeaderName(false);
- break;
-
- case 221 : if (DEBUG) { System.out.println("PointcutDeclaration ::= PointcutHeader..."); } //$NON-NLS-1$
- consumeEmptyPointcutDeclaration();
- break;
-
- case 222 : if (DEBUG) { System.out.println("PointcutDeclaration ::= PointcutHeader..."); } //$NON-NLS-1$
- consumePointcutDeclaration();
- break;
-
- case 223 : if (DEBUG) { System.out.println("PointcutHeader ::= Modifiersopt pointcut JavaIdentifier"); } //$NON-NLS-1$
- consumePointcutHeader();
- break;
-
- case 226 : if (DEBUG) { System.out.println("AroundDeclaration ::= AroundHeader MethodBody"); } //$NON-NLS-1$
- consumeAroundDeclaration();
- break;
-
- case 227 : if (DEBUG) { System.out.println("AroundHeader ::= AroundHeaderName FormalParameterListopt"); } //$NON-NLS-1$
- consumeAroundHeader();
- break;
-
- case 228 : if (DEBUG) { System.out.println("AroundHeaderName ::= Modifiersopt Type around LPAREN"); } //$NON-NLS-1$
- consumeAroundHeaderName();
- break;
-
- case 229 : if (DEBUG) { System.out.println("AroundHeaderName ::= Modifiersopt around LPAREN"); } //$NON-NLS-1$
- consumeAroundHeaderNameMissingReturnType();
- break;
-
- case 230 : if (DEBUG) { System.out.println("BasicAdviceDeclaration ::= BasicAdviceHeader MethodBody"); } //$NON-NLS-1$
- consumeBasicAdviceDeclaration();
- break;
-
- case 233 : if (DEBUG) { System.out.println("BeforeAdviceHeader ::= BeforeAdviceHeaderName..."); } //$NON-NLS-1$
- consumeBasicAdviceHeader();
- break;
-
- case 234 : if (DEBUG) { System.out.println("AfterAdviceHeader ::= AfterAdviceHeaderName..."); } //$NON-NLS-1$
- consumeBasicAdviceHeader();
- break;
-
- case 235 : if (DEBUG) { System.out.println("BeforeAdviceHeaderName ::= Modifiersopt before LPAREN"); } //$NON-NLS-1$
- consumeBasicAdviceHeaderName(false);
- break;
-
- case 236 : if (DEBUG) { System.out.println("AfterAdviceHeaderName ::= Modifiersopt after LPAREN"); } //$NON-NLS-1$
- consumeBasicAdviceHeaderName(true);
- break;
-
- case 237 : if (DEBUG) { System.out.println("ExtraParamopt ::= Identifier LPAREN FormalParameter..."); } //$NON-NLS-1$
- consumeExtraParameterWithFormal();
- break;
-
- case 238 : if (DEBUG) { System.out.println("ExtraParamopt ::= Identifier LPAREN RPAREN"); } //$NON-NLS-1$
- consumeExtraParameterNoFormal();
- break;
-
- case 239 : if (DEBUG) { System.out.println("ExtraParamopt ::= Identifier"); } //$NON-NLS-1$
- consumeExtraParameterNoFormal();
- break;
-
- case 241 : if (DEBUG) { System.out.println("OnType ::= JavaIdentifier"); } //$NON-NLS-1$
- consumeZeroTypeAnnotations();
- break;
-
- case 242 : if (DEBUG) { System.out.println("OnType ::= OnType DOT JavaIdentifier"); } //$NON-NLS-1$
- consumeZeroTypeAnnotations(); consumeQualifiedName();
- break;
-
- case 247 : if (DEBUG) { System.out.println("InterTypeMethodDeclaration ::= InterTypeMethodHeader..."); } //$NON-NLS-1$
- // set to true to consume a method with a body
-consumeInterTypeMethodDeclaration(true);
- break;
-
- case 248 : if (DEBUG) { System.out.println("InterTypeMethodHeader ::= InterTypeMethodHeaderName..."); } //$NON-NLS-1$
- consumeInterTypeMethodHeader();
- break;
-
- case 249 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
- consumeInterTypeMethodHeaderName(false,false);
- break;
-
- case 250 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
- consumeInterTypeMethodHeaderNameIllegallyUsingTypePattern("*");
- break;
-
- case 251 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
- consumeInterTypeMethodHeaderNameIllegallyUsingTypePattern("+");
- break;
-
- case 252 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt Type OnType"); } //$NON-NLS-1$
- consumeInterTypeMethodHeaderName(false,true);
- break;
-
- case 253 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeInterTypeMethodHeaderName(true,false);
- break;
-
- case 254 : if (DEBUG) { System.out.println("InterTypeMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeInterTypeMethodHeaderName(true,true);
- break;
-
- case 255 : if (DEBUG) { System.out.println("AbstractInterTypeMethodDeclaration ::=..."); } //$NON-NLS-1$
- // set to false to consume a method without body
-consumeInterTypeMethodDeclaration(false);
- break;
-
- case 256 : if (DEBUG) { System.out.println("TypeParametersAsReference ::= TypeParameters"); } //$NON-NLS-1$
- convertTypeParametersToSingleTypeReferences();
- break;
-
- case 257 : if (DEBUG) { System.out.println("InterTypeConstructorDeclaration ::=..."); } //$NON-NLS-1$
- // set to true to consume a method with a body
-consumeInterTypeConstructorDeclaration();
- break;
-
- case 258 : if (DEBUG) { System.out.println("InterTypeConstructorHeader ::=..."); } //$NON-NLS-1$
- consumeInterTypeConstructorHeader();
- break;
-
- case 259 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name DOT"); } //$NON-NLS-1$
- consumeInterTypeConstructorHeaderName(false,false);
- break;
-
- case 260 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name DOT"); } //$NON-NLS-1$
- consumeInterTypeConstructorHeaderNameIllegallyUsingTypePattern("*");
- break;
-
- case 261 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt Name..."); } //$NON-NLS-1$
- consumeInterTypeConstructorHeaderNameIllegallyUsingTypePattern("+");
- break;
-
- case 262 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeInterTypeConstructorHeaderName(true,false);
- break;
-
- case 263 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeInterTypeConstructorHeaderName(false,true);
- break;
-
- case 264 : if (DEBUG) { System.out.println("InterTypeConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeInterTypeConstructorHeaderName(true,true);
- break;
-
- case 265 : if (DEBUG) { System.out.println("InterTypeFieldDeclaration ::= InterTypeFieldHeader..."); } //$NON-NLS-1$
- consumeInterTypeFieldDeclaration();
- break;
-
- case 266 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType DOT..."); } //$NON-NLS-1$
- consumeInterTypeFieldHeader(false);
- break;
-
- case 267 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType DOT..."); } //$NON-NLS-1$
- consumeInterTypeFieldHeaderIllegallyAttemptingToUseATypePattern("*");
- break;
-
- case 268 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType PLUS"); } //$NON-NLS-1$
- consumeInterTypeFieldHeaderIllegallyAttemptingToUseATypePattern("+");
- break;
-
- case 269 : if (DEBUG) { System.out.println("InterTypeFieldHeader ::= Modifiersopt Type OnType..."); } //$NON-NLS-1$
- consumeInterTypeFieldHeader(true);
- break;
-
- case 270 : if (DEBUG) { System.out.println("InterTypeFieldBody ::="); } //$NON-NLS-1$
- consumeExitITDVariableWithoutInitializer();
- break;
-
- case 271 : if (DEBUG) { System.out.println("InterTypeFieldBody ::= EQUAL ForceNoDiet..."); } //$NON-NLS-1$
- consumeExitITDVariableWithInitializer();
- break;
-
- case 273 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareHeader PseudoTokens..."); } //$NON-NLS-1$
- consumeDeclareDeclaration();
- break;
-
- case 274 : if (DEBUG) { System.out.println("DeclareHeader ::= declare Identifier COLON"); } //$NON-NLS-1$
- consumeDeclareHeader();
- break;
-
- case 275 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareAnnotationHeader..."); } //$NON-NLS-1$
- consumeDeclareAnnotation(' ');
- break;
-
- case 276 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareAnnotationHeader..."); } //$NON-NLS-1$
- consumeDeclareAnnotation('+');
- break;
-
- case 277 : if (DEBUG) { System.out.println("DeclareDeclaration ::= DeclareAnnotationHeader..."); } //$NON-NLS-1$
- consumeDeclareAnnotation('-');
- break;
-
- case 280 : if (DEBUG) { System.out.println("DeclareAnnotationHeader ::= declare AT Identifier COLON"); } //$NON-NLS-1$
- consumeDeclareAnnotationHeader();
- break;
-
- case 283 : if (DEBUG) { System.out.println("PseudoTokens ::= PseudoTokens ColonPseudoToken"); } //$NON-NLS-1$
- consumePseudoTokens();
- break;
-
- case 284 : if (DEBUG) { System.out.println("PseudoTokens ::= PseudoTokens PseudoToken"); } //$NON-NLS-1$
- consumePseudoTokens();
- break;
-
- case 286 : if (DEBUG) { System.out.println("PseudoTokensNoColon ::= PseudoTokensNoColon PseudoToken"); } //$NON-NLS-1$
- consumePseudoTokens();
- break;
-
- case 287 : if (DEBUG) { System.out.println("ColonPseudoToken ::= COLON"); } //$NON-NLS-1$
- consumePseudoToken(":");
- break;
-
- case 288 : if (DEBUG) { System.out.println("PseudoToken ::= JavaIdentifier"); } //$NON-NLS-1$
- consumePseudoTokenIdentifier();
- break;
-
- case 289 : if (DEBUG) { System.out.println("PseudoToken ::= LPAREN"); } //$NON-NLS-1$
- consumePseudoToken("(");
- break;
-
- case 290 : if (DEBUG) { System.out.println("PseudoToken ::= RPAREN"); } //$NON-NLS-1$
- consumePseudoToken(")");
- break;
-
- case 291 : if (DEBUG) { System.out.println("PseudoToken ::= DOT"); } //$NON-NLS-1$
- consumePseudoToken(".");
- break;
-
- case 292 : if (DEBUG) { System.out.println("PseudoToken ::= MULTIPLY"); } //$NON-NLS-1$
- consumePseudoToken("*");
- break;
-
- case 293 : if (DEBUG) { System.out.println("PseudoToken ::= PLUS"); } //$NON-NLS-1$
- consumePseudoToken("+");
- break;
-
- case 294 : if (DEBUG) { System.out.println("PseudoToken ::= EQUAL"); } //$NON-NLS-1$
- consumePseudoToken("=");
- break;
-
- case 295 : if (DEBUG) { System.out.println("PseudoToken ::= AND_AND"); } //$NON-NLS-1$
- consumePseudoToken("&&");
- break;
-
- case 296 : if (DEBUG) { System.out.println("PseudoToken ::= OR_OR"); } //$NON-NLS-1$
- consumePseudoToken("||");
- break;
-
- case 297 : if (DEBUG) { System.out.println("PseudoToken ::= NOT"); } //$NON-NLS-1$
- consumePseudoToken("!");
- break;
-
- case 298 : if (DEBUG) { System.out.println("PseudoToken ::= COMMA"); } //$NON-NLS-1$
- consumePseudoToken(",");
- break;
-
- case 299 : if (DEBUG) { System.out.println("PseudoToken ::= LBRACKET"); } //$NON-NLS-1$
- consumePseudoToken("[");
- break;
-
- case 300 : if (DEBUG) { System.out.println("PseudoToken ::= RBRACKET"); } //$NON-NLS-1$
- consumePseudoToken("]");
- break;
-
- case 301 : if (DEBUG) { System.out.println("PseudoToken ::= AT"); } //$NON-NLS-1$
- consumePseudoToken("@");
- break;
-
- case 302 : if (DEBUG) { System.out.println("PseudoToken ::= ELLIPSIS"); } //$NON-NLS-1$
- consumePseudoToken("...");
- break;
-
- case 303 : if (DEBUG) { System.out.println("PseudoToken ::= QUESTION"); } //$NON-NLS-1$
- consumePseudoToken("?");
- break;
-
- case 304 : if (DEBUG) { System.out.println("PseudoToken ::= LESS"); } //$NON-NLS-1$
- consumePseudoToken("<");
- break;
-
- case 305 : if (DEBUG) { System.out.println("PseudoToken ::= GREATER"); } //$NON-NLS-1$
- consumePseudoToken(">");
- break;
-
- case 306 : if (DEBUG) { System.out.println("PseudoToken ::= RIGHT_SHIFT"); } //$NON-NLS-1$
- consumePseudoToken(">>");
- break;
-
- case 307 : if (DEBUG) { System.out.println("PseudoToken ::= UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumePseudoToken(">>>");
- break;
-
- case 308 : if (DEBUG) { System.out.println("PseudoToken ::= AND"); } //$NON-NLS-1$
- consumePseudoToken("&");
- break;
-
- case 309 : if (DEBUG) { System.out.println("PseudoToken ::= NOT_EQUAL"); } //$NON-NLS-1$
- consumePseudoToken("!=");
- break;
-
- case 310 : if (DEBUG) { System.out.println("PseudoToken ::= PrimitiveType"); } //$NON-NLS-1$
- consumePseudoTokenPrimitiveType();
- break;
-
- case 311 : if (DEBUG) { System.out.println("PseudoToken ::= SimpleModifier"); } //$NON-NLS-1$
- consumePseudoTokenModifier();
- break;
-
- case 312 : if (DEBUG) { System.out.println("PseudoToken ::= Literal"); } //$NON-NLS-1$
- consumePseudoTokenLiteral();
- break;
-
- case 313 : if (DEBUG) { System.out.println("PseudoToken ::= this"); } //$NON-NLS-1$
- consumePseudoToken("this", 1, true);
- break;
-
- case 314 : if (DEBUG) { System.out.println("PseudoToken ::= class"); } //$NON-NLS-1$
- consumePseudoToken("class", 1, true);
- break;
-
- case 315 : if (DEBUG) { System.out.println("PseudoToken ::= super"); } //$NON-NLS-1$
- consumePseudoToken("super", 1, true);
- break;
-
- case 316 : if (DEBUG) { System.out.println("PseudoToken ::= if LPAREN Expression RPAREN"); } //$NON-NLS-1$
- consumePseudoTokenIf();
- break;
-
- case 317 : if (DEBUG) { System.out.println("PseudoToken ::= assert"); } //$NON-NLS-1$
- consumePseudoToken("assert", 1, true);
- break;
-
- case 318 : if (DEBUG) { System.out.println("PseudoToken ::= import"); } //$NON-NLS-1$
- consumePseudoToken("import", 1, true);
- break;
-
- case 319 : if (DEBUG) { System.out.println("PseudoToken ::= package"); } //$NON-NLS-1$
- consumePseudoToken("package", 1, true);
- break;
-
- case 320 : if (DEBUG) { System.out.println("PseudoToken ::= throw"); } //$NON-NLS-1$
- consumePseudoToken("throw", 1, true);
- break;
-
- case 321 : if (DEBUG) { System.out.println("PseudoToken ::= new"); } //$NON-NLS-1$
- consumePseudoToken("new", 1, true);
- break;
-
- case 322 : if (DEBUG) { System.out.println("PseudoToken ::= do"); } //$NON-NLS-1$
- consumePseudoToken("do", 1, true);
- break;
-
- case 323 : if (DEBUG) { System.out.println("PseudoToken ::= for"); } //$NON-NLS-1$
- consumePseudoToken("for", 1, true);
- break;
-
- case 324 : if (DEBUG) { System.out.println("PseudoToken ::= switch"); } //$NON-NLS-1$
- consumePseudoToken("switch", 1, true);
- break;
-
- case 325 : if (DEBUG) { System.out.println("PseudoToken ::= try"); } //$NON-NLS-1$
- consumePseudoToken("try", 1, true);
- break;
-
- case 326 : if (DEBUG) { System.out.println("PseudoToken ::= while"); } //$NON-NLS-1$
- consumePseudoToken("while", 1, true);
- break;
-
- case 327 : if (DEBUG) { System.out.println("PseudoToken ::= break"); } //$NON-NLS-1$
- consumePseudoToken("break", 1, true);
- break;
-
- case 328 : if (DEBUG) { System.out.println("PseudoToken ::= continue"); } //$NON-NLS-1$
- consumePseudoToken("continue", 1, true);
- break;
-
- case 329 : if (DEBUG) { System.out.println("PseudoToken ::= return"); } //$NON-NLS-1$
- consumePseudoToken("return", 1, true);
- break;
-
- case 330 : if (DEBUG) { System.out.println("PseudoToken ::= case"); } //$NON-NLS-1$
- consumePseudoToken("case", 1, true);
- break;
-
- case 331 : if (DEBUG) { System.out.println("PseudoToken ::= catch"); } //$NON-NLS-1$
- consumePseudoToken("catch", 0, true);
- break;
-
- case 332 : if (DEBUG) { System.out.println("PseudoToken ::= instanceof"); } //$NON-NLS-1$
- consumePseudoToken("instanceof", 0, true);
- break;
-
- case 333 : if (DEBUG) { System.out.println("PseudoToken ::= else"); } //$NON-NLS-1$
- consumePseudoToken("else", 0, true);
- break;
-
- case 334 : if (DEBUG) { System.out.println("PseudoToken ::= extends"); } //$NON-NLS-1$
- consumePseudoToken("extends", 0, true);
- break;
-
- case 335 : if (DEBUG) { System.out.println("PseudoToken ::= finally"); } //$NON-NLS-1$
- consumePseudoToken("finally", 0, true);
- break;
-
- case 336 : if (DEBUG) { System.out.println("PseudoToken ::= implements"); } //$NON-NLS-1$
- consumePseudoToken("implements", 0, true);
- break;
-
- case 337 : if (DEBUG) { System.out.println("PseudoToken ::= throws"); } //$NON-NLS-1$
- consumePseudoToken("throws", 0, true);
- break;
-
- case 338 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$
- consumeClassDeclaration();
- break;
-
- case 339 : if (DEBUG) { System.out.println("IntertypeClassDeclaration ::= IntertypeClassHeader..."); } //$NON-NLS-1$
- consumeIntertypeClassDeclaration();
- break;
-
- case 340 : if (DEBUG) { System.out.println("IntertypeClassHeader ::= IntertypeClassHeaderName..."); } //$NON-NLS-1$
- consumeIntertypeClassHeader();
- break;
-
- case 341 : if (DEBUG) { System.out.println("IntertypeClassHeaderName ::= IntertypeClassHeaderName1"); } //$NON-NLS-1$
- consumeIntertypeTypeHeaderNameWithTypeParameters();
- break;
-
- case 343 : if (DEBUG) { System.out.println("IntertypeClassHeaderName1 ::= Modifiersopt class OnType"); } //$NON-NLS-1$
- consumeIntertypeClassHeaderName(false);
- break;
-
- case 344 : if (DEBUG) { System.out.println("InterTypeClassHeaderName1 ::= Modifiersopt class OnType"); } //$NON-NLS-1$
- consumeIntertypeClassHeaderName(true);
- break;
-
- case 345 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$
- consumeClassHeader();
- break;
-
- case 346 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$
- consumeTypeHeaderNameWithTypeParameters();
- break;
-
- case 348 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class JavaIdentifier"); } //$NON-NLS-1$
- consumeClassHeaderName1();
- break;
-
- case 349 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$
- consumeClassHeaderExtends();
- break;
-
- case 350 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$
- consumeClassHeaderImplements();
- break;
-
- case 352 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$
- consumeInterfaceTypeList();
- break;
-
- case 353 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
- consumeInterfaceType();
- break;
-
- case 356 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$
- consumeClassBodyDeclarations();
- break;
-
- case 360 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$
- consumeClassBodyDeclaration();
- break;
-
- case 361 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$
- consumeDiet();
- break;
-
- case 362 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$
- consumeClassBodyDeclaration();
- break;
-
- case 363 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$
- consumeCreateInitializer();
- break;
-
- case 370 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
- break;
-
- case 373 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeFieldDeclaration();
- break;
-
- case 375 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$
- consumeVariableDeclarators();
- break;
-
- case 378 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$
- consumeEnterVariable();
- break;
-
- case 379 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$
- consumeExitVariableWithInitialization();
- break;
-
- case 380 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$
- consumeExitVariableWithoutInitialization();
- break;
-
- case 381 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$
- consumeForceNoDiet();
- break;
-
- case 382 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$
- consumeRestoreDiet();
- break;
-
- case 387 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
- // set to true to consume a method with a body
-consumeMethodDeclaration(true, false);
- break;
-
- case 388 : if (DEBUG) { System.out.println("MethodDeclaration ::= DefaultMethodHeader MethodBody"); } //$NON-NLS-1$
- // set to true to consume a method with a body
-consumeMethodDeclaration(true, true);
- break;
-
- case 389 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$
- // set to false to consume a method without body
-consumeMethodDeclaration(false, false);
- break;
-
- case 390 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 391 : if (DEBUG) { System.out.println("DefaultMethodHeader ::= DefaultMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 392 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(false);
- break;
-
- case 393 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type JavaIdentifier..."); } //$NON-NLS-1$
- consumeMethodHeaderName(false);
- break;
-
- case 394 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(false);
- break;
-
- case 395 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault Type..."); } //$NON-NLS-1$
- consumeMethodHeaderName(false);
- break;
-
- case 396 : if (DEBUG) { System.out.println("ModifiersWithDefault ::= Modifiersopt default..."); } //$NON-NLS-1$
- consumePushCombineModifiers();
- break;
-
- case 397 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
- consumeMethodHeaderRightParen();
- break;
-
- case 398 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$
- consumeMethodHeaderExtendedDims();
- break;
-
- case 399 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$
- consumeMethodHeaderThrowsClause();
- break;
-
- case 400 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$
- consumeConstructorHeader();
- break;
-
- case 401 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$
- consumeConstructorHeaderNameWithTypeParameters();
- break;
-
- case 402 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$
- consumeConstructorHeaderName();
- break;
-
- case 403 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt aspect LPAREN"); } //$NON-NLS-1$
- consumeConstructorHeaderName();
- break;
-
- case 405 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$
- consumeFormalParameterList();
- break;
-
- case 406 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeFormalParameter(false);
- break;
-
- case 407 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeFormalParameter(true);
- break;
-
- case 408 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type AT308DOTDOTDOT..."); } //$NON-NLS-1$
- consumeFormalParameter(true);
- break;
-
- case 409 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$
- consumeCatchFormalParameter();
- break;
-
- case 410 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$
- consumeCatchType();
- break;
-
- case 411 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$
- consumeUnionTypeAsClassType();
- break;
-
- case 412 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$
- consumeUnionType();
- break;
-
- case 414 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$
- consumeClassTypeList();
- break;
-
- case 415 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$
- consumeClassTypeElt();
- break;
-
- case 416 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$
- consumeMethodBody();
- break;
-
- case 417 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$
- consumeNestedMethod();
- break;
-
- case 418 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$
- consumeStaticInitializer();
- break;
-
- case 419 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$
- consumeStaticOnly();
- break;
-
- case 420 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$
- consumeConstructorDeclaration() ;
- break;
-
- case 421 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration() ;
- break;
-
- case 422 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0, THIS_CALL);
- break;
-
- case 423 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);
- break;
-
- case 424 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0,SUPER_CALL);
- break;
-
- case 425 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);
- break;
-
- case 426 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(1, SUPER_CALL);
- break;
-
- case 427 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);
- break;
-
- case 428 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2, SUPER_CALL);
- break;
-
- case 429 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);
- break;
-
- case 430 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(1, THIS_CALL);
- break;
-
- case 431 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);
- break;
-
- case 432 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2, THIS_CALL);
- break;
-
- case 433 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);
- break;
-
- case 434 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$
- consumeInterfaceDeclaration();
- break;
-
- case 435 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$
- consumeInterfaceHeader();
- break;
-
- case 436 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$
- consumeTypeHeaderNameWithTypeParameters();
- break;
-
- case 438 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$
- consumeInterfaceHeaderName1();
- break;
-
- case 439 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$
- consumeInterfaceHeaderExtends();
- break;
-
- case 442 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$
- consumeInterfaceMemberDeclarations();
- break;
-
- case 443 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
- break;
-
- case 445 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
- consumeInterfaceMethodDeclaration(false);
- break;
-
- case 446 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
- consumeInterfaceMethodDeclaration(false);
- break;
-
- case 447 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$
- consumeInterfaceMethodDeclaration(true);
- break;
-
- case 448 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration(true);
- break;
-
- case 449 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration(false);
- break;
-
- case 460 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$
- consumePushLeftBrace();
- break;
-
- case 461 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$
- consumeEmptyArrayInitializer();
- break;
-
- case 462 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
- consumeArrayInitializer();
- break;
-
- case 463 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
- consumeArrayInitializer();
- break;
-
- case 465 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$
- consumeVariableInitializers();
- break;
-
- case 466 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$
- consumeBlock();
- break;
-
- case 467 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$
- consumeOpenBlock() ;
- break;
-
- case 468 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$
- consumeBlockStatement() ;
- break;
-
- case 469 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$
- consumeBlockStatements() ;
- break;
-
- case 476 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$
- consumeInvalidInterfaceDeclaration();
- break;
-
- case 477 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$
- consumeInvalidAnnotationTypeDeclaration();
- break;
-
- case 478 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$
- consumeInvalidEnumDeclaration();
- break;
-
- case 479 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$
- consumeLocalVariableDeclarationStatement();
- break;
-
- case 480 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$
- consumeLocalVariableDeclaration();
- break;
-
- case 481 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$
- consumeLocalVariableDeclaration();
- break;
-
- case 482 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$
- consumePushModifiers();
- break;
-
- case 483 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$
- consumePushModifiersForHeader();
- break;
-
- case 484 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$
- consumePushRealModifiers();
- break;
-
- case 511 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyStatement();
- break;
-
- case 512 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$
- consumeStatementLabel() ;
- break;
-
- case 513 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$
- consumeStatementLabel() ;
- break;
-
- case 514 : if (DEBUG) { System.out.println("Label ::= JavaIdentifier"); } //$NON-NLS-1$
- consumeLabel() ;
- break;
-
- case 515 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$
- consumeExpressionStatement();
- break;
-
- case 524 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementIfNoElse();
- break;
-
- case 525 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementIfWithElse();
- break;
-
- case 526 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementIfWithElse();
- break;
-
- case 527 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementSwitch() ;
- break;
-
- case 528 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$
- consumeEmptySwitchBlock() ;
- break;
-
- case 531 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$
- consumeSwitchBlock() ;
- break;
-
- case 533 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$
- consumeSwitchBlockStatements() ;
- break;
-
- case 534 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$
- consumeSwitchBlockStatement() ;
- break;
-
- case 536 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$
- consumeSwitchLabels() ;
- break;
-
- case 537 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); } //$NON-NLS-1$
- consumeCaseLabel();
- break;
-
- case 538 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$
- consumeDefaultLabel();
- break;
-
- case 539 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementWhile() ;
- break;
-
- case 540 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementWhile() ;
- break;
-
- case 541 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementDo() ;
- break;
-
- case 542 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$
- consumeStatementFor() ;
- break;
-
- case 543 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$
- consumeStatementFor() ;
- break;
-
- case 544 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$
- consumeForInit() ;
- break;
-
- case 548 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$
- consumeStatementExpressionList() ;
- break;
-
- case 549 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$
- consumeSimpleAssertStatement() ;
- break;
-
- case 550 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$
- consumeAssertStatement() ;
- break;
-
- case 551 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$
- consumeStatementBreak() ;
- break;
-
- case 552 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
- consumeStatementBreakWithLabel() ;
- break;
-
- case 553 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$
- consumeStatementContinue() ;
- break;
-
- case 554 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$
- consumeStatementContinueWithLabel() ;
- break;
-
- case 555 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$
- consumeStatementReturn() ;
- break;
-
- case 556 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$
- consumeStatementThrow();
- break;
-
- case 557 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$
- consumeStatementSynchronized();
- break;
-
- case 558 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$
- consumeOnlySynchronized();
- break;
-
- case 559 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$
- consumeStatementTry(false, false);
- break;
-
- case 560 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$
- consumeStatementTry(true, false);
- break;
-
- case 561 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
- consumeStatementTry(false, true);
- break;
-
- case 562 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
- consumeStatementTry(true, true);
- break;
-
- case 563 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$
- consumeResourceSpecification();
- break;
-
- case 564 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(false);
- break;
-
- case 565 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(true);
- break;
-
- case 566 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$
- consumeSingleResource();
- break;
-
- case 567 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$
- consumeMultipleResources();
- break;
-
- case 568 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(true);
- break;
-
- case 569 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$
- consumeResourceAsLocalVariableDeclaration();
- break;
-
- case 570 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$
- consumeResourceAsLocalVariableDeclaration();
- break;
-
- case 572 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$
- consumeExitTryBlock();
- break;
-
- case 574 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$
- consumeCatches();
- break;
-
- case 575 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
- consumeStatementCatch() ;
- break;
-
- case 577 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$
- consumeLeftParen();
- break;
-
- case 578 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$
- consumeRightParen();
- break;
-
- case 583 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayThis();
- break;
-
- case 584 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
- consumePrimaryNoNewArray();
- break;
-
- case 585 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayWithName();
- break;
-
- case 588 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayNameThis();
- break;
-
- case 589 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayNameSuper();
- break;
-
- case 590 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayName();
- break;
-
- case 591 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayArrayType();
- break;
-
- case 592 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayPrimitiveArrayType();
- break;
-
- case 593 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$
- consumePrimaryNoNewArrayPrimitiveType();
- break;
-
- case 599 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
- consumeReferenceExpressionTypeArgumentsAndTrunk(false);
- break;
-
- case 600 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$
- consumeReferenceExpressionTypeArgumentsAndTrunk(true);
- break;
-
- case 601 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$
- consumeReferenceExpressionTypeForm(true);
- break;
-
- case 602 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$
- consumeReferenceExpressionTypeForm(false);
- break;
-
- case 603 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$
- consumeReferenceExpressionGenericTypeForm();
- break;
-
- case 604 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$
- consumeReferenceExpressionPrimaryForm();
- break;
-
- case 605 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$
- consumeReferenceExpressionSuperForm();
- break;
-
- case 606 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$
- consumeEmptyTypeArguments();
- break;
-
- case 608 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$
- consumeIdentifierOrNew(false);
- break;
-
- case 609 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$
- consumeIdentifierOrNew(true);
- break;
-
- case 610 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$
- consumeLambdaExpression();
- break;
-
- case 611 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$
- consumeNestedLambda();
- break;
-
- case 612 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$
- consumeTypeElidedLambdaParameter(false);
- break;
-
- case 618 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$
- consumeFormalParameterList();
- break;
-
- case 619 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$
- consumeTypeElidedLambdaParameter(true);
- break;
-
- case 622 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$
- consumeElidedLeftBraceAndReturn();
- break;
-
- case 623 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$
- consumeAllocationHeader();
- break;
-
- case 624 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionWithTypeArguments();
- break;
-
- case 625 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpression();
- break;
-
- case 626 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
- break;
-
- case 627 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualified() ;
- break;
-
- case 628 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualified() ;
- break;
-
- case 629 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
- break;
-
- case 630 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$
- consumeEnterInstanceCreationArgumentList();
- break;
-
- case 631 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionName() ;
- break;
-
- case 632 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$
- consumeClassBodyopt();
- break;
-
- case 634 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
- consumeEnterAnonymousClassBody(false);
- break;
-
- case 635 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$
- consumeClassBodyopt();
- break;
-
- case 637 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
- consumeEnterAnonymousClassBody(true);
- break;
-
- case 639 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$
- consumeArgumentList();
- break;
-
- case 640 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$
- consumeArrayCreationHeader();
- break;
-
- case 641 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$
- consumeArrayCreationHeader();
- break;
-
- case 642 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithoutInitializer();
- break;
-
- case 643 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithInitializer();
- break;
-
- case 644 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithoutInitializer();
- break;
-
- case 645 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithInitializer();
- break;
-
- case 647 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$
- consumeDimWithOrWithOutExprs();
- break;
-
- case 649 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$
- consumeDimWithOrWithOutExpr();
- break;
-
- case 650 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$
- consumeDims();
- break;
-
- case 653 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
- consumeOneDimLoop(false);
- break;
-
- case 654 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$
- consumeOneDimLoop(true);
- break;
-
- case 655 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT JavaIdentifier"); } //$NON-NLS-1$
- consumeFieldAccess(false);
- break;
-
- case 656 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT JavaIdentifier"); } //$NON-NLS-1$
- consumeFieldAccess(true);
- break;
-
- case 657 : if (DEBUG) { System.out.println("MethodInvocation ::= NameOrAj LPAREN ArgumentListopt..."); } //$NON-NLS-1$
- consumeMethodInvocationName();
- break;
-
- case 658 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationNameWithTypeArguments();
- break;
-
- case 659 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationPrimaryWithTypeArguments();
- break;
-
- case 660 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT JavaIdentifier LPAREN"); } //$NON-NLS-1$
- consumeMethodInvocationPrimary();
- break;
-
- case 661 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationSuperWithTypeArguments();
- break;
-
- case 662 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT JavaIdentifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationSuper();
- break;
-
- case 663 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
- consumeArrayAccess(true);
- break;
-
- case 664 : if (DEBUG) { System.out.println("ArrayAccess ::= AjName LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
- consumeArrayAccess(true);
- break;
-
- case 665 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$
- consumeArrayAccess(false);
- break;
-
- case 666 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$
- consumeArrayAccess(false);
- break;
-
- case 668 : if (DEBUG) { System.out.println("PostfixExpression ::= NameOrAj"); } //$NON-NLS-1$
- consumePostfixExpression();
- break;
-
- case 671 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS,true);
- break;
-
- case 672 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS,true);
- break;
-
- case 673 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$
- consumePushPosition();
- break;
-
- case 676 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS);
- break;
-
- case 677 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS);
- break;
-
- case 679 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS,false);
- break;
-
- case 680 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS,false);
- break;
-
- case 682 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.TWIDDLE);
- break;
-
- case 683 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.NOT);
- break;
-
- case 685 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$
- consumeCastExpressionWithPrimitiveType();
- break;
-
- case 686 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
- consumeCastExpressionWithGenericsArray();
- break;
-
- case 687 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
- consumeCastExpressionWithQualifiedGenericsArray();
- break;
-
- case 688 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$
- consumeCastExpressionLL1();
- break;
-
- case 689 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$
- consumeCastExpressionLL1WithBounds();
- break;
-
- case 690 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$
- consumeCastExpressionWithNameArray();
- break;
-
- case 691 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$
- consumeZeroAdditionalBounds();
- break;
-
- case 695 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$
- consumeOnlyTypeArgumentsForCastExpression();
- break;
-
- case 696 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$
- consumeInsideCastExpression();
- break;
-
- case 697 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionLL1();
- break;
-
- case 698 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionLL1WithBounds ();
- break;
-
- case 699 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionWithQualifiedGenerics();
- break;
-
- case 701 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MULTIPLY);
- break;
-
- case 702 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.DIVIDE);
- break;
-
- case 703 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.REMAINDER);
- break;
-
- case 705 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.PLUS);
- break;
-
- case 706 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MINUS);
- break;
-
- case 708 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
- break;
-
- case 709 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
- break;
-
- case 710 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 712 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS);
- break;
-
- case 713 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER);
- break;
-
- case 714 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS_EQUAL);
- break;
-
- case 715 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
- break;
-
- case 717 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$
- consumeInstanceOfExpression();
- break;
-
- case 719 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
- break;
-
- case 720 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.NOT_EQUAL);
- break;
-
- case 722 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND);
- break;
-
- case 724 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.XOR);
- break;
-
- case 726 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR);
- break;
-
- case 728 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND_AND);
- break;
-
- case 730 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR_OR);
- break;
-
- case 732 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
- consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
- break;
-
- case 735 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$
- consumeAssignment();
- break;
-
- case 737 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$
- ignoreExpressionAssignment();
- break;
-
- case 738 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(EQUAL);
- break;
-
- case 739 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(MULTIPLY);
- break;
-
- case 740 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(DIVIDE);
- break;
-
- case 741 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(REMAINDER);
- break;
-
- case 742 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(PLUS);
- break;
-
- case 743 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(MINUS);
- break;
-
- case 744 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(LEFT_SHIFT);
- break;
-
- case 745 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(RIGHT_SHIFT);
- break;
-
- case 746 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 747 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(AND);
- break;
-
- case 748 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(XOR);
- break;
-
- case 749 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(OR);
- break;
-
- case 750 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$
- consumeExpression();
- break;
-
- case 753 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$
- consumeEmptyExpression();
- break;
-
- case 758 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyClassBodyDeclarationsopt();
- break;
-
- case 759 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeClassBodyDeclarationsopt();
- break;
-
- case 760 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$
- consumeDefaultModifiers();
- break;
-
- case 761 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$
- consumeModifiers();
- break;
-
- case 762 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$
- consumeEmptyBlockStatementsopt();
- break;
-
- case 764 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$
- consumeEmptyDimsopt();
- break;
-
- case 766 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$
- consumeEmptyArgumentListopt();
- break;
-
- case 770 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$
- consumeFormalParameterListopt();
- break;
-
- case 774 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyInterfaceMemberDeclarationsopt();
- break;
-
- case 775 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeInterfaceMemberDeclarationsopt();
- break;
-
- case 776 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$
- consumeNestedType();
- break;
-
- case 777 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$
- consumeEmptyForInitopt();
- break;
-
- case 779 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$
- consumeEmptyForUpdateopt();
- break;
-
- case 783 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$
- consumeEmptyCatchesopt();
- break;
-
- case 785 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$
- consumeEnumDeclaration();
- break;
-
- case 786 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$
- consumeEnumHeader();
- break;
-
- case 787 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum JavaIdentifier"); } //$NON-NLS-1$
- consumeEnumHeaderName();
- break;
-
- case 788 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum JavaIdentifier..."); } //$NON-NLS-1$
- consumeEnumHeaderNameWithTypeParameters();
- break;
-
- case 789 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$
- consumeEnumBodyNoConstants();
- break;
-
- case 790 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$
- consumeEnumBodyNoConstants();
- break;
-
- case 791 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$
- consumeEnumBodyWithConstants();
- break;
-
- case 792 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$
- consumeEnumBodyWithConstants();
- break;
-
- case 794 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$
- consumeEnumConstants();
- break;
-
- case 795 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
- consumeEnumConstantHeaderName();
- break;
-
- case 796 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$
- consumeEnumConstantHeader();
- break;
-
- case 797 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$
- consumeEnumConstantWithClassBody();
- break;
-
- case 798 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$
- consumeEnumConstantNoClassBody();
- break;
-
- case 799 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
- consumeArguments();
- break;
-
- case 800 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$
- consumeEmptyArguments();
- break;
-
- case 802 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$
- consumeEnumDeclarations();
- break;
-
- case 803 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyEnumDeclarations();
- break;
-
- case 805 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$
- consumeEnhancedForStatement();
- break;
-
- case 806 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$
- consumeEnhancedForStatement();
- break;
-
- case 807 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$
- consumeEnhancedForStatementHeaderInit(false);
- break;
-
- case 808 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$
- consumeEnhancedForStatementHeaderInit(true);
- break;
-
- case 809 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$
- consumeEnhancedForStatementHeader();
- break;
-
- case 810 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
- break;
-
- case 811 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$
- consumeSingleStaticImportDeclarationName();
- break;
-
- case 812 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
- break;
-
- case 813 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$
- consumeStaticImportOnDemandDeclarationName();
- break;
-
- case 814 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
- consumeTypeArguments();
- break;
-
- case 815 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
- consumeOnlyTypeArguments();
- break;
-
- case 817 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList1();
- break;
-
- case 819 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$
- consumeTypeArgumentList();
- break;
-
- case 820 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$
- consumeTypeArgument();
- break;
-
- case 824 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$
- consumeReferenceType1();
- break;
-
- case 825 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
- consumeTypeArgumentReferenceType1();
- break;
-
- case 827 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList2();
- break;
-
- case 830 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeReferenceType2();
- break;
-
- case 831 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
- consumeTypeArgumentReferenceType2();
- break;
-
- case 833 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList3();
- break;
-
- case 836 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeReferenceType3();
- break;
-
- case 837 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$
- consumeWildcard();
- break;
-
- case 838 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$
- consumeWildcardWithBounds();
- break;
-
- case 839 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$
- consumeWildcardBoundsExtends();
- break;
-
- case 840 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$
- consumeWildcardBoundsSuper();
- break;
-
- case 841 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$
- consumeWildcard1();
- break;
-
- case 842 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard1WithBounds();
- break;
-
- case 843 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$
- consumeWildcardBounds1Extends();
- break;
-
- case 844 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$
- consumeWildcardBounds1Super();
- break;
-
- case 845 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeWildcard2();
- break;
-
- case 846 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard2WithBounds();
- break;
-
- case 847 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$
- consumeWildcardBounds2Extends();
- break;
-
- case 848 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$
- consumeWildcardBounds2Super();
- break;
-
- case 849 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard3();
- break;
-
- case 850 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
- consumeWildcard3WithBounds();
- break;
-
- case 851 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$
- consumeWildcardBounds3Extends();
- break;
-
- case 852 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$
- consumeWildcardBounds3Super();
- break;
-
- case 853 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt..."); } //$NON-NLS-1$
- consumeTypeParameterHeader();
- break;
-
- case 854 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$
- consumeTypeParameters();
- break;
-
- case 856 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
- consumeTypeParameterList();
- break;
-
- case 858 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameterWithExtends();
- break;
-
- case 859 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameterWithExtendsAndBounds();
- break;
-
- case 861 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$
- consumeAdditionalBoundList();
- break;
-
- case 862 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$
- consumeAdditionalBound();
- break;
-
- case 864 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
- consumeTypeParameterList1();
- break;
-
- case 865 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$
- consumeTypeParameter1();
- break;
-
- case 866 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameter1WithExtends();
- break;
-
- case 867 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameter1WithExtendsAndBounds();
- break;
-
- case 869 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$
- consumeAdditionalBoundList1();
- break;
-
- case 870 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$
- consumeAdditionalBound1();
- break;
-
- case 876 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS);
- break;
-
- case 877 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS);
- break;
-
- case 880 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.TWIDDLE);
- break;
-
- case 881 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.NOT);
- break;
-
- case 884 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MULTIPLY);
- break;
-
- case 885 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= NameOrAj MULTIPLY"); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);
- break;
-
- case 886 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.DIVIDE);
- break;
-
- case 887 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= NameOrAj DIVIDE..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.DIVIDE);
- break;
-
- case 888 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.REMAINDER);
- break;
-
- case 889 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= NameOrAj REMAINDER"); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.REMAINDER);
- break;
-
- case 891 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.PLUS);
- break;
-
- case 892 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= NameOrAj PLUS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.PLUS);
- break;
-
- case 893 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MINUS);
- break;
-
- case 894 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= NameOrAj MINUS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.MINUS);
- break;
-
- case 896 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
- break;
-
- case 897 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= NameOrAj LEFT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);
- break;
-
- case 898 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
- break;
-
- case 899 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= NameOrAj RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);
- break;
-
- case 900 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 901 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= NameOrAj..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 903 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS);
- break;
-
- case 904 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LESS);
- break;
-
- case 905 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER);
- break;
-
- case 906 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= NameOrAj GREATER..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.GREATER);
- break;
-
- case 907 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS_EQUAL);
- break;
-
- case 908 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= NameOrAj LESS_EQUAL..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);
- break;
-
- case 909 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
- break;
-
- case 910 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= NameOrAj GREATER_EQUAL"); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);
- break;
-
- case 912 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= NameOrAj instanceof..."); } //$NON-NLS-1$
- consumeInstanceOfExpressionWithName();
- break;
-
- case 913 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeInstanceOfExpression();
- break;
-
- case 915 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
- break;
-
- case 916 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= NameOrAj EQUAL_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);
- break;
-
- case 917 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.NOT_EQUAL);
- break;
-
- case 918 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= NameOrAj NOT_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);
- break;
-
- case 920 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND);
- break;
-
- case 921 : if (DEBUG) { System.out.println("AndExpression_NotName ::= NameOrAj AND..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.AND);
- break;
-
- case 923 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.XOR);
- break;
-
- case 924 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= NameOrAj XOR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.XOR);
- break;
-
- case 926 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR);
- break;
-
- case 927 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= NameOrAj OR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.OR);
- break;
-
- case 929 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND_AND);
- break;
-
- case 930 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= NameOrAj AND_AND..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.AND_AND);
- break;
-
- case 932 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR_OR);
- break;
-
- case 933 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= NameOrAj OR_OR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.OR_OR);
- break;
-
- case 935 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
- break;
-
- case 936 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= NameOrAj QUESTION..."); } //$NON-NLS-1$
- consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;
- break;
-
- case 940 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderName() ;
- break;
-
- case 941 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
- break;
-
- case 942 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
- break;
-
- case 943 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderName() ;
- break;
-
- case 944 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeader() ;
- break;
-
- case 945 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclaration() ;
- break;
-
- case 947 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyAnnotationTypeMemberDeclarationsopt() ;
- break;
-
- case 948 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclarationsopt() ;
- break;
-
- case 950 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclarations() ;
- break;
-
- case 951 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(true);
- break;
-
- case 952 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeMethodHeaderName(true);
- break;
-
- case 953 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$
- consumeEmptyMethodHeaderDefaultValue() ;
- break;
-
- case 954 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$
- consumeMethodHeaderDefaultValue();
- break;
-
- case 955 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 956 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclaration() ;
- break;
-
- case 964 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableNameOrAj"); } //$NON-NLS-1$
- consumeAnnotationName() ;
- break;
-
- case 965 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeNormalAnnotation(false) ;
- break;
-
- case 966 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$
- consumeEmptyMemberValuePairsopt() ;
- break;
-
- case 969 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$
- consumeMemberValuePairs() ;
- break;
-
- case 970 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleNameOrAj EQUAL..."); } //$NON-NLS-1$
- consumeMemberValuePair() ;
- break;
-
- case 971 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$
- consumeEnterMemberValue() ;
- break;
-
- case 972 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$
- consumeExitMemberValue() ;
- break;
-
- case 974 : if (DEBUG) { System.out.println("MemberValue ::= NameOrAj"); } //$NON-NLS-1$
- consumeMemberValueAsName() ;
- break;
-
- case 977 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeMemberValueArrayInitializer() ;
- break;
-
- case 978 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeMemberValueArrayInitializer() ;
- break;
-
- case 979 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeEmptyMemberValueArrayInitializer() ;
- break;
-
- case 980 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeEmptyMemberValueArrayInitializer() ;
- break;
-
- case 981 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$
- consumeEnterMemberValueArrayInitializer() ;
- break;
-
- case 983 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$
- consumeMemberValues() ;
- break;
-
- case 984 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$
- consumeMarkerAnnotation(false) ;
- break;
-
- case 985 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$
- consumeSingleMemberAnnotationMemberValue() ;
- break;
-
- case 986 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeSingleMemberAnnotation(false) ;
- break;
-
- case 987 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderNameWithTypeParameters();
- break;
-
- case 988 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderName();
- break;
-
- case 989 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderNameWithTypeParameters();
- break;
-
- case 990 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderName();
- break;
-
- case 991 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 992 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
+ case 777 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$
+ consumeEmptyForInitopt();
+ break;
+
+ case 779 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$
+ consumeEmptyForUpdateopt();
+ break;
+
+ case 783 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$
+ consumeEmptyCatchesopt();
+ break;
+
+ case 785 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$
+ consumeEnumDeclaration();
+ break;
+
+ case 786 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$
+ consumeEnumHeader();
+ break;
+
+ case 787 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum JavaIdentifier"); } //$NON-NLS-1$
+ consumeEnumHeaderName();
+ break;
+
+ case 788 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum JavaIdentifier..."); } //$NON-NLS-1$
+ consumeEnumHeaderNameWithTypeParameters();
+ break;
+
+ case 789 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$
+ consumeEnumBodyNoConstants();
+ break;
+
+ case 790 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$
+ consumeEnumBodyNoConstants();
+ break;
+
+ case 791 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$
+ consumeEnumBodyWithConstants();
+ break;
+
+ case 792 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$
+ consumeEnumBodyWithConstants();
+ break;
+
+ case 794 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$
+ consumeEnumConstants();
+ break;
+
+ case 795 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
+ consumeEnumConstantHeaderName();
+ break;
+
+ case 796 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$
+ consumeEnumConstantHeader();
+ break;
+
+ case 797 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$
+ consumeEnumConstantWithClassBody();
+ break;
+
+ case 798 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$
+ consumeEnumConstantNoClassBody();
+ break;
+
+ case 799 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
+ consumeArguments();
+ break;
+
+ case 800 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$
+ consumeEmptyArguments();
+ break;
+
+ case 802 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$
+ consumeEnumDeclarations();
+ break;
+
+ case 803 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyEnumDeclarations();
+ break;
+
+ case 805 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$
+ consumeEnhancedForStatement();
+ break;
+
+ case 806 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$
+ consumeEnhancedForStatement();
+ break;
+
+ case 807 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$
+ consumeEnhancedForStatementHeaderInit(false);
+ break;
+
+ case 808 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$
+ consumeEnhancedForStatementHeaderInit(true);
+ break;
+
+ case 809 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$
+ consumeEnhancedForStatementHeader();
+ break;
+
+ case 810 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$
+ consumeImportDeclaration();
+ break;
+
+ case 811 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$
+ consumeSingleStaticImportDeclarationName();
+ break;
+
+ case 812 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
+ consumeImportDeclaration();
+ break;
+
+ case 813 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$
+ consumeStaticImportOnDemandDeclarationName();
+ break;
+
+ case 814 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
+ consumeTypeArguments();
+ break;
+
+ case 815 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
+ consumeOnlyTypeArguments();
+ break;
+
+ case 817 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ consumeTypeArgumentList1();
+ break;
+
+ case 819 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$
+ consumeTypeArgumentList();
+ break;
+
+ case 820 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$
+ consumeTypeArgument();
+ break;
+
+ case 824 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$
+ consumeReferenceType1();
+ break;
+
+ case 825 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
+ consumeTypeArgumentReferenceType1();
+ break;
+
+ case 827 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ consumeTypeArgumentList2();
+ break;
+
+ case 830 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeReferenceType2();
+ break;
+
+ case 831 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
+ consumeTypeArgumentReferenceType2();
+ break;
+
+ case 833 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ consumeTypeArgumentList3();
+ break;
+
+ case 836 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeReferenceType3();
+ break;
+
+ case 837 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$
+ consumeWildcard();
+ break;
+
+ case 838 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$
+ consumeWildcardWithBounds();
+ break;
+
+ case 839 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$
+ consumeWildcardBoundsExtends();
+ break;
+
+ case 840 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$
+ consumeWildcardBoundsSuper();
+ break;
+
+ case 841 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$
+ consumeWildcard1();
+ break;
+
+ case 842 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ consumeWildcard1WithBounds();
+ break;
+
+ case 843 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$
+ consumeWildcardBounds1Extends();
+ break;
+
+ case 844 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$
+ consumeWildcardBounds1Super();
+ break;
+
+ case 845 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeWildcard2();
+ break;
+
+ case 846 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ consumeWildcard2WithBounds();
+ break;
+
+ case 847 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$
+ consumeWildcardBounds2Extends();
+ break;
+
+ case 848 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$
+ consumeWildcardBounds2Super();
+ break;
+
+ case 849 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ consumeWildcard3();
+ break;
+
+ case 850 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$
+ consumeWildcard3WithBounds();
+ break;
+
+ case 851 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$
+ consumeWildcardBounds3Extends();
+ break;
+
+ case 852 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$
+ consumeWildcardBounds3Super();
+ break;
+
+ case 853 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt..."); } //$NON-NLS-1$
+ consumeTypeParameterHeader();
+ break;
+
+ case 854 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$
+ consumeTypeParameters();
+ break;
+
+ case 856 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
+ consumeTypeParameterList();
+ break;
+
+ case 858 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameterWithExtends();
+ break;
+
+ case 859 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameterWithExtendsAndBounds();
+ break;
+
+ case 861 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$
+ consumeAdditionalBoundList();
+ break;
+
+ case 862 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$
+ consumeAdditionalBound();
+ break;
+
+ case 864 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
+ consumeTypeParameterList1();
+ break;
+
+ case 865 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$
+ consumeTypeParameter1();
+ break;
+
+ case 866 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameter1WithExtends();
+ break;
+
+ case 867 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameter1WithExtendsAndBounds();
+ break;
+
+ case 869 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$
+ consumeAdditionalBoundList1();
+ break;
+
+ case 870 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$
+ consumeAdditionalBound1();
+ break;
+
+ case 876 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 877 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 880 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.TWIDDLE);
+ break;
+
+ case 881 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.NOT);
+ break;
+
+ case 884 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MULTIPLY);
+ break;
+
+ case 885 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= NameOrAj MULTIPLY"); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);
+ break;
+
+ case 886 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.DIVIDE);
+ break;
+
+ case 887 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= NameOrAj DIVIDE..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.DIVIDE);
+ break;
+
+ case 888 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.REMAINDER);
+ break;
+
+ case 889 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= NameOrAj REMAINDER"); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.REMAINDER);
+ break;
+
+ case 891 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 892 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= NameOrAj PLUS..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.PLUS);
+ break;
+
+ case 893 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 894 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= NameOrAj MINUS..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.MINUS);
+ break;
+
+ case 896 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
+ break;
+
+ case 897 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= NameOrAj LEFT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);
+ break;
+
+ case 898 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
+ break;
+
+ case 899 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= NameOrAj RIGHT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);
+ break;
+
+ case 900 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 901 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= NameOrAj..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 903 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS);
+ break;
+
+ case 904 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.LESS);
+ break;
+
+ case 905 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER);
+ break;
+
+ case 906 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= NameOrAj GREATER..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.GREATER);
+ break;
+
+ case 907 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS_EQUAL);
+ break;
+
+ case 908 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= NameOrAj LESS_EQUAL..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);
+ break;
+
+ case 909 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
+ break;
+
+ case 910 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= NameOrAj GREATER_EQUAL"); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);
+ break;
+
+ case 912 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= NameOrAj instanceof..."); } //$NON-NLS-1$
+ consumeInstanceOfExpressionWithName();
+ break;
+
+ case 913 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeInstanceOfExpression();
+ break;
+
+ case 915 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
+ break;
+
+ case 916 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= NameOrAj EQUAL_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);
+ break;
+
+ case 917 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.NOT_EQUAL);
+ break;
+
+ case 918 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= NameOrAj NOT_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);
+ break;
+
+ case 920 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND);
+ break;
+
+ case 921 : if (DEBUG) { System.out.println("AndExpression_NotName ::= NameOrAj AND..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.AND);
+ break;
+
+ case 923 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.XOR);
+ break;
+
+ case 924 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= NameOrAj XOR..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.XOR);
+ break;
+
+ case 926 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR);
+ break;
+
+ case 927 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= NameOrAj OR..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.OR);
+ break;
+
+ case 929 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND_AND);
+ break;
+
+ case 930 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= NameOrAj AND_AND..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.AND_AND);
+ break;
+
+ case 932 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR_OR);
+ break;
+
+ case 933 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= NameOrAj OR_OR..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.OR_OR);
+ break;
+
+ case 935 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
+ break;
+
+ case 936 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= NameOrAj QUESTION..."); } //$NON-NLS-1$
+ consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;
+ break;
+
+ case 940 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderName() ;
+ break;
+
+ case 941 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
+ break;
+
+ case 942 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
+ break;
+
+ case 943 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderName() ;
+ break;
+
+ case 944 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeader() ;
+ break;
+
+ case 945 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclaration() ;
+ break;
+
+ case 947 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyAnnotationTypeMemberDeclarationsopt() ;
+ break;
+
+ case 948 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ consumeAnnotationTypeMemberDeclarationsopt() ;
+ break;
+
+ case 950 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeMemberDeclarations() ;
+ break;
+
+ case 951 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeMethodHeaderNameWithTypeParameters(true);
+ break;
+
+ case 952 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ consumeMethodHeaderName(true);
+ break;
+
+ case 953 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$
+ consumeEmptyMethodHeaderDefaultValue() ;
+ break;
+
+ case 954 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$
+ consumeMethodHeaderDefaultValue();
+ break;
+
+ case 955 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 956 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeMemberDeclaration() ;
+ break;
+
+ case 964 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableNameOrAj"); } //$NON-NLS-1$
+ consumeAnnotationName() ;
+ break;
+
+ case 965 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
+ consumeNormalAnnotation(false) ;
+ break;
+
+ case 966 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$
+ consumeEmptyMemberValuePairsopt() ;
+ break;
+
+ case 969 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$
+ consumeMemberValuePairs() ;
+ break;
+
+ case 970 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleNameOrAj EQUAL..."); } //$NON-NLS-1$
+ consumeMemberValuePair() ;
+ break;
+
+ case 971 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$
+ consumeEnterMemberValue() ;
+ break;
+
+ case 972 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$
+ consumeExitMemberValue() ;
+ break;
+
+ case 974 : if (DEBUG) { System.out.println("MemberValue ::= NameOrAj"); } //$NON-NLS-1$
+ consumeMemberValueAsName() ;
+ break;
+
+ case 977 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeMemberValueArrayInitializer() ;
+ break;
+
+ case 978 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeMemberValueArrayInitializer() ;
+ break;
+
+ case 979 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeEmptyMemberValueArrayInitializer() ;
+ break;
+
+ case 980 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeEmptyMemberValueArrayInitializer() ;
+ break;
+
+ case 981 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$
+ consumeEnterMemberValueArrayInitializer() ;
+ break;
+
+ case 983 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$
+ consumeMemberValues() ;
+ break;
+
+ case 984 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$
+ consumeMarkerAnnotation(false) ;
+ break;
+
+ case 985 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$
+ consumeSingleMemberAnnotationMemberValue() ;
+ break;
+
+ case 986 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
+ consumeSingleMemberAnnotation(false) ;
+ break;
+
+ case 987 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
+ consumeRecoveryMethodHeaderNameWithTypeParameters();
+ break;
+
+ case 988 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ consumeRecoveryMethodHeaderName();
+ break;
+
+ case 989 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$
+ consumeRecoveryMethodHeaderNameWithTypeParameters();
+ break;
+
+ case 990 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$
+ consumeRecoveryMethodHeaderName();
+ break;
+
+ case 991 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 992 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ }
}
-}
+
// AspectJ: new method
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
index 6cc5740..1e6f09f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
@@ -14,14 +14,14 @@
about the parser such as the number of rules in the grammar, the starting state, etc...*/
public interface ParserBasicInformation {
- int ERROR_SYMBOL = 125,
+ int ERROR_SYMBOL = 125,
MAX_NAME_LENGTH = 41,
- NUM_STATES = 1264,
+ NUM_STATES = 1263,
NT_OFFSET = 125,
SCOPE_UBOUND = 365,
SCOPE_SIZE = 366,
- LA_STATE_OFFSET = 18969,
+ LA_STATE_OFFSET = 18993,
MAX_LA = 1,
NUM_RULES = 992,
NUM_TERMINALS = 125,
@@ -30,6 +30,6 @@
START_STATE = 1288,
EOFT_SYMBOL = 70,
EOLT_SYMBOL = 70,
- ACCEPT_ACTION = 18968,
- ERROR_ACTION = 18969;
+ ACCEPT_ACTION = 18992,
+ ERROR_ACTION = 18993;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
index 31c0aaa..c6716a5 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java
@@ -18,7 +18,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Block;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
@@ -95,6 +94,9 @@
*/
public RecoveredElement add(LocalDeclaration localDeclaration, int bracketBalanceValue, boolean delegatedByParent) {
+ if (localDeclaration.isRecoveredFromLoneIdentifier()) {
+ return this; // skip, the local will be mutated into an assignment and added later, see Parser.consumeLocalVariableDeclarationStatement
+ }
/* local variables inside method can only be final and non void */
/*
char[][] localTypeName;
@@ -152,9 +154,6 @@
*/
public RecoveredElement add(Statement stmt, int bracketBalanceValue, boolean delegatedByParent) {
- if (stmt instanceof LambdaExpression) // lambdas are recovered up to the containing statement anyways.
- return this;
-
resetPendingModifiers();
/* do not consider a nested block starting passed the block end (if set)
@@ -289,11 +288,6 @@
// if block was not marked to be preserved or empty, then ignore it
if (!this.preserveContent || this.statementCount == 0) return null;
- /* If this block stands for the lambda body, trash the contents. Lambda expressions are recovered as part of the enclosing statement.
- We still have left in a block here to make sure that contained elements can be trapped and tossed out.
- */
- if (this.blockDeclaration.lambdaBody) return null;
-
Statement[] updatedStatements = new Statement[this.statementCount];
int updatedCount = 0;
@@ -334,9 +328,19 @@
int lastEnd = this.blockDeclaration.sourceStart;
// only collect the non-null updated statements
+ next:
for (int i = 0; i < this.statementCount; i++){
Statement updatedStatement = this.statements[i].updatedStatement(depth, knownTypes);
- if (updatedStatement != null){
+ if (updatedStatement != null) {
+ for (int j = 0; j < i; j++) {
+ if (updatedStatements[j] instanceof LocalDeclaration) {
+ LocalDeclaration local = (LocalDeclaration) updatedStatements[j];
+ if (local.initialization != null) {
+ if (updatedStatement.sourceStart >= local.initialization.sourceStart && updatedStatement.sourceEnd <= local.initialization.sourceEnd)
+ continue next;
+ }
+ }
+ }
updatedStatements[updatedCount++] = updatedStatement;
if (updatedStatement instanceof LocalDeclaration) {
@@ -423,42 +427,6 @@
updatedBlock(0, new HashSet());
}
/*
- * Rebuild a flattened block from the nested structure which is in scope
- */
-public Statement updateStatement(int depth, Set knownTypes){
-
- // if block was closed or empty, then ignore it
- if (this.blockDeclaration.sourceEnd != 0 || this.statementCount == 0) return null;
-
- /* If this block stands for the lambda body, trash the contents. Lambda expressions are recovered as part of the enclosing statement.
- We still have left in a block here to make sure that contained elements can be trapped and tossed out.
- */
- if (this.blockDeclaration.lambdaBody) return null;
-
- Statement[] updatedStatements = new Statement[this.statementCount];
- int updatedCount = 0;
-
- // only collect the non-null updated statements
- for (int i = 0; i < this.statementCount; i++){
- Statement updatedStatement = this.statements[i].updatedStatement(depth, knownTypes);
- if (updatedStatement != null){
- updatedStatements[updatedCount++] = updatedStatement;
- }
- }
- if (updatedCount == 0) return null; // not interesting block
-
- // resize statement collection if necessary
- if (updatedCount != this.statementCount){
- this.blockDeclaration.statements = new Statement[updatedCount];
- System.arraycopy(updatedStatements, 0, this.blockDeclaration.statements, 0, updatedCount);
- } else {
- this.blockDeclaration.statements = updatedStatements;
- }
-
- return this.blockDeclaration;
-}
-
-/*
* Record a field declaration
*/
public RecoveredElement add(FieldDeclaration fieldDeclaration, int bracketBalanceValue) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
index 7802d3c..3c7564c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredElement.java
@@ -30,6 +30,11 @@
public int bracketBalance;
public boolean foundOpeningBrace;
protected Parser recoveringParser;
+
+ // There is no RecoveredLambdaElement, we just keep track of entry and exit of lambdas via a counter. This allows to prevent certain incorrect mutations of current element.
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=430667.
+ public int lambdaNestLevel;
+
public RecoveredElement(RecoveredElement parent, int bracketBalance){
this(parent, bracketBalance, null);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
index 17a0ac7..97237e0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
@@ -50,6 +51,14 @@
this.alreadyCompletedFieldInitialization = fieldDeclaration.initialization != null;
}
/*
+ * Record a local declaration
+ */
+public RecoveredElement add(LocalDeclaration localDeclaration, int bracketBalanceValue) {
+ if (this.lambdaNestLevel > 0) // current element is really the lambda which is recovered in full elsewhere.
+ return this;
+ return super.add(localDeclaration, bracketBalanceValue);
+}
+/*
* Record a field declaration
*/
public RecoveredElement add(FieldDeclaration addedfieldDeclaration, int bracketBalanceValue) {
@@ -262,7 +271,7 @@
this.bracketBalance--;
if (this.bracketBalance == 0) {
if(this.fieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
- updateSourceEndIfNecessary(braceEnd - 1);
+ updateSourceEndIfNecessary(braceEnd);
return this.parent;
} else {
if (this.fieldDeclaration.declarationSourceEnd > 0)
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
index 09bb6d6..868531c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -316,8 +316,19 @@
initializer.bodyEnd = initializer.bodyStart;
}
} else {
- initializer.declarationSourceEnd = braceEnd;
- initializer.bodyEnd = braceStart - 1;
+ if (braceEnd < initializer.declarationSourceStart) {
+ initializer.declarationSourceEnd = initializer.declarationSourceStart;
+ initializer.bodyEnd = initializer.declarationSourceEnd;
+ } else {
+ initializer.declarationSourceEnd = braceEnd;
+ initializer.bodyEnd = braceStart - 1;
+ }
+ if (initializer.bodyStart > initializer.declarationSourceEnd) {
+ initializer.bodyStart = initializer.declarationSourceEnd;
+ if(initializer.block != null) {
+ initializer.block.sourceStart = initializer.declarationSourceStart;
+ }
+ }
}
if(initializer.block != null) {
initializer.block.sourceEnd = initializer.declarationSourceEnd;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java
index ce119cf..43d7488 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java
@@ -33,7 +33,7 @@
public int modifiersStart;
public LocalDeclaration localDeclaration;
- boolean alreadyCompletedLocalInitialization;
+ public boolean alreadyCompletedLocalInitialization;
public RecoveredLocalVariable(LocalDeclaration localDeclaration, RecoveredElement parent, int bracketBalance){
super(localDeclaration, parent, bracketBalance);
this.localDeclaration = localDeclaration;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
index 968cbe0..df26ef1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
@@ -74,6 +74,9 @@
* Record a nested block declaration
*/
public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue) {
+ return this.add(nestedBlockDeclaration, bracketBalanceValue, false);
+}
+public RecoveredElement add(Block nestedBlockDeclaration, int bracketBalanceValue, boolean isArgument) {
/* default behavior is to delegate recording to parent if any,
do not consider elements passed the known end (if set)
it must be belonging to an enclosing element
@@ -89,7 +92,7 @@
}
}
/* consider that if the opening brace was not found, it is there */
- if (!this.foundOpeningBrace){
+ if (!this.foundOpeningBrace && !isArgument){
this.foundOpeningBrace = true;
this.bracketBalance++;
}
@@ -174,7 +177,7 @@
if (this.methodBody == null){
Block block = new Block(0);
block.sourceStart = this.methodDeclaration.bodyStart;
- RecoveredElement currentBlock = this.add(block, 1);
+ RecoveredElement currentBlock = this.add(block, 1, localDeclaration.isArgument());
if (this.bracketBalance > 0){
for (int i = 0; i < this.bracketBalance - 1; i++){
currentBlock = currentBlock.add(new Block(0), 1);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
index 1a7bda6..89dc437 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java
@@ -579,12 +579,20 @@
this.methods[this.methodCount - 1].methodDeclaration.declarationSourceEnd = bodyEndValue;
this.methods[this.methodCount - 1].methodDeclaration.bodyEnd = bodyEndValue;
}
+ int totalMethods = existingCount;
+ next:
for (int i = 0; i < this.methodCount; i++){
+ for (int j = 0; j < existingCount; j++) {
+ if (methodDeclarations[j] == this.methods[i].methodDeclaration)
+ continue next;
+ }
AbstractMethodDeclaration updatedMethod = this.methods[i].updatedMethodDeclaration(depth, knownTypes);
if (updatedMethod.isConstructor()) hasRecoveredConstructor = true;
if (updatedMethod.isAbstract()) hasAbstractMethods = true;
- methodDeclarations[existingCount + i] = updatedMethod;
+ methodDeclarations[totalMethods ++] = updatedMethod;
}
+ if (totalMethods != methodDeclarations.length)
+ System.arraycopy(methodDeclarations, 0, methodDeclarations = new AbstractMethodDeclaration[totalMethods], 0, totalMethods);
this.typeDeclaration.methods = methodDeclarations;
if(methodDeclarations[methodDeclarations.length - 1].declarationSourceEnd > lastEnd) {
lastEnd = methodDeclarations[methodDeclarations.length - 1].declarationSourceEnd;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
index 7c9ba08..40db9e3 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java
@@ -92,7 +92,9 @@
kind != TypeDeclaration.INTERFACE_DECL &&
kind != TypeDeclaration.ANNOTATION_TYPE_DECL) {
// the } of the last type can be considered as the end of an initializer
- Initializer initializer = new Initializer(new Block(0), 0);
+ Block block = new Block(0);
+ block.sourceStart = block.sourceEnd = end;
+ Initializer initializer = new Initializer(block, 0);
initializer.bodyStart = end;
initializer.bodyEnd = end;
initializer.declarationSourceStart = end;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
index 52c1540..0406231 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -93,6 +93,16 @@
this.data.insertedTokensPosition[this.data.insertedTokensPtr] = position;
this.data.insertedTokenUsed[this.data.insertedTokensPtr] = false;
}
+
+ public void insertTokenAhead(int token, int index) {
+ if(!this.record) return;
+
+ int length = this.data.insertedTokens[index].length;
+ int [] tokens = new int [length + 1];
+ System.arraycopy(this.data.insertedTokens[index], 0, tokens, 1, length);
+ tokens[0] = token;
+ this.data.insertedTokens[index] = tokens;
+ }
public void replaceTokens(int token, int start, int end) {
replaceTokens(new int []{token}, start, end);
@@ -139,13 +149,13 @@
protected int getNextToken0() throws InvalidInputException {
if(this.pendingTokensPtr > -1) {
- int nextToken = this.pendingTokens[this.pendingTokensPtr--];
- if(nextToken == TerminalTokens.TokenNameIdentifier){
+ int pendingToken = this.pendingTokens[this.pendingTokensPtr--];
+ if(pendingToken == TerminalTokens.TokenNameIdentifier){
this.fakeTokenSource = FAKE_IDENTIFIER;
} else {
this.fakeTokenSource = CharOperation.NO_CHAR;
}
- return nextToken;
+ return pendingToken;
}
this.fakeTokenSource = null;
@@ -160,13 +170,13 @@
this.isInserted = true;
this.startPosition = this.currentPosition;
this.skipNextInsertedTokens = i;
- int nextToken = this.pendingTokens[this.pendingTokensPtr--];
- if(nextToken == TerminalTokens.TokenNameIdentifier){
+ int pendingToken = this.pendingTokens[this.pendingTokensPtr--];
+ if(pendingToken == TerminalTokens.TokenNameIdentifier){
this.fakeTokenSource = FAKE_IDENTIFIER;
} else {
this.fakeTokenSource = CharOperation.NO_CHAR;
}
- return nextToken;
+ return pendingToken;
}
}
this.skipNextInsertedTokens = -1;
@@ -186,13 +196,13 @@
this.fakeTokenSource = FAKE_IDENTIFIER;
this.isInserted = false;
this.currentPosition = this.data.replacedTokensEnd[i] + 1;
- int nextToken = this.pendingTokens[this.pendingTokensPtr--];
- if(nextToken == TerminalTokens.TokenNameIdentifier){
+ int pendingToken = this.pendingTokens[this.pendingTokensPtr--];
+ if(pendingToken == TerminalTokens.TokenNameIdentifier){
this.fakeTokenSource = FAKE_IDENTIFIER;
} else {
this.fakeTokenSource = CharOperation.NO_CHAR;
}
- return nextToken;
+ return pendingToken;
}
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java
index 19724ab..e957483 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/ScannerHelper.java
@@ -28,7 +28,7 @@
ASTNode.Bit13, ASTNode.Bit14, ASTNode.Bit15, ASTNode.Bit16, ASTNode.Bit17, ASTNode.Bit18,
ASTNode.Bit19, ASTNode.Bit20, ASTNode.Bit21, ASTNode.Bit22, ASTNode.Bit23, ASTNode.Bit24,
ASTNode.Bit25, ASTNode.Bit26, ASTNode.Bit27, ASTNode.Bit28, ASTNode.Bit29, ASTNode.Bit30,
- ASTNode.Bit31, ASTNode.Bit32, ASTNode.Bit33L, ASTNode.Bit34L, ASTNode.Bit35L, ASTNode.Bit36L,
+ ASTNode.Bit31, ASTNode.Bit32L, ASTNode.Bit33L, ASTNode.Bit34L, ASTNode.Bit35L, ASTNode.Bit36L,
ASTNode.Bit37L, ASTNode.Bit38L, ASTNode.Bit39L, ASTNode.Bit40L, ASTNode.Bit41L, ASTNode.Bit42L,
ASTNode.Bit43L, ASTNode.Bit44L, ASTNode.Bit45L, ASTNode.Bit46L, ASTNode.Bit47L, ASTNode.Bit48L,
ASTNode.Bit49L, ASTNode.Bit50L, ASTNode.Bit51L, ASTNode.Bit52L, ASTNode.Bit53L, ASTNode.Bit54L,
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
index 2a090dc..2aedb47 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
@@ -35,7 +35,7 @@
TokenNameCOMMENT_BLOCK = 1002,
TokenNameCOMMENT_JAVADOC = 1003;
- public final static int
+ public final static int
TokenNameIdentifier = 18,
TokenNameabstract = 47,
TokenNameassert = 78,
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.java
index 8ade205..9e97f6b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTParserClass.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -163,7 +163,7 @@
* Renamed from Parser to TheOriginalJDTParserClass
*/
@SuppressWarnings({"rawtypes", "unchecked"})
-public class TheOriginalJDTParserClass extends CommitRollbackParser implements ConflictedParser, OperatorIds, TypeIds {
+public class TheOriginalJDTParserClass implements TerminalTokens, ParserBasicInformation, ConflictedParser, OperatorIds, TypeIds {
protected static final int THIS_CALL = ExplicitConstructorCall.This;
protected static final int SUPER_CALL = ExplicitConstructorCall.Super;
@@ -239,6 +239,14 @@
METHOD_REFERENCE,
LAMBDA,
}
+
+ // resumeOnSyntaxError codes:
+ protected static final int HALT = 0; // halt and throw up hands.
+ protected static final int RESTART = 1; // stacks adjusted, alternate goal from check point.
+ protected static final int RESUME = 2; // stacks untouched, just continue from where left off.
+
+ public Scanner scanner;
+ public int currentToken;
static {
try{
@@ -955,6 +963,7 @@
protected int identifierPtr;
protected char[][] identifierStack;
protected boolean ignoreNextOpeningBrace;
+ protected boolean ignoreNextClosingBrace;
//positions , dimensions , .... (int stacks)
protected int intPtr;
@@ -1033,6 +1042,7 @@
private boolean tolerateDefaultClassMethods = false;
private boolean processingLambdaParameterList = false;
private boolean expectTypeAnnotation = false;
+private boolean reparsingLambdaExpression = false;
public TheOriginalJDTParserClass () { // AspectJ - new name
// Caveat Emptor: For inheritance purposes and then only in very special needs. Only minimal state is initialized !
@@ -1558,7 +1568,9 @@
this.lastCheckPoint = anonymousType.bodyStart = this.scanner.currentPosition;
this.currentElement = this.currentElement.add(anonymousType, 0);
this.lastIgnoredToken = -1;
- if (!isIndirectlyInsideLambdaExpression())
+ if (isIndirectlyInsideLambdaExpression())
+ this.ignoreNextOpeningBrace = true;
+ else
this.currentToken = 0; // opening brace already taken into account
return;
}
@@ -3495,7 +3507,9 @@
this.lastCheckPoint = anonymousType.bodyStart;
this.currentElement = this.currentElement.add(anonymousType, 0);
if (!(this.currentElement instanceof RecoveredAnnotation)) {
- if (!isIndirectlyInsideLambdaExpression())
+ if (isIndirectlyInsideLambdaExpression())
+ this.ignoreNextOpeningBrace = true;
+ else
this.currentToken = 0; // opening brace already taken into account
} else {
this.ignoreNextOpeningBrace = true;
@@ -3697,8 +3711,10 @@
this.currentElement = this.currentElement.add(anonymousType, 0);
this.lastCheckPoint = anonymousType.bodyStart;
this.lastIgnoredToken = -1;
- if (!isIndirectlyInsideLambdaExpression())
- this.currentToken = 0; // opening brace already taken into account
+ if (isIndirectlyInsideLambdaExpression())
+ this.ignoreNextOpeningBrace = true;
+ else
+ this.currentToken = 0; // opening brace already taken into account
} else {
if(this.currentToken == TokenNameSEMICOLON) {
RecoveredType currentType = currentRecoveryType();
@@ -4838,13 +4854,59 @@
this.variablesCounter[this.nestedType] = 0;
}
protected void consumeLocalVariableDeclarationStatement() {
+
+ int variableDeclaratorsCounter = this.astLengthStack[this.astLengthPtr];
+ if (variableDeclaratorsCounter == 1) {
+ LocalDeclaration localDeclaration = (LocalDeclaration) this.astStack[this.astPtr];
+ if (localDeclaration.isRecoveredFromLoneIdentifier()) {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=430336, [1.8][compiler] Bad syntax error recovery: Lonely identifier should be variable name, not type
+ // Mutate foo $missing; into foo = $missing$;
+ Expression left;
+ if (localDeclaration.type instanceof QualifiedTypeReference) {
+ QualifiedTypeReference qtr = (QualifiedTypeReference) localDeclaration.type;
+ left = new QualifiedNameReference(qtr.tokens, qtr.sourcePositions, 0, 0);
+ } else {
+ left = new SingleNameReference(localDeclaration.type.getLastToken(), 0L);
+ }
+ left.sourceStart = localDeclaration.type.sourceStart;
+ left.sourceEnd = localDeclaration.type.sourceEnd;
+
+ Expression right = new SingleNameReference(localDeclaration.name, 0L);
+ right.sourceStart = localDeclaration.sourceStart;
+ right.sourceEnd = localDeclaration.sourceEnd;
+
+ Assignment assignment = new Assignment(left, right, 0);
+ int end = this.endStatementPosition;
+ assignment.sourceEnd = (end == localDeclaration.sourceEnd) ? ++end : end;
+ assignment.statementEnd = end;
+ this.astStack[this.astPtr] = assignment;
+
+ // also massage recovery scanner data.
+ if (this.recoveryScanner != null) {
+ RecoveryScannerData data = this.recoveryScanner.getData();
+ int position = data.insertedTokensPtr;
+ while (position > 0) {
+ if (data.insertedTokensPosition[position] != data.insertedTokensPosition[position - 1])
+ break;
+ position--;
+ }
+ if (position >= 0)
+ this.recoveryScanner.insertTokenAhead(TerminalTokens.TokenNameEQUAL, position);
+ }
+
+ if (this.currentElement != null) {
+ this.lastCheckPoint = assignment.sourceEnd + 1;
+ this.currentElement = this.currentElement.add(assignment, 0);
+ }
+ return;
+ }
+ }
// LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';'
// see blockReal in case of change: duplicated code
// increment the amount of declared variables for this block
this.realBlockStack[this.realBlockPtr]++;
// update source end to include the semi-colon
- int variableDeclaratorsCounter = this.astLengthStack[this.astLengthPtr];
for (int i = variableDeclaratorsCounter - 1; i >= 0; i--) {
LocalDeclaration localDeclaration = (LocalDeclaration) this.astStack[this.astPtr - i];
localDeclaration.declarationSourceEnd = this.endStatementPosition;
@@ -5992,7 +6054,6 @@
protected void consumeRule(int act) {
throw new UnsupportedOperationException("Should be invoking method in Parser instead"); // AspectJ extension - subclass should be used
}
-
protected void consumeVariableDeclaratorIdParameter () {
pushOnIntStack(1); // signal "normal" variable declarator id parameter.
}
@@ -6059,6 +6120,7 @@
this.processingLambdaParameterList = false;
if (this.currentElement != null) {
this.lastCheckPoint = arrowPosition + 1; // we don't want the typed formal parameters to be processed by recovery.
+ this.currentElement.lambdaNestLevel++;
}
}
protected void consumeLambdaExpression() {
@@ -6071,9 +6133,11 @@
Statement body = (Statement) this.astStack[this.astPtr--];
if (body instanceof Block) {
if (this.options.ignoreMethodBodies) {
+ Statement oldBody = body;
body = new Block(0);
+ body.sourceStart = oldBody.sourceStart;
+ body.sourceEnd = oldBody.sourceEnd;
}
- ((Block) body).lambdaBody = true; // for consistency's sakes.
}
LambdaExpression lexp = (LambdaExpression) this.astStack[this.astPtr--];
@@ -6091,13 +6155,14 @@
pushOnExpressionStack(lexp);
if (this.currentElement != null) {
this.lastCheckPoint = body.sourceEnd + 1;
+ this.currentElement.lambdaNestLevel --;
}
this.referenceContext.compilationResult().hasFunctionalTypes = true;
markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.LAMBDA);
if (lexp.compilationResult.getCompilationUnit() == null) {
- // unit built out of model. Stash a textual representation of lambda to enable LE.copy().
- int length = lexp.sourceEnd - lexp.sourceStart + 1;
- System.arraycopy(this.scanner.getSource(), lexp.sourceStart, lexp.text = new char [length], 0, length);
+ // unit built out of model. Stash a textual representation of lambda to enable LE.copy().
+ int length = lexp.sourceEnd - lexp.sourceStart + 1;
+ System.arraycopy(this.scanner.getSource(), lexp.sourceStart, lexp.text = new char [length], 0, length);
}
}
@@ -6287,6 +6352,11 @@
if (!this.parsingJava8Plus) {
problemReporter().referenceExpressionsNotBelow18(referenceExpression);
}
+ if (referenceExpression.compilationResult.getCompilationUnit() == null) {
+ // unit built out of model. Stash a textual representation to enable RE.copy().
+ int length = referenceExpression.sourceEnd - referenceExpression.sourceStart + 1;
+ System.arraycopy(this.scanner.getSource(), referenceExpression.sourceStart, referenceExpression.text = new char [length], 0, length);
+ }
this.referenceContext.compilationResult().hasFunctionalTypes = true;
markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.METHOD_REFERENCE);
}
@@ -7077,6 +7147,7 @@
case TokenNameStringLiteral :
StringLiteral stringLiteral;
if (this.recordStringLiterals &&
+ !this.reparsingLambdaExpression &&
this.checkExternalizeStrings &&
this.lastPosistion < this.scanner.currentPosition &&
!this.statementRecoveryActivated) {
@@ -8596,6 +8667,11 @@
}
return false;
}
+
+protected void ignoreNextClosingBrace() {
+ this.ignoreNextClosingBrace = true;
+}
+
protected void ignoreExpressionAssignment() {
// Assignment ::= InvalidArrayInitializerAssignement
// encoded operator would be: this.intStack[this.intPtr]
@@ -9658,6 +9734,7 @@
public Expression parseLambdaExpression(char[] source, int offset, int length, CompilationUnitDeclaration unit, boolean recordLineSeparators) {
this.haltOnSyntaxError = true; // unexposed/unshared object, no threading concerns.
+ this.reparsingLambdaExpression = true;
return parseExpression(source, offset, length, unit, recordLineSeparators);
}
@@ -10214,6 +10291,10 @@
break;
case TokenNameRBRACE :
+ if (this.ignoreNextClosingBrace) {
+ this.ignoreNextClosingBrace = false;
+ break;
+ }
this.rBraceStart = this.scanner.startPosition - 1;
this.rBraceEnd = this.scanner.currentPosition - 1;
this.endPosition = flushCommentsDefinedPriorTo(this.rBraceEnd);
@@ -10546,9 +10627,9 @@
exp.sourceEnd = this.intStack[this.intPtr--];
exp.sourceStart = this.intStack[this.intPtr--];
}
-public void copyState(CommitRollbackParser from) {
+public void copyState(Parser from) {
- Parser parser = (Parser) from;
+ Parser parser = from;
// Stack pointers.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.java
index 6ba1e6a..4eb6487 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/TheOriginalJDTScannerClass.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -196,10 +196,10 @@
newEntry6 = 0;
public boolean insideRecovery = false;
int lookBack[] = new int[2]; // fall back to spring forward.
- private int nextToken = TokenNameNotAToken; // allows for one token push back, only the most recent token can be reliably ungotten.
+ int nextToken = TokenNameNotAToken; // allows for one token push back, only the most recent token can be reliably ungotten.
private VanguardScanner vanguardScanner;
private VanguardParser vanguardParser;
- private ConflictedParser activeParser = null;
+ ConflictedParser activeParser = null;
private boolean consumingEllipsisAnnotations = false;
public static final int RoundBracket = 0;
@@ -3602,6 +3602,12 @@
throw new InvalidInputException(INVALID_HEXA);
}
} else if (getNextChar('p', 'P') >= 0) { // consume next character
+ if (end == start) { // Has no digits before exponent
+ if (this.sourceLevel < ClassFileConstants.JDK1_5) {
+ throw new InvalidInputException(ILLEGAL_HEXA_LITERAL);
+ }
+ throw new InvalidInputException(INVALID_HEXA);
+ }
this.unicodeAsBackSlash = false;
if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
&& (this.source[this.currentPosition] == 'u')) {
@@ -4222,9 +4228,19 @@
}
public int getNextToken() throws InvalidInputException {
- int token = getNextToken0();
+ int token;
+ if (this.nextToken != TokenNameNotAToken) {
+ token = this.nextToken;
+ this.nextToken = TokenNameNotAToken;
+ return token; // presumed to be unambiguous.
+ }
+ token = getNextToken0();
if (token == TokenNameAT && atTypeAnnotation()) {
- token = TokenNameAT308;
+ if (((VanguardParser) this.activeParser).currentGoal == Goal.LambdaParameterListGoal) {
+ token = disambiguatedToken(token);
+ } else {
+ token = TokenNameAT308;
+ }
}
return token == TokenNameEOF ? TokenNameNotAToken : token;
}
@@ -4312,12 +4328,15 @@
public static final boolean SUCCESS = true;
public static final boolean FAILURE = false;
+ Goal currentGoal;
+
public VanguardParser(VanguardScanner scanner) {
this.scanner = scanner;
}
// Canonical LALR pushdown automaton identical to Parser.parse() minus side effects of any kind, returns the rule reduced.
protected boolean parse(Goal goal) {
+ this.currentGoal = goal;
try {
int act = START_STATE;
this.stateStackTop = -1;
@@ -4473,7 +4492,7 @@
this.activeParser = parser;
this.lookBack[0] = this.lookBack[1] = TokenNameNotAToken; // no hand me downs please.
}
-private int disambiguatedToken(int token) {
+int disambiguatedToken(int token) {
final VanguardParser parser = getVanguardParser();
if (token == TokenNameLPAREN && maybeAtLambdaOrCast()) {
if (parser.parse(Goal.LambdaParameterListGoal) == VanguardParser.SUCCESS) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
index 406b957..56f46a0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -436,34 +436,7 @@
for (int i = start; i < end; i++) {
char c = tokenSource[i];
- switch (c) {
- case '\r' :
- tokenSourceBuffer.append("\\r"); //$NON-NLS-1$
- break;
- case '\n' :
- tokenSourceBuffer.append("\\n"); //$NON-NLS-1$
- break;
- case '\b' :
- tokenSourceBuffer.append("\\b"); //$NON-NLS-1$
- break;
- case '\t' :
- tokenSourceBuffer.append("\t"); //$NON-NLS-1$
- break;
- case '\f' :
- tokenSourceBuffer.append("\\f"); //$NON-NLS-1$
- break;
- case '\"' :
- tokenSourceBuffer.append("\\\""); //$NON-NLS-1$
- break;
- case '\'' :
- tokenSourceBuffer.append("\\'"); //$NON-NLS-1$
- break;
- case '\\' :
- tokenSourceBuffer.append("\\\\"); //$NON-NLS-1$
- break;
- default :
- tokenSourceBuffer.append(c);
- }
+ Util.appendEscapedChar(tokenSourceBuffer, c, true);
}
for (int i = end; i < tokenSource.length; i++) {
tokenSourceBuffer.append(tokenSource[i]);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
index 35ff8d05..fc2f483 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
index 31091df..72150db 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
index 9586c4a..e65e729 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
index a2405da..c71fcca 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
index c93b080..c826c26 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
index c287cad..2e822a9 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
index cc8990c..54dd5b1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
index 687bd27..26cb4cc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
index b0fdf76..4c106ba 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
index 297858e..2460c79 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
index 8caf5a7..d57c580 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
index d34b764..fbfdb5c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
index dab1c01..9fbbacf 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
index c74948a..447a60f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
index 7e6c951..4c5f7e1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
index 565a167..83c1da0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
index 9c7914f..c394f36 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
Binary files differ
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
index 4993cac..2a60dbc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 458396 - NPE in CodeStream.invoke()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.problem;
@@ -38,6 +40,9 @@
public IErrorHandlingPolicy policy;
public final IProblemFactory problemFactory;
public final CompilerOptions options;
+
+ /* When temporarily switching policies, store here the original root policy (for temporary resume). */
+ private IErrorHandlingPolicy rootPolicy;
/*
* Problem handler can be supplied with a policy to specify
* its behavior in error handling. Also see static methods for
@@ -120,6 +125,15 @@
boolean mandatory = (severity & (ProblemSeverities.Error | ProblemSeverities.Optional)) == ProblemSeverities.Error;
if (severity < ProblemSeverities.InternalError && this.policy.ignoreAllErrors()) {
// Error is not to be exposed, but clients may need still notification as to whether there are silently-ignored-errors.
+ // if no reference context, we need to abort from the current compilation process
+ if (referenceContext == null) {
+ if ((severity & ProblemSeverities.Error) != 0) { // non reportable error is fatal
+ CategorizedProblem problem = this.createProblem(null, problemId, problemArguments, elaborationId, messageArguments, severity, 0, 0, 0, 0);
+ throw new AbortCompilation(null, problem);
+ } else {
+ return; // ignore non reportable warning
+ }
+ }
if (mandatory)
referenceContext.tagAsHavingIgnoredMandatoryErrors(problemId);
return;
@@ -221,8 +235,27 @@
}
/** @return old policy. */
public IErrorHandlingPolicy switchErrorHandlingPolicy(IErrorHandlingPolicy newPolicy) {
+ if (this.rootPolicy == null)
+ this.rootPolicy = this.policy;
IErrorHandlingPolicy presentPolicy = this.policy;
this.policy = newPolicy;
return presentPolicy;
}
+/**
+ * Temporarily suspend a temporary error handling policy.
+ * @return old policy.
+ */
+public IErrorHandlingPolicy suspendTempErrorHandlingPolicy() {
+ IErrorHandlingPolicy presentPolicy = this.policy;
+ if (this.rootPolicy != null)
+ this.policy = this.rootPolicy;
+ return presentPolicy;
+}
+/**
+ * Resume from a corresponding {@link #suspendTempErrorHandlingPolicy()}.
+ * @param previousPolicy the result value of the matching suspend call
+ */
+public void resumeTempErrorHandlingPolicy(IErrorHandlingPolicy previousPolicy) {
+ this.policy = previousPolicy;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index bca665d..7513132 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -53,6 +53,12 @@
* Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
* Bug 438467 - [compiler][null] Better error position for "The method _ cannot implement the corresponding method _ due to incompatible nullness constraints"
* Bug 439298 - [null] "Missing code implementation in the compiler" when using @NonNullByDefault in package-info.java
+ * Bug 435805 - [1.8][compiler][null] Java 8 compiler does not recognize declaration style null annotations
+ * Bug 446442 - [1.8] merge null annotations from super methods
+ * Bug 455723 - Nonnull argument not correctly inferred in loop
+ * Bug 458361 - [1.8][null] reconciler throws NPE in ProblemReporter.illegalReturnRedefinition()
+ * Bug 459967 - [null] compiler should know about nullness of special methods like MyEnum.valueOf()
+ * Bug 461878 - [1.7][1.8][compiler][null] ECJ compiler does not allow to use null annotations on annotations
* Jesper S Moller <jesper@selskabet.org> - Contributions for
* bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
* bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
@@ -62,6 +68,8 @@
* bug 419209 - [1.8] Repeating container annotations should be rejected in the presence of annotation it contains
* Bug 429384 - [1.8][null] implement conformance rules for null-annotated lower / upper type bounds
* Bug 416182 - [1.8][compiler][null] Contradictory null annotations not rejected
+ * Ulrich Grave <ulrich.grave@gmx.de> - Contributions for
+ * bug 386692 - Missing "unused" warning on "autowired" fields
********************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.compiler.problem;
@@ -150,7 +158,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CaptureBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
@@ -229,9 +236,11 @@
return CompilerOptions.UnusedLocalVariable;
case IProblem.ArgumentIsNeverUsed :
- case IProblem.ExceptionParameterIsNeverUsed:
return CompilerOptions.UnusedArgument;
+ case IProblem.ExceptionParameterIsNeverUsed :
+ return CompilerOptions.UnusedExceptionParameter;
+
case IProblem.NoImplicitStringConversionForCharArrayExpression :
return CompilerOptions.NoImplicitStringConversion;
@@ -394,6 +403,7 @@
case IProblem.RequiredNonNullButProvidedNull:
case IProblem.RequiredNonNullButProvidedSpecdNullable:
case IProblem.IllegalReturnNullityRedefinition:
+ case IProblem.IllegalReturnNullityRedefinitionFreeTypeVariable:
case IProblem.IllegalRedefinitionToNonNullParameter:
case IProblem.IllegalDefinitionToNonNullParameter:
case IProblem.ParameterLackingNullableAnnotation:
@@ -409,6 +419,10 @@
case IProblem.UninitializedNonNullFieldHintMissingDefault:
case IProblem.ReferenceExpressionParameterNullityMismatch:
case IProblem.ReferenceExpressionReturnNullRedef:
+ case IProblem.ContradictoryNullAnnotations:
+ case IProblem.ContradictoryNullAnnotationsOnBound:
+ case IProblem.ContradictoryNullAnnotationsInferred:
+ case IProblem.ContradictoryNullAnnotationsInferredFunctionType:
return CompilerOptions.NullSpecViolation;
case IProblem.ParameterLackingNonNullAnnotation:
@@ -653,6 +667,7 @@
case CompilerOptions.UnusedLocalVariable :
case CompilerOptions.UnusedArgument :
+ case CompilerOptions.UnusedExceptionParameter :
case CompilerOptions.UnusedImport :
case CompilerOptions.UnusedPrivateMember :
case CompilerOptions.UnusedDeclaredThrownException :
@@ -1568,8 +1583,6 @@
return ProblemSeverities.Warning;
case IProblem.IllegalUseOfUnderscoreAsAnIdentifier:
return this.underScoreIsLambdaParameter ? ProblemSeverities.Error : ProblemSeverities.Warning;
- case IProblem.LambdaShapeComputationError:
- return ProblemSeverities.InternalError;
}
int irritant = getIrritant(problemID);
if (irritant != 0) {
@@ -2209,13 +2222,13 @@
nodeSourceEnd(hiddenField, fieldDecl));
}
}
-public void fieldsOrThisBeforeConstructorInvocation(ThisReference reference) {
+public void fieldsOrThisBeforeConstructorInvocation(ASTNode reference) {
this.handle(
IProblem.ThisSuperDuringConstructorInvocation,
NoArgument,
NoArgument,
reference.sourceStart,
- reference.sourceEnd);
+ reference instanceof LambdaExpression ? ((LambdaExpression) reference).diagnosticsSourceEnd() : reference.sourceEnd);
}
public void finallyMustCompleteNormally(Block finallyBlock) {
this.handle(
@@ -3699,7 +3712,8 @@
sourceStart,
sourceEnd);
return;
- case ProblemReasons.ParameterizedMethodExpectedTypeProblem:
+ case ProblemReasons.InferredApplicableMethodInapplicable:
+ case ProblemReasons.InvocationTypeInferenceFailure:
// FIXME(stephan): construct suitable message (https://bugs.eclipse.org/404675)
problemConstructor = (ProblemMethodBinding) targetConstructor;
shownConstructor = problemConstructor.closestMatch;
@@ -3821,6 +3835,9 @@
case ProblemReasons.Ambiguous :
id = IProblem.AmbiguousField;
break;
+ case ProblemReasons.NoProperEnclosingInstance:
+ noSuchEnclosingInstance(fieldRef.actualReceiverType, fieldRef.receiver, false);
+ return;
case ProblemReasons.NonStaticReferenceInStaticContext :
id = IProblem.NonStaticFieldFromStaticInvocation;
break;
@@ -4025,12 +4042,14 @@
annotation.sourceEnd);
}
-public void invalidMethod(MessageSend messageSend, MethodBinding method) {
+public void invalidMethod(MessageSend messageSend, MethodBinding method, Scope scope) {
if (isRecoveredName(messageSend.selector)) return;
int id = IProblem.UndefinedMethod; //default...
MethodBinding shownMethod = method;
switch (method.problemId()) {
+ case ProblemReasons.NoSuchMethodOnArray :
+ return; // secondary error.
case ProblemReasons.NotFound :
if ((method.declaringClass.tagBits & TagBits.HasMissingType) != 0) {
this.handle(
@@ -4229,23 +4248,21 @@
(int) (messageSend.nameSourcePosition >>> 32),
(int) messageSend.nameSourcePosition);
return;
- case ProblemReasons.ParameterizedMethodExpectedTypeProblem:
+ case ProblemReasons.InferredApplicableMethodInapplicable:
+ case ProblemReasons.InvocationTypeInferenceFailure:
// FIXME(stephan): construct suitable message (https://bugs.eclipse.org/404675)
problemMethod = (ProblemMethodBinding) method;
- InferenceContext18 inferenceContext = problemMethod.inferenceContext;
- if (inferenceContext != null && inferenceContext.outerContext != null) {
- // problem relates to a nested inference context, let the outer handle it:
- inferenceContext.outerContext.addProblemMethod(problemMethod);
- return;
- }
shownMethod = problemMethod.closestMatch;
+ if (problemMethod.returnType == shownMethod.returnType) //$IDENTITY-COMPARISON$
+ return; // funnily this can happen in a deeply nested call, because the inner lies by stealing its closest match and the outer does not know so. See GRT1_8.testBug430296
+ TypeBinding shownMethodReturnType = shownMethod.returnType.capture(scope, messageSend.sourceStart, messageSend.sourceEnd);
this.handle(
IProblem.TypeMismatch,
new String[] {
- String.valueOf(shownMethod.returnType.readableName()),
+ String.valueOf(shownMethodReturnType.readableName()),
(problemMethod.returnType != null ? String.valueOf(problemMethod.returnType.readableName()) : "<unknown>")}, //$NON-NLS-1$
new String[] {
- String.valueOf(shownMethod.returnType.shortReadableName()),
+ String.valueOf(shownMethodReturnType.shortReadableName()),
(problemMethod.returnType != null ? String.valueOf(problemMethod.returnType.shortReadableName()) : "<unknown>")}, //$NON-NLS-1$
messageSend.sourceStart,
messageSend.sourceEnd);
@@ -4295,7 +4312,7 @@
return;
case ProblemReasons.ContradictoryNullAnnotations:
problemMethod = (ProblemMethodBinding) method;
- contradictoryNullAnnotationsInferred(problemMethod.closestMatch, (ASTNode)messageSend);
+ contradictoryNullAnnotationsInferred(problemMethod.closestMatch, messageSend);
return;
case ProblemReasons.NoError : // 0
default :
@@ -4670,6 +4687,10 @@
last.sourceEnd);
}
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) {
+ // ProblemReporter is not designed to be reentrant. Just in case, we discovered a build path problem while we are already
+ // in the midst of reporting some other problem, save and restore reference context thereby mimicking a stack.
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=442755.
+ ReferenceContext savedContext = this.referenceContext;
this.referenceContext = compUnitDecl;
String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)};
int start = 0, end = 0;
@@ -4684,12 +4705,16 @@
end = node.sourceEnd();
}
}
+ try {
this.handle(
IProblem.IsClassPathCorrect,
arguments,
arguments,
start,
end);
+ } finally {
+ this.referenceContext = savedContext;
+}
}
private boolean isIdentifier(int token) {
return token == TerminalTokens.TokenNameIdentifier;
@@ -5769,8 +5794,15 @@
String[] shortArguments = new String[] {
String.valueOf(annotation.resolvedType.shortReadableName())
};
+ int severity = ProblemSeverities.Error | ProblemSeverities.Fatal;
+ if (annotation.recipient instanceof ReferenceBinding) {
+ if (((ReferenceBinding) annotation.recipient).isAnnotationType())
+ severity = ProblemSeverities.Warning; // special case for https://bugs.eclipse.org/461878
+ }
handle(IProblem.NullAnnotationUnsupportedLocation,
- arguments, shortArguments, annotation.sourceStart, annotation.sourceEnd);
+ arguments, shortArguments,
+ severity,
+ annotation.sourceStart, annotation.sourceEnd);
}
public void nullAnnotationUnsupportedLocation(TypeReference type) {
int sourceEnd = type.sourceEnd;
@@ -6596,7 +6628,7 @@
new String[] { new String(targetType.readableName())},
new String[] { new String(targetType.shortReadableName())},
location.sourceStart,
- location.sourceEnd);
+ location instanceof LambdaExpression ? ((LambdaExpression)location).diagnosticsSourceEnd() : location.sourceEnd);
}
public void notCompatibleTypesError(EqualExpression expression, TypeBinding leftType, TypeBinding rightType) {
String leftName = new String(leftType.readableName());
@@ -8754,6 +8786,7 @@
break;
case TypeIds.T_JavaxInjectInject:
case TypeIds.T_ComGoogleInjectInject:
+ case TypeIds.T_OrgSpringframeworkBeansFactoryAnnotationAutowired:
if (problemId != IProblem.UnusedPrivateField)
return true; // @Inject on method/ctor does constitute a relevant use, just on fields it doesn't
break;
@@ -9192,15 +9225,15 @@
nullityMismatchPotentiallyNull(expression, requiredType, annotationName);
return;
}
- if (this.options.sourceLevel < ClassFileConstants.JDK1_8)
- nullityMismatchIsUnknown(expression, providedType, requiredType, annotationName);
- else
+ if (this.options.usesNullTypeAnnotations())
nullityMismatchingTypeAnnotation(expression, providedType, requiredType, NullAnnotationMatching.NULL_ANNOTATIONS_UNCHECKED);
+ else
+ nullityMismatchIsUnknown(expression, providedType, requiredType, annotationName);
}
public void nullityMismatchIsNull(Expression expression, TypeBinding requiredType) {
int problemId = IProblem.RequiredNonNullButProvidedNull;
- boolean below18 = this.options.sourceLevel < ClassFileConstants.JDK1_8;
- if (!below18 && requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations())
+ boolean useNullTypeAnnotations = this.options.usesNullTypeAnnotations();
+ if (useNullTypeAnnotations && requiredType.isTypeVariable() && !requiredType.hasNullTypeAnnotations())
problemId = IProblem.NullNotCompatibleToFreeTypeVariable;
if (requiredType instanceof CaptureBinding) {
CaptureBinding capture = (CaptureBinding) requiredType;
@@ -9209,7 +9242,7 @@
}
String[] arguments;
String[] argumentsShort;
- if (below18) {
+ if (!useNullTypeAnnotations) {
arguments = new String[] { annotatedTypeName(requiredType, this.options.nonNullAnnotationName) };
argumentsShort = new String[] { shortAnnotatedTypeName(requiredType, this.options.nonNullAnnotationName) };
} else {
@@ -9234,6 +9267,11 @@
shortAnnotatedTypeName(requiredType, annotationName),
String.valueOf(nullableName[nullableName.length-1])
};
+ if (expression.resolvedType != null && expression.resolvedType.hasNullTypeAnnotations()) {
+ problemId = IProblem.NullityMismatchingTypeAnnotation;
+ arguments[1] = String.valueOf(expression.resolvedType.nullAnnotatedReadableName(this.options, false));
+ argumentsShort[1] = String.valueOf(expression.resolvedType.nullAnnotatedReadableName(this.options, true));
+ }
this.handle(problemId, arguments, argumentsShort, expression.sourceStart, expression.sourceEnd);
}
public void nullityMismatchPotentiallyNull(Expression expression, TypeBinding requiredType, char[][] annotationName) {
@@ -9355,26 +9393,32 @@
sourceStart = annotation.sourceStart;
}
TypeBinding inheritedReturnType = inheritedMethod.returnType;
- String[] arguments;
- String[] argumentsShort;
- if (this.options.complianceLevel < ClassFileConstants.JDK1_8) {
+ int problemId = IProblem.IllegalReturnNullityRedefinition;
StringBuilder returnType = new StringBuilder();
+ StringBuilder returnTypeShort = new StringBuilder();
+ if (this.options.usesNullTypeAnnotations()) {
+ // 1.8+
+ if (inheritedReturnType.isTypeVariable() && (inheritedReturnType.tagBits & TagBits.AnnotationNullMASK) == 0) {
+ problemId = IProblem.IllegalReturnNullityRedefinitionFreeTypeVariable;
+
+ returnType.append(inheritedReturnType.readableName());
+ returnTypeShort.append(inheritedReturnType.shortReadableName());
+ } else {
+ returnType.append(inheritedReturnType.nullAnnotatedReadableName(this.options, false));
+ returnTypeShort.append(inheritedReturnType.nullAnnotatedReadableName(this.options, true));
+ }
+ } else {
+ // 1.7-
returnType.append('@').append(CharOperation.concatWith(nonNullAnnotationName, '.'));
returnType.append(' ').append(inheritedReturnType.readableName());
- arguments = new String[] { methodSignature.toString(), returnType.toString() };
- returnType = new StringBuilder();
- returnType.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]);
- returnType.append(' ').append(inheritedReturnType.shortReadableName());
- argumentsShort = new String[] { shortSignature.toString(), returnType.toString() };
- } else {
- arguments = new String[] { methodSignature.toString(),
- String.valueOf(inheritedReturnType.nullAnnotatedReadableName(this.options, false))};
- argumentsShort = new String[] { shortSignature.toString(),
- String.valueOf(inheritedReturnType.nullAnnotatedReadableName(this.options, true))};
+ returnTypeShort.append('@').append(nonNullAnnotationName[nonNullAnnotationName.length-1]);
+ returnTypeShort.append(' ').append(inheritedReturnType.shortReadableName());
}
+ String[] arguments = new String[] { methodSignature.toString(), returnType.toString() };
+ String[] argumentsShort = new String[] { shortSignature.toString(), returnTypeShort.toString() };
this.handle(
- IProblem.IllegalReturnNullityRedefinition,
+ problemId,
arguments,
argumentsShort,
sourceStart,
@@ -9406,8 +9450,7 @@
location.sourceEnd);
}
public void illegalReturnRedefinition(ASTNode location, MethodBinding descriptorMethod,
- char[][] nonNullAnnotationName,
- char/*@Nullable*/[][] providedAnnotationName, TypeBinding providedType) {
+ boolean isUnchecked, TypeBinding providedType) {
StringBuffer methodSignature = new StringBuffer()
.append(descriptorMethod.declaringClass.readableName())
.append('.')
@@ -9416,22 +9459,16 @@
.append(descriptorMethod.declaringClass.shortReadableName())
.append('.')
.append(descriptorMethod.shortReadableName());
- StringBuffer providedPrefix = new StringBuffer();
- StringBuffer providedShortPrefix = new StringBuffer();
- if (providedAnnotationName != null) {
- providedPrefix.append('@').append(CharOperation.toString(providedAnnotationName)).append(' ');
- providedShortPrefix.append('@').append(providedAnnotationName[providedAnnotationName.length-1]).append(' ');
- }
this.handle(
- providedAnnotationName == null
+ isUnchecked
? IProblem.ReferenceExpressionReturnNullRedefUnchecked
: IProblem.ReferenceExpressionReturnNullRedef,
new String[] { methodSignature.toString(),
- CharOperation.toString(nonNullAnnotationName), String.valueOf(descriptorMethod.returnType.readableName()),
- providedPrefix.toString(), String.valueOf(providedType.readableName())},
+ String.valueOf(descriptorMethod.returnType.nullAnnotatedReadableName(this.options, false)),
+ String.valueOf(providedType.nullAnnotatedReadableName(this.options, false))},
new String[] { shortSignature.toString(),
- String.valueOf(nonNullAnnotationName[nonNullAnnotationName.length-1]), String.valueOf(descriptorMethod.returnType.shortReadableName()),
- providedShortPrefix.toString(), String.valueOf(providedType.shortReadableName())},
+ String.valueOf(descriptorMethod.returnType.nullAnnotatedReadableName(this.options, true)),
+ String.valueOf(providedType.nullAnnotatedReadableName(this.options, true))},
location.sourceStart,
location.sourceEnd);
}
@@ -9569,12 +9606,9 @@
}
public void contradictoryNullAnnotationsInferred(MethodBinding inferredMethod, ASTNode location) {
- contradictoryNullAnnotationsInferred(inferredMethod, location.sourceStart, location.sourceEnd);
+ contradictoryNullAnnotationsInferred(inferredMethod, location.sourceStart, location.sourceEnd, false);
}
-public void contradictoryNullAnnotationsInferred(MethodBinding inferredMethod, InvocationSite location) {
- contradictoryNullAnnotationsInferred(inferredMethod, location.sourceStart(), location.sourceEnd());
-}
-public void contradictoryNullAnnotationsInferred(MethodBinding inferredMethod, int sourceStart, int sourceEnd) {
+public void contradictoryNullAnnotationsInferred(MethodBinding inferredMethod, int sourceStart, int sourceEnd, boolean isFunctionalExpression) {
// when this error is triggered we can safely assume that both annotations have been configured
char[][] nonNullAnnotationName = this.options.nonNullAnnotationName;
char[][] nullableAnnotationName = this.options.nullableAnnotationName;
@@ -9592,7 +9626,9 @@
new String(inferredMethod.selector),
typesAsString(inferredMethod, true, true)
};
- this.handle(IProblem.ContradictoryNullAnnotationsInferred, arguments, shortArguments, sourceStart, sourceEnd);
+ this.handle(
+ isFunctionalExpression ? IProblem.ContradictoryNullAnnotationsInferredFunctionType : IProblem.ContradictoryNullAnnotationsInferred,
+ arguments, shortArguments, sourceStart, sourceEnd);
}
public void contradictoryNullAnnotationsOnBounds(Annotation annotation, long previousTagBit) {
@@ -9783,17 +9819,26 @@
}
public void nullityMismatchingTypeAnnotation(Expression expression, TypeBinding providedType, TypeBinding requiredType, NullAnnotationMatching status)
{
- if (providedType.id == TypeIds.T_null) {
+ // try to improve nonnull vs. null:
+ if (providedType.id == TypeIds.T_null || status.nullStatus == FlowInfo.NULL) {
nullityMismatchIsNull(expression, requiredType);
return;
}
+ // try to improve nonnull vs. nullable:
+ if (status.isPotentiallyNullMismatch()
+ && (requiredType.tagBits & TagBits.AnnotationNonNull) != 0
+ && (providedType.tagBits & TagBits.AnnotationNullable) == 0)
+ {
+ nullityMismatchPotentiallyNull(expression, requiredType, this.options.nonNullAnnotationName);
+ return;
+ }
String[] arguments ;
String[] shortArguments;
int problemId = 0;
String superHint = null;
String superHintShort = null;
- if (status.superTypeHint != null) {
+ if (status.superTypeHint != null && requiredType.isParameterizedType()) {
problemId = (status.isUnchecked()
? IProblem.NullityUncheckedTypeAnnotationDetailSuperHint
: IProblem.NullityMismatchingTypeAnnotationSuperHint);
@@ -10217,13 +10262,10 @@
expr.sourceStart,
expr.sourceEnd);
}
-
-public void lambdaShapeComputationError(LambdaExpression expression) {
- this.handle(
- IProblem.LambdaShapeComputationError,
- NoArgument,
- NoArgument,
- expression.sourceStart,
- expression.diagnosticsSourceEnd());
+public void invalidTypeArguments(TypeReference[] typeReference) {
+ this.handle(IProblem.InvalidTypeArguments,
+ NoArgument, NoArgument,
+ typeReference[0].sourceStart,
+ typeReference[typeReference.length - 1].sourceEnd);
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties
index 11c0127..e592117 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -41,6 +41,7 @@
# Bug 434600 - Incorrect null analysis error reporting on type parameters
# Bug 439516 - [1.8][null] NonNullByDefault wrongly applied to implicit type bound of binary type
# Bug 438467 - [compiler][null] Better error position for "The method _ cannot implement the corresponding method _ due to incompatible nullness constraints"
+# Bug 458361 - [1.8][null] reconciler throws NPE in ProblemReporter.illegalReturnRedefinition()
# Jesper S Moller <jesper@selskabet.org> - Contributions for
# bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
# bug 384567 - [1.5][compiler] Compiler accepts illegal modifiers on package declaration
@@ -571,6 +572,7 @@
579 = Unused type arguments for the non generic method {0}({1}) of type {2}; it should not be parameterized with arguments <{3}>
583 = Duplicate methods named {0} with the parameters ({1}) and ({2}) are inherited from the types {3} and {4}
584 = Name clash: The method {0}({1}) of type {2} has the same erasure as {0}({3}) of type {4} but does not hide it
+586 = Type arguments are not allowed here
### FOREACH
580 = Type mismatch: cannot convert from element type {0} to {1}
@@ -817,8 +819,8 @@
956 = Null type safety (type annotations): The expression of type ''{1}'' needs unchecked conversion to conform to ''{0}'', corresponding supertype is ''{2}''
957 = Null type mismatch at parameter {0}: required ''{1}'' but provided ''{2}'' via method descriptor {3}
958 = Null type safety: parameter {0} provided via method descriptor {3} needs unchecked conversion to conform to ''{1}''
-959 = Null type mismatch at method return type: Method descriptor {0} promises ''@{1} {2}'' but referenced method provides ''{3}{4}''
-960 = Null type safety at method return type: Method descriptor {0} promises ''@{1} {2}'' but referenced method provides ''{3}{4}''
+959 = Null type mismatch at method return type: Method descriptor {0} promises ''{1}'' but referenced method provides ''{2}''
+960 = Null type safety at method return type: Method descriptor {0} promises ''{1}'' but referenced method provides ''{2}''
961 = Redundant null check: comparing ''{0}'' against null
962 = The nullness annotation ''{0}'' is not applicable at this location
963 = Nullness annotations are not applicable at this location
@@ -831,6 +833,8 @@
970 = Null type mismatch (type annotations): required ''{0}'' but this expression has type ''{1}'', where ''{0}'' is a free type variable
971 = The explicit type bound 'Object' is not affected by the nullness default for DefaultLocation.TYPE_BOUND.
972 = Illegal redefinition of parameter {0}, inherited method from {1} declares this parameter as ''{2}'' (mismatching null constraints)
+973 = Contradictory null annotations: function type was inferred as ''{2} ({4})'', but only one of ''@{0}'' and ''@{1}'' can be effective at any location
+974 = The return type is incompatible with the free type variable ''{1}'' returned from {0} (mismatching null constraints)
# Java 8
1001 = Syntax error, modifiers and annotations are not allowed for the lambda parameter {0} as its type is elided
@@ -850,7 +854,6 @@
1058 = Default methods are allowed only in interfaces.
1100 = Problem detected during type inference: {0}
-1101 = (Recovered) Internal inconsistency detected during lambda shape analysis
### ELABORATIONS
## Access restrictions
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.java
index 7e9aeb9..432ca87 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/compiler/util/Util.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,6 +24,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.StringTokenizer;
@@ -677,7 +678,7 @@
}
/**
* Returns the contents of the given zip entry as a byte array.
- * @throws IOException if a problem occured reading the zip entry.
+ * @throws IOException if a problem occurred reading the zip entry.
*/
public static byte[] getZipEntryByteContent(ZipEntry ze, ZipFile zip)
throws IOException {
@@ -1083,7 +1084,14 @@
}
}
} else if (typeBinding.isNestedType()) {
- classFile.recordInnerClasses(typeBinding);
+ TypeBinding enclosingType = typeBinding;
+ do {
+ if (!enclosingType.canBeSeenBy(classFile.referenceBinding.scope))
+ break;
+ enclosingType = enclosingType.enclosingType();
+ } while (enclosingType != null);
+ boolean onBottomForBug445231 = enclosingType != null;
+ classFile.recordInnerClasses(typeBinding, onBottomForBug445231);
}
}
/*
@@ -1101,6 +1109,15 @@
}
public static void collectRunningVMBootclasspath(List bootclasspaths) {
+ for (String filePath : collectFilesNames()) {
+ FileSystem.Classpath currentClasspath = FileSystem.getClasspath(filePath, null, null);
+ if (currentClasspath != null) {
+ bootclasspaths.add(currentClasspath);
+ }
+ }
+ }
+
+ public static List<String> collectFilesNames() {
/* no bootclasspath specified
* we can try to retrieve the default librairies of the VM used to run
* the batch compiler
@@ -1123,15 +1140,11 @@
bootclasspathProperty = System.getProperty("org.apache.harmony.boot.class.path"); //$NON-NLS-1$
}
}
+ List<String> filePaths = new ArrayList<>();
if ((bootclasspathProperty != null) && (bootclasspathProperty.length() != 0)) {
StringTokenizer tokenizer = new StringTokenizer(bootclasspathProperty, File.pathSeparator);
- String token;
while (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- FileSystem.Classpath currentClasspath = FileSystem.getClasspath(token, null, null);
- if (currentClasspath != null) {
- bootclasspaths.add(currentClasspath);
- }
+ filePaths.add(tokenizer.nextToken());
}
} else {
// try to get all jars inside the lib folder of the java home
@@ -1154,18 +1167,14 @@
File[] current = systemLibrariesJars[i];
if (current != null) {
for (int j = 0, max2 = current.length; j < max2; j++) {
- FileSystem.Classpath classpath =
- FileSystem.getClasspath(current[j].getAbsolutePath(),
- null, false, null, null);
- if (classpath != null) {
- bootclasspaths.add(classpath);
- }
+ filePaths.add(current[j].getAbsolutePath());
}
}
}
}
}
}
+ return filePaths;
}
public static int getParameterCount(char[] methodSignature) {
try {
@@ -1588,4 +1597,52 @@
}
return true;
}
+
+ public static void appendEscapedChar(StringBuffer buffer, char c, boolean stringLiteral) {
+ switch (c) {
+ case '\b' :
+ buffer.append("\\b"); //$NON-NLS-1$
+ break;
+ case '\t' :
+ buffer.append("\\t"); //$NON-NLS-1$
+ break;
+ case '\n' :
+ buffer.append("\\n"); //$NON-NLS-1$
+ break;
+ case '\f' :
+ buffer.append("\\f"); //$NON-NLS-1$
+ break;
+ case '\r' :
+ buffer.append("\\r"); //$NON-NLS-1$
+ break;
+ case '\"':
+ if (stringLiteral) {
+ buffer.append("\\\""); //$NON-NLS-1$
+ } else {
+ buffer.append(c);
+ }
+ break;
+ case '\'':
+ if (stringLiteral) {
+ buffer.append(c);
+ } else {
+ buffer.append("\\\'"); //$NON-NLS-1$
+ }
+ break;
+ case '\\':
+ buffer.append("\\\\"); //$NON-NLS-1$
+ break;
+ default:
+ if (c >= 0x20) {
+ buffer.append(c);
+ } else if (c >= 0x10) {
+ buffer.append("\\u00").append(Integer.toHexString(c)); //$NON-NLS-1$
+ } else if (c >= 0) {
+ buffer.append("\\u000").append(Integer.toHexString(c)); //$NON-NLS-1$
+ } else {
+ buffer.append(c);
+ }
+ }
+ }
+
}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.java
index 037c94d..9650b9d 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/BecomeWorkingCopyOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,12 +7,13 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 458577 - IClassFile.getWorkingCopy() may lead to NPE in BecomeWorkingCopyOperation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
+import org.eclipse.core.resources.IResource;
import org.aspectj.org.eclipse.jdt.core.*;
-import org.aspectj.org.eclipse.jdt.core.IJavaElement;
-import org.aspectj.org.eclipse.jdt.core.JavaModelException;
/**
* Switch and ICompilationUnit to working copy mode
@@ -43,16 +44,19 @@
delta.added(workingCopy);
addDelta(delta);
} else {
- if (workingCopy.getResource().isAccessible()) {
- // report a F_PRIMARY_WORKING_COPY change delta for a primary working copy
- JavaElementDelta delta = new JavaElementDelta(getJavaModel());
- delta.changed(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
- addDelta(delta);
- } else {
- // report an ADDED delta
- JavaElementDelta delta = new JavaElementDelta(getJavaModel());
- delta.added(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
- addDelta(delta);
+ IResource resource = workingCopy.getResource();
+ if (resource != null) {
+ if (resource.isAccessible()) {
+ // report a F_PRIMARY_WORKING_COPY change delta for a primary working copy
+ JavaElementDelta delta = new JavaElementDelta(getJavaModel());
+ delta.changed(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
+ addDelta(delta);
+ } else {
+ // report an ADDED delta
+ JavaElementDelta delta = new JavaElementDelta(getJavaModel());
+ delta.added(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
+ addDelta(delta);
+ }
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.java
index c4fdba4..c6d6b62 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClassFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,10 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 458577 - IClassFile.getWorkingCopy() may lead to NPE in BecomeWorkingCopyOperation
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
+ * Bug 462768 - [null] NPE when using linked folder for external annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -19,12 +23,15 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.aspectj.org.eclipse.jdt.core.*;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
@@ -45,6 +52,8 @@
protected String name;
protected BinaryType binaryType = null;
+ private IPath externalAnnotationBase;
+
/*
* Creates a handle to a class file.
*/
@@ -199,7 +208,8 @@
// if parent is open, this class file must be in its children
IJavaElement[] children = parentInfo.getChildren();
for (int i = 0, length = children.length; i < length; i++) {
- if (this.name.equals(((ClassFile) children[i]).name))
+ IJavaElement child = children[i];
+ if (child instanceof ClassFile && this.name.equals(((ClassFile) child).name))
return true;
}
return false;
@@ -340,6 +350,7 @@
private IBinaryType getJarBinaryTypeInfo(PackageFragment pkg, boolean fullyInitialize) throws CoreException, IOException, ClassFormatException {
JarPackageFragmentRoot root = (JarPackageFragmentRoot) pkg.getParent();
ZipFile zip = null;
+ ZipFile annotationZip = null;
try {
zip = root.getJar();
String entryName = Util.concatWith(pkg.names, getElementName(), '/');
@@ -347,13 +358,81 @@
if (ze != null) {
byte contents[] = org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(ze, zip);
String fileName = root.getHandleIdentifier() + IDependent.JAR_FILE_ENTRY_SEPARATOR + entryName;
- return new ClassFileReader(contents, fileName.toCharArray(), fullyInitialize);
+ ClassFileReader reader = new ClassFileReader(contents, fileName.toCharArray(), fullyInitialize);
+ if (root.getKind() == IPackageFragmentRoot.K_BINARY) {
+ JavaProject javaProject = (JavaProject) getAncestor(IJavaElement.JAVA_PROJECT);
+ IClasspathEntry entry = javaProject.getClasspathEntryFor(getPath());
+ if (entry != null) {
+ IProject project = javaProject.getProject();
+ IPath externalAnnotationPath = ClasspathEntry.getExternalAnnotationPath(entry, project, false);
+ if (externalAnnotationPath != null)
+ setupExternalAnnotationProvider(project, externalAnnotationPath, annotationZip, reader,
+ entryName.substring(0, entryName.length() - SuffixConstants.SUFFIX_CLASS.length));
+ }
+ }
+ return reader;
}
} finally {
JavaModelManager.getJavaModelManager().closeZipFile(zip);
+ JavaModelManager.getJavaModelManager().closeZipFile(annotationZip);
}
return null;
}
+
+private void setupExternalAnnotationProvider(IProject project, final IPath externalAnnotationPath,
+ ZipFile annotationZip, ClassFileReader reader, final String typeName)
+{
+ // try resolve path within the workspace:
+ IWorkspaceRoot root = project.getWorkspace().getRoot();
+ IResource resource = externalAnnotationPath.segmentCount() == 1
+ ? root.getProject(externalAnnotationPath.lastSegment())
+ : root.getFolder(externalAnnotationPath);
+ if (!resource.exists())
+ resource = root.getFile(externalAnnotationPath);
+ String resolvedPath;
+ if (resource.exists()) {
+ if (resource.isVirtual()) {
+ Util.log(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID,
+ "Virtual resource "+externalAnnotationPath+" cannot be used as annotationpath for project "+project.getName())); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ resolvedPath = resource.getLocation().toString(); // workspace lookup succeeded -> resolve it
+ } else {
+ resolvedPath = externalAnnotationPath.toString(); // not in workspace, use as is
+ }
+ try {
+ annotationZip = reader.setExternalAnnotationProvider(resolvedPath, typeName, annotationZip, new ClassFileReader.ZipFileProducer() {
+ @Override public ZipFile produce() throws IOException {
+ try {
+ return JavaModelManager.getJavaModelManager().getZipFile(externalAnnotationPath); // use (absolute, but) unresolved path here
+ } catch (CoreException e) {
+ throw new IOException("Failed to read annotation file for "+typeName+" from "+externalAnnotationPath.toString(), e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }});
+ } catch (IOException e) {
+ Util.log(e);
+ return;
+ }
+ if (annotationZip == null) {
+ // Additional change listening for individual types only when annotations are in individual files.
+ // Note that we also listen for classes that don't yet have an annotation file, to detect its creation
+ this.externalAnnotationBase = externalAnnotationPath; // remember so we can unregister later
+ ExternalAnnotationTracker.registerClassFile(externalAnnotationPath, new Path(typeName), this);
+ }
+}
+void closeAndRemoveFromJarTypeCache() throws JavaModelException {
+ super.close();
+ // triggered when external annotations have changed we need to recreate this class file
+ JavaModelManager.getJavaModelManager().removeFromJarTypeCache(this.binaryType);
+}
+@Override
+public void close() throws JavaModelException {
+ if (this.externalAnnotationBase != null) {
+ String entryName = Util.concatWith(((PackageFragment) getParent()).names, this.name, '/');
+ ExternalAnnotationTracker.unregisterClassFile(this.externalAnnotationBase, new Path(entryName));
+ }
+ super.close();
+}
public IBuffer getBuffer() throws JavaModelException {
IStatus status = validateClassFile();
if (status.isOK()) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.java
index 38d3deb..a353713 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathChange.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -27,6 +29,7 @@
import org.aspectj.org.eclipse.jdt.core.IJavaElementDelta;
import org.aspectj.org.eclipse.jdt.core.IPackageFragment;
import org.aspectj.org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.aspectj.org.eclipse.jdt.core.JavaCore;
import org.aspectj.org.eclipse.jdt.core.JavaModelException;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.ObjectVector;
import org.aspectj.org.eclipse.jdt.internal.core.DeltaProcessor.RootInfo;
@@ -122,6 +125,17 @@
continue nextEntry;
}
}
+ if (JavaCore.ENABLED.equals(this.project.getOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, true))) {
+ // if null annotations are enabled, also check for changes in external annotation attachment
+ String annotationPath = ClasspathEntry.getRawExternalAnnotationPath(entry);
+ String otherAnnotationPath = ClasspathEntry.getRawExternalAnnotationPath(other);
+ if (annotationPath != null && otherAnnotationPath != null) {
+ if (!annotationPath.equals(otherAnnotationPath))
+ continue;
+ } else if (annotationPath != otherAnnotationPath) {
+ continue; // null and not-null
+ }
+ }
return i;
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.java
index c37cb2d..33270a4 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ClasspathEntry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,10 @@
* IBM Corporation - initial API and implementation
* Terry Parker <tparker@google.com> - DeltaProcessor misses state changes in archive files, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425
* Thirumala Reddy Mutchukota <thirumala@google.com> - Avoid optional library classpath entries validation - https://bugs.eclipse.org/bugs/show_bug.cgi?id=412882
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
+ * Bug 462768 - [null] NPE when using linked folder for external annotations
+ * Bug 465296 - precedence of extra attributes on a classpath container
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -330,12 +334,21 @@
}
/**
- * Used to perform export/restriction propagation across referring projects/containers
+ * Used to perform export/restriction propagation across referring projects/containers.
+ * Also: propagating extraAttributes.
*/
public ClasspathEntry combineWith(ClasspathEntry referringEntry) {
if (referringEntry == null) return this;
- if (referringEntry.isExported() || referringEntry.getAccessRuleSet() != null ) {
+ IClasspathAttribute[] referringExtraAttributes = referringEntry.getExtraAttributes();
+ if (referringEntry.isExported() || referringEntry.getAccessRuleSet() != null || referringExtraAttributes.length > 0) {
boolean combine = this.entryKind == CPE_SOURCE || referringEntry.combineAccessRules();
+ IClasspathAttribute[] combinedAttributes = this.extraAttributes;
+ int lenRefer = referringExtraAttributes.length;
+ if (lenRefer > 0) {
+ int lenEntry = combinedAttributes.length;
+ System.arraycopy(combinedAttributes, 0, combinedAttributes=new IClasspathAttribute[lenEntry+lenRefer], lenRefer, lenEntry);
+ System.arraycopy(referringExtraAttributes, 0, combinedAttributes, 0, lenRefer);
+ }
return new ClasspathEntry(
getContentKind(),
getEntryKind(),
@@ -348,7 +361,7 @@
referringEntry.isExported() || this.isExported, // duplicate container entry for tagging it as exported
combine(referringEntry.getAccessRules(), getAccessRules(), combine),
this.combineAccessRules,
- this.extraAttributes);
+ combinedAttributes);
}
// no need to clone
return this;
@@ -1245,7 +1258,76 @@
return this.sourceAttachmentRootPath;
}
+ /**
+ * Internal API: answer the path for external annotations (for null analysis) associated with
+ * the given classpath entry.
+ * Four shapes of paths are supported:
+ * <ol>
+ * <li>relative, variable (VAR/relpath): resolve classpath variable VAR and append relpath</li>
+ * <li>relative, project (relpath): interpret relpath as a relative path within the given project</li>
+ * <li>absolute, workspace (/Proj/relpath): an absolute path in the workspace</li>
+ * <li>absolute, filesystem (/abspath): an absolute path in the filesystem</li>
+ * </ol>
+ * In case of ambiguity, workspace lookup has higher priority than filesystem lookup
+ * (in fact filesystem paths are never validated).
+ *
+ * @param entry classpath entry to work on
+ * @param project project whose classpath we are analysing
+ * @param resolve if true, any workspace-relative paths will be resolved to filesystem paths.
+ * @return a path (in the workspace or filesystem-absolute) or null
+ */
+ public static IPath getExternalAnnotationPath(IClasspathEntry entry, IProject project, boolean resolve) {
+ String rawAnnotationPath = getRawExternalAnnotationPath(entry);
+ if (rawAnnotationPath != null) {
+ IPath annotationPath = new Path(rawAnnotationPath);
+ if (annotationPath.isAbsolute()) {
+ if (!resolve)
+ return annotationPath;
+ // try Workspace-absolute:
+ IProject targetProject = project.getWorkspace().getRoot().getProject(annotationPath.segment(0));
+ if (targetProject.exists()) {
+ if (annotationPath.segmentCount() > 1)
+ return targetProject.getLocation().append(annotationPath.removeFirstSegments(1));
+ else
+ return targetProject.getLocation();
+ }
+ // absolute, not in workspace, must be Filesystem-absolute:
+ return annotationPath;
+ } else {
+ // try Variable (always resolved):
+ IPath resolved = JavaCore.getResolvedVariablePath(annotationPath);
+ if (resolved != null)
+ return resolved;
+
+ // Project-relative:
+ if (project != null) {
+ if (resolve)
+ return project.getLocation().append(annotationPath);
+ else
+ return new Path(project.getName()).append(annotationPath).makeAbsolute();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Answer the raw external annotation path as specified in .classpath, or null.
+ * @param entry where to look
+ * @return the attached external annotation path, or null.
+ */
+ static String getRawExternalAnnotationPath(IClasspathEntry entry) {
+ IClasspathAttribute[] extraAttributes = entry.getExtraAttributes();
+ for (int i = 0, length = extraAttributes.length; i < length; i++) {
+ IClasspathAttribute attribute = extraAttributes[i];
+ if (IClasspathAttribute.EXTERNAL_ANNOTATION_PATH.equals(attribute.getName())) {
+ return attribute.getValue();
+ }
+ }
+ return null;
+ }
+
public IClasspathEntry getReferencingEntry() {
return this.referencingEntry;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.java
index 71f812d..42e8276 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/CompilationUnit.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -505,6 +505,9 @@
* @see ICompilationUnit#findElements(IJavaElement)
*/
public IJavaElement[] findElements(IJavaElement element) {
+ if (element instanceof IType && ((IType) element).isLambda()) {
+ return null;
+ }
ArrayList children = new ArrayList();
while (element != null && element.getElementType() != IJavaElement.COMPILATION_UNIT) {
children.add(element);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.java
index 7e232e9..1213387 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DeltaProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,7 +30,6 @@
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.*;
import org.aspectj.org.eclipse.jdt.core.*;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
@@ -41,7 +40,6 @@
import org.aspectj.org.eclipse.jdt.internal.core.search.AbstractSearchScope;
import org.aspectj.org.eclipse.jdt.internal.core.search.JavaWorkspaceScope;
import org.aspectj.org.eclipse.jdt.internal.core.search.indexing.IndexManager;
-import org.aspectj.org.eclipse.jdt.internal.core.util.Messages;
import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
/**
@@ -133,7 +131,7 @@
IPackageFragmentRoot tRoot = null;
Object target = JavaModel.getTarget(this.rootPath, false/*don't check existence*/);
if (target instanceof IResource) {
- tRoot = this.project.getPackageFragmentRoot((IResource)target);
+ tRoot = this.project.getPackageFragmentRoot((IResource)target, this.rootPath);
} else {
tRoot = this.project.getPackageFragmentRoot(this.rootPath.toOSString());
}
@@ -815,26 +813,7 @@
}
if (projectsToTouch.length > 0) {
if (asynchronous){
- WorkspaceJob touchJob = new WorkspaceJob(Messages.updating_external_archives_jobName) {
-
- public IStatus runInWorkspace(IProgressMonitor progressMonitor) throws CoreException {
- try {
- if (progressMonitor != null)
- progressMonitor.beginTask("", projectsToTouch.length); //$NON-NLS-1$
- touchProjects(projectsToTouch, progressMonitor);
- }
- finally {
- if (progressMonitor != null)
- progressMonitor.done();
- }
- return Status.OK_STATUS;
- }
-
- public boolean belongsTo(Object family) {
- return ResourcesPlugin.FAMILY_MANUAL_REFRESH == family;
- }
- };
- touchJob.schedule();
+ this.manager.touchProjects(projectsToTouch, monitor);
}
else {
// touch the projects to force them to be recompiled while taking the workspace lock
@@ -873,18 +852,6 @@
}
}
- protected void touchProjects(final IProject[] projectsToTouch, IProgressMonitor progressMonitor)
- throws CoreException {
- for (int i = 0; i < projectsToTouch.length; i++) {
- IProgressMonitor monitor = progressMonitor == null ? null: new SubProgressMonitor(progressMonitor, 1);
- IProject project = projectsToTouch[i];
- // touch to force a build of this project
- if (JavaBuilder.DEBUG)
- System.out.println("Touching project " + project.getName() + " due to external jar file change"); //$NON-NLS-1$ //$NON-NLS-2$
- project.touch(monitor);
- }
- }
-
/*
* Check if external archives have changed for the given elements and create the corresponding deltas.
* Returns whether at least one delta was created.
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.java
index cb545ba..d40945b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/DiscardWorkingCopyOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,9 +7,12 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 458577 - IClassFile.getWorkingCopy() may lead to NPE in BecomeWorkingCopyOperation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
+import org.eclipse.core.resources.IResource;
import org.aspectj.org.eclipse.jdt.core.IJavaElement;
import org.aspectj.org.eclipse.jdt.core.IJavaElementDelta;
import org.aspectj.org.eclipse.jdt.core.IJavaProject;
@@ -42,16 +45,19 @@
addDelta(delta);
removeReconcileDelta(workingCopy);
} else {
- if (workingCopy.getResource().isAccessible()) {
- // report a F_PRIMARY_WORKING_COPY change delta for a primary working copy
- JavaElementDelta delta = new JavaElementDelta(getJavaModel());
- delta.changed(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
- addDelta(delta);
- } else {
- // report a REMOVED delta
- JavaElementDelta delta = new JavaElementDelta(getJavaModel());
- delta.removed(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
- addDelta(delta);
+ IResource resource = workingCopy.getResource();
+ if (resource != null) {
+ if (resource.isAccessible()) {
+ // report a F_PRIMARY_WORKING_COPY change delta for a primary working copy
+ JavaElementDelta delta = new JavaElementDelta(getJavaModel());
+ delta.changed(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
+ addDelta(delta);
+ } else {
+ // report a REMOVED delta
+ JavaElementDelta delta = new JavaElementDelta(getJavaModel());
+ delta.removed(workingCopy, IJavaElementDelta.F_PRIMARY_WORKING_COPY);
+ addDelta(delta);
+ }
}
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java
new file mode 100644
index 0000000..3fbc46e
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ExternalAnnotationTracker.java
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2015 GK Software AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Stephan Herrmann - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.IPath;
+import org.aspectj.org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ExternalAnnotationProvider;
+import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
+
+/**
+ * Track changes of external annotation files and trigger closing / reloading of affected ClassFiles.
+ */
+public class ExternalAnnotationTracker implements IResourceChangeListener {
+
+ /**
+ * Nodes in a tree that represents external annotation attachments.
+ * Each node is either an intermediate node, or an annotation base.
+ * <p>
+ * <b>Intermediate nodes</b> represent the workspace structure holding the
+ * external annotations. They may have children.<br/>
+ * <em>Note: we don't flatten these intermediate nodes as to facilitate
+ * matching against the exact structure of resource deltas.</em>
+ * </p><p>
+ * An <b>annotation base</b> is a leaf in the represented directory structure
+ * and may have a map of known class files.
+ * </p>
+ */
+ static class DirectoryNode {
+
+ DirectoryNode parent;
+ IPath path;
+
+ /** Key is a full workspace path. */
+ Map<IPath,DirectoryNode> children;
+ /**
+ * Key is the path of an external annotation file (.eea), relative to this annotation base.
+ * The annotation file need not exist, in which case we are waiting for its creation.
+ */
+ Map<IPath, ClassFile> classFiles;
+ IPackageFragmentRoot modelRoot; // TODO: for handling zipped annotations
+
+ public DirectoryNode(DirectoryNode parent, IPath path) {
+ this.parent = parent;
+ this.path = path;
+ }
+
+ Map<IPath, DirectoryNode> getChildren() {
+ if (this.children == null)
+ this.children = new HashMap<IPath, DirectoryNode>();
+ return this.children;
+ }
+
+ void registerClassFile(IPath relativeAnnotationPath, ClassFile classFile) {
+ if (this.classFiles == null)
+ this.classFiles = new HashMap<IPath, ClassFile>();
+ this.classFiles.put(relativeAnnotationPath, classFile);
+ if (this.modelRoot == null)
+ this.modelRoot = classFile.getPackageFragmentRoot();
+ }
+
+ void unregisterClassFile(IPath relativeAnnotationPath) {
+ if (this.classFiles != null) {
+ this.classFiles.remove(relativeAnnotationPath);
+ if (this.classFiles.isEmpty() && this.parent != null)
+ this.parent.unregisterDirectory(this);
+ }
+ }
+ void unregisterDirectory(DirectoryNode child) {
+ if (this.children != null)
+ this.children.remove(child.path);
+ if ((this.children == null || this.children.isEmpty()) && this.parent != null)
+ this.parent.unregisterDirectory(this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ if (this.classFiles != null)
+ buf.append("annotation base "); //$NON-NLS-1$
+ buf.append("directory\n"); //$NON-NLS-1$
+ if (this.children != null)
+ buf.append("\twith ").append(this.children.size()).append(" children\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append("\t#classFiles: ").append(numClassFiles()); //$NON-NLS-1$
+ return buf.toString();
+ }
+ int numClassFiles() {
+ if (this.classFiles != null)
+ return this.classFiles.size();
+ int count = 0;
+ if (this.children != null)
+ for (DirectoryNode child : this.children.values())
+ count += child.numClassFiles();
+ return count;
+ }
+ boolean isEmpty() {
+ return (this.children == null || this.children.isEmpty()) && (this.classFiles == null || this.classFiles.isEmpty());
+ }
+ }
+
+ /** The tree of tracked annotation bases and class files. */
+ DirectoryNode tree = new DirectoryNode(null, null);
+
+ private static ExternalAnnotationTracker singleton;
+ private ExternalAnnotationTracker() { }
+
+ /** Start listening. */
+ static void start(IWorkspace workspace) {
+ singleton = new ExternalAnnotationTracker();
+ workspace.addResourceChangeListener(singleton);
+ }
+
+ /** Stop listening & clean up. */
+ static void shutdown(IWorkspace workspace) {
+ workspace.removeResourceChangeListener(singleton);
+ singleton.tree.children = null;
+ }
+
+ /**
+ * Register a ClassFile, to which the annotation attachment 'annotationBase' applies.
+ * This is done for the purpose to listen to changes in the corresponding external annotations
+ * and to force reloading the class file when necessary.
+ * @param annotationBase the path of the annotation attachment (workspace absolute)
+ * @param relativeAnnotationPath path corresponding to the qualified name of the main type of the class file.
+ * The path is relative to 'annotationBase'.
+ * When appending the file extension for annotation files it points to the annotation file
+ * that would correspond to the given class file. The annotation file may or may not yet exist.
+ * @param classFile the ClassFile to register.
+ */
+ public static void registerClassFile(IPath annotationBase, IPath relativeAnnotationPath, ClassFile classFile) {
+ int baseDepth = annotationBase.segmentCount();
+ if (baseDepth == 0) {
+ Util.log(new IllegalArgumentException("annotationBase cannot be empty")); //$NON-NLS-1$
+ } else {
+ relativeAnnotationPath = relativeAnnotationPath.addFileExtension(ExternalAnnotationProvider.ANNOTION_FILE_EXTENSION);
+ DirectoryNode base = singleton.getAnnotationBase(singleton.tree, annotationBase, baseDepth, 1);
+ base.registerClassFile(relativeAnnotationPath, classFile);
+ }
+ }
+
+ /**
+ * Unregister a class file that is being closed.
+ * Only to be invoked for class files that potentially are affected by external annotations.
+ * @param annotationBase path of the corresponding annotation attachment (workspace absolute)
+ * @param relativeAnnotationPath path of the annotation file that would correspond to the given class file.
+ */
+ public static void unregisterClassFile(IPath annotationBase, IPath relativeAnnotationPath) {
+ int baseDepth = annotationBase.segmentCount();
+ if (baseDepth == 0) {
+ Util.log(new IllegalArgumentException("annotationBase cannot be empty")); //$NON-NLS-1$
+ } else {
+ relativeAnnotationPath = relativeAnnotationPath.addFileExtension(ExternalAnnotationProvider.ANNOTION_FILE_EXTENSION);
+ DirectoryNode base = singleton.getAnnotationBase(singleton.tree, annotationBase, baseDepth, 1);
+ base.unregisterClassFile(relativeAnnotationPath);
+ }
+ }
+
+ private DirectoryNode getAnnotationBase(DirectoryNode current, IPath annotationBase, int baseDepth, int nextDepth) {
+ IPath nextHead = annotationBase.uptoSegment(nextDepth);
+ Map<IPath, DirectoryNode> children = current.getChildren(); // create if necessary
+ DirectoryNode nextHeadNode = children.get(nextHead);
+ if (nextHeadNode == null)
+ children.put(nextHead, nextHeadNode = new DirectoryNode(current, nextHead));
+ if (baseDepth == nextDepth)
+ return nextHeadNode;
+ return getAnnotationBase(nextHeadNode, annotationBase, baseDepth, nextDepth+1);
+ }
+
+ /**
+ * Listen to resource change events concerning external annotations, that potentially affect a cached ClassFile.
+ */
+ @Override
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ if (delta != null && delta.getFullPath().isRoot() && this.tree.children != null) {
+ for (IResourceDelta child : delta.getAffectedChildren()) {
+ DirectoryNode directoryNode = this.tree.children.get(child.getFullPath());
+ if (directoryNode != null)
+ traverseForDirectories(directoryNode, child);
+ }
+ }
+ }
+
+ // co-traversal of directory nodes & delta nodes:
+ private void traverseForDirectories(DirectoryNode directoryNode, IResourceDelta matchedDelta) {
+ if (directoryNode.classFiles != null) {
+ // annotation base reached, switch strategy:
+ traverseForClassFiles(directoryNode.classFiles, matchedDelta, matchedDelta.getFullPath().segmentCount());
+ // ignore further children, if we already have classFiles (i.e., nested annotation bases are tolerated but ignored).
+ } else if (directoryNode.children != null) {
+ for (IResourceDelta child : matchedDelta.getAffectedChildren()) {
+ DirectoryNode childDir = directoryNode.children.get(child.getFullPath());
+ if (childDir != null) {
+ if (child.getKind() == IResourceDelta.REMOVED)
+ directoryNode.children.remove(child.getFullPath());
+ else
+ traverseForDirectories(childDir, child);
+ }
+ }
+ }
+ if (directoryNode.isEmpty())
+ directoryNode.parent.children.remove(matchedDelta.getFullPath());
+ }
+
+ // traversal of delta nodes to be matched against map of class files:
+ private void traverseForClassFiles(Map<IPath, ClassFile> classFiles, IResourceDelta matchedDelta, int baseDepth) {
+ for (IResourceDelta delta : matchedDelta.getAffectedChildren()) {
+ IPath deltaRelativePath = delta.getFullPath().removeFirstSegments(baseDepth);
+ ClassFile classFile = classFiles.remove(deltaRelativePath);
+ if (classFile != null) {
+ try {
+ // the payload: unload the class file corresponding to a changed external annotation file:
+ classFile.closeAndRemoveFromJarTypeCache();
+ } catch (JavaModelException e) {
+ Util.log(e, "Failed to close ClassFile "+classFile.name); //$NON-NLS-1$
+ }
+ } else {
+ traverseForClassFiles(classFiles, delta, baseDepth);
+ }
+ }
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
index a74d8b9..9a684ae 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
@@ -42,11 +42,6 @@
private final static ArrayList EMPTY_LIST = new ArrayList();
/**
- * Compiler compliance level that was used to produce the jar.
- */
- protected final String complianceLevel;
-
- /**
* The path to the jar file
* (a workspace relative path if the jar is internal,
* or an OS path if the jar is external)
@@ -61,9 +56,6 @@
protected JarPackageFragmentRoot(IPath externalJarPath, JavaProject project) {
super(null, project);
this.jarPath = externalJarPath;
- Object file = JavaModel.getTarget(getPath(), true);
- long level = Util.getJdkLevel(file);
- this.complianceLevel = CompilerOptions.versionFromJdkLevel(level);
}
/**
* Constructs a package fragment root which is the root of the Java package directory hierarchy
@@ -72,9 +64,6 @@
protected JarPackageFragmentRoot(IResource resource, JavaProject project) {
super(resource, project);
this.jarPath = resource.getFullPath();
- Object file = JavaModel.getTarget(getPath(), true);
- long level = Util.getJdkLevel(file);
- this.complianceLevel = CompilerOptions.versionFromJdkLevel(level);
}
/**
@@ -87,6 +76,9 @@
IJavaElement[] children;
ZipFile jar = null;
try {
+ Object file = JavaModel.getTarget(getPath(), true);
+ long level = Util.getJdkLevel(file);
+ String compliance = CompilerOptions.versionFromJdkLevel(level);
jar = getJar();
// always create the default package
@@ -94,7 +86,7 @@
for (Enumeration e= jar.entries(); e.hasMoreElements();) {
ZipEntry member= (ZipEntry) e.nextElement();
- initRawPackageInfo(rawPackageInfo, member.getName(), member.isDirectory());
+ initRawPackageInfo(rawPackageInfo, member.getName(), member.isDirectory(), compliance);
}
// loop through all of referenced packages, creating package fragments if necessary
@@ -221,7 +213,7 @@
public int hashCode() {
return this.jarPath.hashCode();
}
- private void initRawPackageInfo(HashtableOfArrayToObject rawPackageInfo, String entryName, boolean isDirectory) {
+ private void initRawPackageInfo(HashtableOfArrayToObject rawPackageInfo, String entryName, boolean isDirectory, String compliance) {
int lastSeparator = isDirectory ? entryName.length()-1 : entryName.lastIndexOf('/');
String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
String[] existing = null;
@@ -235,8 +227,7 @@
JavaModelManager manager = JavaModelManager.getJavaModelManager();
for (int i = existingLength; i < length; i++) {
// sourceLevel must be null because we know nothing about it based on a jar file
- // complianceLevel can be retrieved from a jar file
- if (Util.isValidFolderNameForPackage(pkgName[i], null, this.complianceLevel)) {
+ if (Util.isValidFolderNameForPackage(pkgName[i], null, compliance)) {
System.arraycopy(existing, 0, existing = new String[i+1], 0, i);
existing[i] = manager.intern(pkgName[i]);
rawPackageInfo.put(existing, new ArrayList[] { EMPTY_LIST, EMPTY_LIST });
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
index a415db3..a6525f8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Harry Terkelsen (het@google.com) - Bug 449262 - Allow the use of third-party Java formatters
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -73,6 +74,7 @@
defaultOptionsMap.put(optionName, entry.getValue());
optionNames.add(optionName);
}
+ defaultOptionsMap.put(JavaCore.JAVA_FORMATTER, JavaCore.DEFAULT_JAVA_FORMATTER);
// CodeAssist settings
defaultOptionsMap.put(JavaCore.CODEASSIST_VISIBILITY_CHECK, JavaCore.DISABLED);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.java
index fcde1de..9ba2bca 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElement.java
@@ -14,8 +14,7 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
+import java.net.HttpURLConnection;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
@@ -30,9 +29,32 @@
import java.util.Set;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.aspectj.org.eclipse.jdt.core.*;
+import org.aspectj.org.eclipse.jdt.core.IClassFile;
+import org.aspectj.org.eclipse.jdt.core.IClasspathAttribute;
+import org.aspectj.org.eclipse.jdt.core.IClasspathEntry;
+import org.aspectj.org.eclipse.jdt.core.ICompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.IField;
+import org.aspectj.org.eclipse.jdt.core.IJavaElement;
+import org.aspectj.org.eclipse.jdt.core.IJavaModel;
+import org.aspectj.org.eclipse.jdt.core.IJavaModelStatus;
+import org.aspectj.org.eclipse.jdt.core.IJavaModelStatusConstants;
+import org.aspectj.org.eclipse.jdt.core.IJavaProject;
+import org.aspectj.org.eclipse.jdt.core.IMember;
+import org.aspectj.org.eclipse.jdt.core.IOpenable;
+import org.aspectj.org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.aspectj.org.eclipse.jdt.core.IParent;
+import org.aspectj.org.eclipse.jdt.core.ISourceRange;
+import org.aspectj.org.eclipse.jdt.core.ISourceReference;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+import org.aspectj.org.eclipse.jdt.core.WorkingCopyOwner;
import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
@@ -806,51 +828,39 @@
}
}
- /*
- * We don't use getContentEncoding() on the URL connection, because it might leave open streams behind.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=117890
- */
protected String getURLContents(URL baseLoc, String docUrlValue) throws JavaModelException {
InputStream stream = null;
JarURLConnection connection2 = null;
+ URL docUrl = null;
+ URLConnection connection = null;
try {
- URL docUrl = new URL(docUrlValue);
- URLConnection connection = docUrl.openConnection();
- Class[] parameterTypes = new Class[]{int.class};
- Integer timeoutVal = new Integer(10000);
- // set the connect and read timeouts using reflection since these methods are not available in java 1.4
- Class URLClass = connection.getClass();
- try {
- Method connectTimeoutMethod = URLClass.getDeclaredMethod("setConnectTimeout", parameterTypes); //$NON-NLS-1$
- Method readTimeoutMethod = URLClass.getDeclaredMethod("setReadTimeout", parameterTypes); //$NON-NLS-1$
- connectTimeoutMethod.invoke(connection, new Object[]{timeoutVal});
- readTimeoutMethod.invoke(connection, new Object[]{timeoutVal});
- } catch (SecurityException e) {
- // ignore
- } catch (IllegalArgumentException e) {
- // ignore
- } catch (NoSuchMethodException e) {
- // ignore
- } catch (IllegalAccessException e) {
- // ignore
- } catch (InvocationTargetException e) {
- // ignore
+ redirect: for (int i= 0; i < 5; i++) { // avoid endless redirects...
+ docUrl = new URL(docUrlValue);
+ connection = docUrl.openConnection();
+
+ int timeoutVal = 10000;
+ connection.setConnectTimeout(timeoutVal);
+ connection.setReadTimeout(timeoutVal);
+
+ if (connection instanceof HttpURLConnection) {
+ // HttpURLConnection doesn't redirect from http to https, see https://bugs.eclipse.org/450684
+ HttpURLConnection httpCon = (HttpURLConnection) connection;
+ if (httpCon.getResponseCode() == 301) {
+ docUrlValue = httpCon.getHeaderField("location"); //$NON-NLS-1$
+ if (docUrlValue != null) {
+ continue redirect;
+ }
+ }
+ } else if (connection instanceof JarURLConnection) {
+ connection2 = (JarURLConnection) connection;
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=156307
+ connection.setUseCaches(false);
+ }
+ break;
}
-
- if (connection instanceof JarURLConnection) {
- connection2 = (JarURLConnection) connection;
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=156307
- connection.setUseCaches(false);
- }
- try {
- stream = new BufferedInputStream(connection.getInputStream());
- } catch (IllegalArgumentException e) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=304316
- return null;
- } catch (NullPointerException e) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=304316
- return null;
- }
+
+ stream = new BufferedInputStream(connection.getInputStream());
+
String encoding = connection.getContentEncoding();
byte[] contents = org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.getInputStreamAsByteArray(stream, connection.getContentLength());
if (encoding == null) {
@@ -889,6 +899,12 @@
return new String(contents);
}
}
+ } catch (IllegalArgumentException e) {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=304316
+ return null;
+ } catch (NullPointerException e) {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=304316
+ return null;
} catch (SocketTimeoutException e) {
throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT, this));
} catch (MalformedURLException e) {
@@ -910,6 +926,9 @@
throw new JavaModelException(e, IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC);
} catch (IOException e) {
throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);
+ } catch(Exception e) {
+ if (e.getCause() instanceof IllegalArgumentException) return null;
+ throw new JavaModelException(e, IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC);
} finally {
if (stream != null) {
try {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.java
index 760b76c..befc8aa 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDelta.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,10 +7,13 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Vladimir Piskarev <pisv@1c.ru> - Building large Java element deltas is really slow - https://bugs.eclipse.org/443928
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.resources.IResourceDelta;
import org.aspectj.org.eclipse.jdt.core.IJavaElement;
@@ -67,6 +70,35 @@
* Empty array of IJavaElementDelta
*/
static IJavaElementDelta[] EMPTY_DELTA= new IJavaElementDelta[] {};
+
+ /**
+ * Child index is needed iff affectedChildren.length >= NEED_CHILD_INDEX
+ */
+ static int NEED_CHILD_INDEX = 3;
+
+ /**
+ * On-demand index into affectedChildren
+ */
+ Map<Key, Integer> childIndex;
+
+ /**
+ * The delta key
+ */
+ protected static class Key {
+ public final IJavaElement element;
+
+ public Key(IJavaElement element) {
+ this.element = element;
+ }
+ public int hashCode() {
+ return this.element.hashCode();
+ }
+ public boolean equals(Object obj) {
+ if (!(obj instanceof Key))
+ return false;
+ return equalsAndSameParent(this.element, ((Key) obj).element);
+ }
+ }
/**
* Creates the root delta. To create the nested delta
* hierarchies use the following convenience methods. The root
@@ -107,22 +139,12 @@
fineGrained();
}
- if (this.affectedChildren == null || this.affectedChildren.length == 0) {
- this.affectedChildren = new IJavaElementDelta[] {child};
- return;
- }
- JavaElementDelta existingChild = null;
- int existingChildIndex = -1;
- for (int i = 0; i < this.affectedChildren.length; i++) {
- if (equalsAndSameParent(this.affectedChildren[i].getElement(), child.getElement())) { // handle case of two jars that can be equals but not in the same project
- existingChild = (JavaElementDelta)this.affectedChildren[i];
- existingChildIndex = i;
- break;
- }
- }
- if (existingChild == null) { //new affected child
- this.affectedChildren= growAndAddToArray(this.affectedChildren, child);
+ Key childKey = new Key(child.getElement());
+ Integer existingChildIndex = getChildIndex(childKey);
+ if (existingChildIndex == null) { //new affected child
+ addNewChild(child);
} else {
+ JavaElementDelta existingChild = (JavaElementDelta) this.affectedChildren[existingChildIndex];
switch (existingChild.getKind()) {
case ADDED:
switch (child.getKind()) {
@@ -130,7 +152,7 @@
case CHANGED: // child was added then changed -> it is added
return;
case REMOVED: // child was added then removed -> noop
- this.affectedChildren = removeAndShrinkArray(this.affectedChildren, existingChildIndex);
+ removeExistingChild(childKey, existingChildIndex);
return;
}
break;
@@ -206,6 +228,15 @@
insertDeltaTree(element, addedDelta);
}
/**
+ * Adds the new child delta to the collection of affected children.
+ */
+protected void addNewChild(JavaElementDelta child) {
+ this.affectedChildren = growAndAddToArray(this.affectedChildren, child);
+ if (this.childIndex != null) {
+ this.childIndex.put(new Key(child.getElement()), this.affectedChildren.length - 1);
+ }
+}
+/**
* Adds the child delta to the collection of affected children. If the
* child is already in the collection, walk down the hierarchy.
*/
@@ -253,6 +284,13 @@
changed(F_AST_AFFECTED);
}
/**
+ * Clears the collection of affected children.
+ */
+protected void clearAffectedChildren() {
+ this.affectedChildren = EMPTY_DELTA;
+ this.childIndex = null;
+}
+/**
* Mark this delta as a content changed delta.
*/
public void contentChanged() {
@@ -295,7 +333,7 @@
/**
* Returns whether the two java elements are equals and have the same parent.
*/
-protected boolean equalsAndSameParent(IJavaElement e1, IJavaElement e2) {
+protected static boolean equalsAndSameParent(IJavaElement e1, IJavaElement e2) {
IJavaElement parent1;
return e1.equals(e2) && ((parent1 = e1.getParent()) != null) && parent1.equals(e2.getParent());
}
@@ -304,15 +342,24 @@
* in the delta tree, or null, if no delta for the given element is found.
*/
protected JavaElementDelta find(IJavaElement e) {
- if (equalsAndSameParent(this.changedElement, e)) { // handle case of two jars that can be equals but not in the same project
+ if (equalsAndSameParent(getElement(), e)) // handle case of two jars that can be equals but not in the same project
return this;
- } else {
- for (int i = 0; i < this.affectedChildren.length; i++) {
- JavaElementDelta delta = ((JavaElementDelta)this.affectedChildren[i]).find(e);
- if (delta != null) {
- return delta;
- }
- }
+ return findDescendant(new Key(e));
+}
+/**
+ * Returns the descendant delta for the given key, or <code>null</code>,
+ * if no delta for the given key is found in the delta tree below this delta.
+ */
+protected JavaElementDelta findDescendant(Key key) {
+ if (this.affectedChildren.length == 0)
+ return null;
+ Integer index = getChildIndex(key);
+ if (index != null)
+ return (JavaElementDelta) this.affectedChildren[index];
+ for (IJavaElementDelta child : this.affectedChildren) {
+ JavaElementDelta delta = ((JavaElementDelta) child).findDescendant(key);
+ if (delta != null)
+ return delta;
}
return null;
}
@@ -369,6 +416,28 @@
return getChildrenOfType(CHANGED);
}
/**
+ * Returns the index of the delta in the collection of affected children,
+ * or <code>null</code> if the child delta for the given key is not found.
+ */
+protected Integer getChildIndex(Key key) {
+ int length = this.affectedChildren.length;
+ if (length < NEED_CHILD_INDEX) {
+ for (int i = 0; i < length; i++) {
+ if (equalsAndSameParent(key.element, this.affectedChildren[i].getElement())) {
+ return i;
+ }
+ }
+ return null;
+ }
+ if (this.childIndex == null) {
+ this.childIndex = new HashMap<Key, Integer>();
+ for (int i = 0; i < length; i++) {
+ this.childIndex.put(new Key(this.affectedChildren[i].getElement()), i);
+ }
+ }
+ return this.childIndex.get(key);
+}
+/**
* @see IJavaElementDelta
*/
protected IJavaElementDelta[] getChildrenOfType(int type) {
@@ -393,22 +462,7 @@
* delta.
*/
protected JavaElementDelta getDeltaFor(IJavaElement element) {
- if (equalsAndSameParent(getElement(), element)) // handle case of two jars that can be equals but not in the same project
- return this;
- if (this.affectedChildren.length == 0)
- return null;
- int childrenCount = this.affectedChildren.length;
- for (int i = 0; i < childrenCount; i++) {
- JavaElementDelta delta = (JavaElementDelta)this.affectedChildren[i];
- if (equalsAndSameParent(delta.getElement(), element)) { // handle case of two jars that can be equals but not in the same project
- return delta;
- } else {
- delta = delta.getDeltaFor(element);
- if (delta != null)
- return delta;
- }
- }
- return null;
+ return find(element);
}
/**
* @see IJavaElementDelta
@@ -503,17 +557,12 @@
* Removes the child delta from the collection of affected children.
*/
protected void removeAffectedChild(JavaElementDelta child) {
- int index = -1;
- if (this.affectedChildren != null) {
- for (int i = 0; i < this.affectedChildren.length; i++) {
- if (equalsAndSameParent(this.affectedChildren[i].getElement(), child.getElement())) { // handle case of two jars that can be equals but not in the same project
- index = i;
- break;
- }
- }
- }
- if (index >= 0) {
- this.affectedChildren= removeAndShrinkArray(this.affectedChildren, index);
+ if (this.affectedChildren.length == 0)
+ return;
+ Key childKey = new Key(child.getElement());
+ Integer exisingChildIndex = getChildIndex(childKey);
+ if (exisingChildIndex != null) {
+ removeExistingChild(childKey, exisingChildIndex);
}
}
/**
@@ -545,7 +594,24 @@
if (actualDelta != null) {
actualDelta.removed();
actualDelta.changeFlags |= flags;
- actualDelta.affectedChildren = EMPTY_DELTA;
+ actualDelta.clearAffectedChildren();
+ }
+}
+/**
+ * Removes the existing child delta from the collection of affected children.
+ */
+protected void removeExistingChild(Key key, int index) {
+ this.affectedChildren = removeAndShrinkArray(this.affectedChildren, index);
+ if (this.childIndex != null) {
+ int length = this.affectedChildren.length;
+ if (length < NEED_CHILD_INDEX)
+ this.childIndex = null;
+ else {
+ this.childIndex.remove(key);
+ for (int i = index; i < length; i++) {
+ this.childIndex.put(new Key(this.affectedChildren[i].getElement()), i);
+ }
+ }
}
}
/**
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
index c1e3cd7..7b3f2a6 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Vladimir Piskarev <pisv@1c.ru> - Building large Java element deltas is really slow - https://bugs.eclipse.org/443928
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -490,10 +491,7 @@
*/
private void trimDelta(JavaElementDelta elementDelta) {
if (elementDelta.getKind() == IJavaElementDelta.REMOVED) {
- IJavaElementDelta[] children = elementDelta.getAffectedChildren();
- for(int i = 0, length = children.length; i < length; i++) {
- elementDelta.removeAffectedChild((JavaElementDelta)children[i]);
- }
+ elementDelta.clearAffectedChildren();
} else {
IJavaElementDelta[] children = elementDelta.getAffectedChildren();
for(int i = 0, length = children.length; i < length; i++) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.java
index e4f758a..f9fe6a5 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelCache.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,8 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Terry Parker <tparker@google.com> (Google Inc.) https://bugs.eclipse.org/365499
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
import java.util.HashMap;
@@ -262,6 +264,9 @@
protected void resetJarTypeCache() {
this.jarTypeCache = new LRUCache((int) (DEFAULT_OPENABLE_SIZE * getMemoryRatio() * getJarTypeRatio()));
}
+protected void removeFromJarTypeCache(BinaryType type) {
+ this.jarTypeCache.flush(type);
+}
public String toString() {
return toStringFillingRation(""); //$NON-NLS-1$
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.java
index c33f8f4..cde0c3e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,13 @@
* Theodora Yeung (tyeung@bea.com) - ensure that JarPackageFragmentRoot make it into cache
* before its contents
* (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=102422)
- * Stephan Herrmann - Contribution for Bug 346010 - [model] strange initialization dependency in OptionTests
+ * Stephan Herrmann - Contributions for
+ * Bug 346010 - [model] strange initialization dependency in OptionTests
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
* Terry Parker <tparker@google.com> - DeltaProcessor misses state changes in archive files, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425
* Thirumala Reddy Mutchukota <thirumala@google.com> - Contribution to bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=411423
* Terry Parker <tparker@google.com> - [performance] Low hit rates in JavaModel caches - https://bugs.eclipse.org/421165
+ * Terry Parker <tparker@google.com> - Enable the Java model caches to recover from IO errors - https://bugs.eclipse.org/455042
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -71,6 +74,10 @@
import org.aspectj.org.eclipse.jdt.internal.core.util.WeakHashSetOfCharArray;
import org.aspectj.org.eclipse.jdt.internal.core.util.LRUCache.Stats;
import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatter;
+import org.eclipse.osgi.service.debug.DebugOptions;
+import org.eclipse.osgi.service.debug.DebugOptionsListener;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
import org.osgi.service.prefs.BackingStoreException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -88,9 +95,8 @@
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class JavaModelManager implements ISaveParticipant, IContentTypeChangeListener {
-
+ private static ServiceRegistration<DebugOptionsListener> DEBUG_REGISTRATION;
private static final String NON_CHAINING_JARS_CACHE = "nonChainingJarsCache"; //$NON-NLS-1$
- private static final String INVALID_ARCHIVES_CACHE = "invalidArchivesCache"; //$NON-NLS-1$
private static final String EXTERNAL_FILES_CACHE = "externalFilesCache"; //$NON-NLS-1$
private static final String ASSUMED_EXTERNAL_FILES_CACHE = "assumedExternalFilesCache"; //$NON-NLS-1$
@@ -246,6 +252,7 @@
public String toString() { return getDescription(); }
};
+ private static final String DEBUG = JavaCore.PLUGIN_ID + "/debug"; //$NON-NLS-1$
private static final String BUFFER_MANAGER_DEBUG = JavaCore.PLUGIN_ID + "/debug/buffermanager" ; //$NON-NLS-1$
private static final String INDEX_MANAGER_DEBUG = JavaCore.PLUGIN_ID + "/debug/indexmanager" ; //$NON-NLS-1$
private static final String INDEX_MANAGER_ADVANCED_DEBUG = JavaCore.PLUGIN_ID + "/debug/indexmanager/advanced" ; //$NON-NLS-1$
@@ -1444,11 +1451,14 @@
* A set of IPaths for jars that are known to not contain a chaining (through MANIFEST.MF) to another library
*/
private Set nonChainingJars;
-
+
+ // The amount of time from when an invalid archive is first sensed until that state is considered stale.
+ private static long INVALID_ARCHIVE_TTL_MILLISECONDS = 2 * 60 * 1000;
+
/*
- * A set of IPaths for jars that are known to be invalid - such as not being a valid/known format
+ * A map of IPaths for jars that are known to be invalid (such as not being in a valid/known format), to an eviction timestamp.
*/
- private Set invalidArchives;
+ private Map<IPath, Long> invalidArchives;
/*
* A set of IPaths for files that are known to be external to the workspace.
@@ -1515,19 +1525,16 @@
propertyName.equals(JavaCore.CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE)) {
JavaModelManager manager = JavaModelManager.getJavaModelManager();
IJavaModel model = manager.getJavaModel();
- IJavaProject[] projects;
+ IJavaProject[] jProjects;
try {
- projects = model.getJavaProjects();
- for (int i = 0, pl = projects.length; i < pl; i++) {
- JavaProject javaProject = (JavaProject) projects[i];
+ jProjects = model.getJavaProjects();
+ IProject[] projects = new IProject[jProjects.length];
+ for (int i = 0, pl = jProjects.length; i < pl; i++) {
+ JavaProject javaProject = (JavaProject) jProjects[i];
+ projects[i] = javaProject.getProject();
manager.deltaState.addClasspathValidation(javaProject);
- try {
- // need to touch the project to force validation by DeltaProcessor
- javaProject.getProject().touch(null);
- } catch (CoreException e) {
- // skip
- }
}
+ manager.touchProjects(projects, null);
} catch (JavaModelException e) {
// skip
}
@@ -1595,7 +1602,6 @@
if (Platform.isRunning()) {
this.indexManager = new IndexManager();
this.nonChainingJars = loadClasspathListCache(NON_CHAINING_JARS_CACHE);
- this.invalidArchives = loadClasspathListCache(INVALID_ARCHIVES_CACHE);
this.externalFiles = loadClasspathListCache(EXTERNAL_FILES_CACHE);
this.assumedExternalFiles = loadClasspathListCache(ASSUMED_EXTERNAL_FILES_CACHE);
String includeContainerReferencedLib = System.getProperty(RESOLVE_REFERENCED_LIBRARIES_FOR_CONTAINERS);
@@ -1619,11 +1625,9 @@
public void addInvalidArchive(IPath path) {
// unlikely to be null
if (this.invalidArchives == null) {
- this.invalidArchives = Collections.synchronizedSet(new HashSet());
+ this.invalidArchives = Collections.synchronizedMap(new HashMap());
}
- if(this.invalidArchives != null) {
- this.invalidArchives.add(path);
- }
+ this.invalidArchives.put(path, System.currentTimeMillis() + INVALID_ARCHIVE_TTL_MILLISECONDS);
}
/**
@@ -1668,99 +1672,58 @@
}
}
- /**
- * Configure the plugin with respect to option settings defined in ".options" file
- */
- public void configurePluginDebugOptions(){
- if(JavaCore.getPlugin().isDebugging()){
- String option = Platform.getDebugOption(BUFFER_MANAGER_DEBUG);
- if(option != null) BufferManager.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(BUILDER_DEBUG);
- if(option != null) JavaBuilder.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(COMPILER_DEBUG);
- if(option != null) Compiler.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(BUILDER_STATS_DEBUG);
- if(option != null) JavaBuilder.SHOW_STATS = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(COMPLETION_DEBUG);
- if(option != null) CompletionEngine.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(CP_RESOLVE_DEBUG);
- if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(CP_RESOLVE_ADVANCED_DEBUG);
- if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(CP_RESOLVE_FAILURE_DEBUG);
- if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(DELTA_DEBUG);
- if(option != null) DeltaProcessor.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(DELTA_DEBUG_VERBOSE);
- if(option != null) DeltaProcessor.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(DOM_AST_DEBUG);
- if(option != null) SourceRangeVerifier.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(DOM_AST_DEBUG_THROW);
- if(option != null) {
- SourceRangeVerifier.DEBUG_THROW = option.equalsIgnoreCase(TRUE) ;
+ public static void registerDebugOptionsListener(BundleContext context) {
+ // register debug options listener
+ Hashtable<String, String> properties = new Hashtable<String, String>(2);
+ properties.put(DebugOptions.LISTENER_SYMBOLICNAME, JavaCore.PLUGIN_ID);
+ DEBUG_REGISTRATION = context.registerService(DebugOptionsListener.class, new DebugOptionsListener() {
+ @Override
+ public void optionsChanged(DebugOptions options) {
+ boolean debug = options.getBooleanOption(DEBUG, false);
+ BufferManager.VERBOSE = debug && options.getBooleanOption(BUFFER_MANAGER_DEBUG, false);
+ JavaBuilder.DEBUG = debug && options.getBooleanOption(BUILDER_DEBUG, false);
+ Compiler.DEBUG = debug && options.getBooleanOption(COMPILER_DEBUG, false);
+ JavaBuilder.SHOW_STATS = debug && options.getBooleanOption(BUILDER_STATS_DEBUG, false);
+ CompletionEngine.DEBUG = debug && options.getBooleanOption(COMPLETION_DEBUG, false);
+ JavaModelManager.CP_RESOLVE_VERBOSE = debug && options.getBooleanOption(CP_RESOLVE_DEBUG, false);
+ JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED = debug && options.getBooleanOption(CP_RESOLVE_ADVANCED_DEBUG, false);
+ JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE = debug && options.getBooleanOption(CP_RESOLVE_FAILURE_DEBUG, false);
+ DeltaProcessor.DEBUG = debug && options.getBooleanOption(DELTA_DEBUG, false);
+ DeltaProcessor.VERBOSE = debug && options.getBooleanOption(DELTA_DEBUG_VERBOSE, false);
+ SourceRangeVerifier.DEBUG = debug && options.getBooleanOption(DOM_AST_DEBUG, false);
+ SourceRangeVerifier.DEBUG_THROW = debug && options.getBooleanOption(DOM_AST_DEBUG_THROW, false);
SourceRangeVerifier.DEBUG |= SourceRangeVerifier.DEBUG_THROW;
+ RewriteEventStore.DEBUG = debug && options.getBooleanOption(DOM_REWRITE_DEBUG, false);
+ TypeHierarchy.DEBUG = debug && options.getBooleanOption(HIERARCHY_DEBUG, false);
+ JobManager.VERBOSE = debug && options.getBooleanOption(INDEX_MANAGER_DEBUG, false);
+ IndexManager.DEBUG = debug && options.getBooleanOption(INDEX_MANAGER_ADVANCED_DEBUG, false);
+ JavaModelManager.VERBOSE = debug && options.getBooleanOption(JAVAMODEL_DEBUG, false);
+ JavaModelCache.VERBOSE = debug && options.getBooleanOption(JAVAMODELCACHE_DEBUG, false);
+ JavaModelOperation.POST_ACTION_VERBOSE = debug && options.getBooleanOption(POST_ACTION_DEBUG, false);
+ NameLookup.VERBOSE = debug && options.getBooleanOption(RESOLUTION_DEBUG, false);
+ BasicSearchEngine.VERBOSE = debug && options.getBooleanOption(SEARCH_DEBUG, false);
+ SelectionEngine.DEBUG = debug && options.getBooleanOption(SELECTION_DEBUG, false);
+ JavaModelManager.ZIP_ACCESS_VERBOSE = debug && options.getBooleanOption(ZIP_ACCESS_DEBUG, false);
+ SourceMapper.VERBOSE = debug && options.getBooleanOption(SOURCE_MAPPER_DEBUG_VERBOSE, false);
+ DefaultCodeFormatter.DEBUG = debug && options.getBooleanOption(FORMATTER_DEBUG, false);
+
+ // configure performance options
+ if(PerformanceStats.ENABLED) {
+ CompletionEngine.PERF = PerformanceStats.isEnabled(COMPLETION_PERF);
+ SelectionEngine.PERF = PerformanceStats.isEnabled(SELECTION_PERF);
+ DeltaProcessor.PERF = PerformanceStats.isEnabled(DELTA_LISTENER_PERF);
+ JavaModelManager.PERF_VARIABLE_INITIALIZER = PerformanceStats.isEnabled(VARIABLE_INITIALIZER_PERF);
+ JavaModelManager.PERF_CONTAINER_INITIALIZER = PerformanceStats.isEnabled(CONTAINER_INITIALIZER_PERF);
+ ReconcileWorkingCopyOperation.PERF = PerformanceStats.isEnabled(RECONCILE_PERF);
+ }
}
-
- option = Platform.getDebugOption(DOM_REWRITE_DEBUG);
- if(option != null) RewriteEventStore.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(HIERARCHY_DEBUG);
- if(option != null) TypeHierarchy.DEBUG = option.equalsIgnoreCase(TRUE) ;
+ }, properties);
+ }
- option = Platform.getDebugOption(INDEX_MANAGER_DEBUG);
- if(option != null) JobManager.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(INDEX_MANAGER_ADVANCED_DEBUG);
- if(option != null) IndexManager.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(JAVAMODEL_DEBUG);
- if(option != null) JavaModelManager.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(JAVAMODELCACHE_DEBUG);
- if(option != null) JavaModelCache.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(POST_ACTION_DEBUG);
- if(option != null) JavaModelOperation.POST_ACTION_VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(RESOLUTION_DEBUG);
- if(option != null) NameLookup.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(SEARCH_DEBUG);
- if(option != null) BasicSearchEngine.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(SELECTION_DEBUG);
- if(option != null) SelectionEngine.DEBUG = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(ZIP_ACCESS_DEBUG);
- if(option != null) JavaModelManager.ZIP_ACCESS_VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(SOURCE_MAPPER_DEBUG_VERBOSE);
- if(option != null) SourceMapper.VERBOSE = option.equalsIgnoreCase(TRUE) ;
-
- option = Platform.getDebugOption(FORMATTER_DEBUG);
- if(option != null) DefaultCodeFormatter.DEBUG = option.equalsIgnoreCase(TRUE) ;
- }
-
- // configure performance options
- if(PerformanceStats.ENABLED) {
- CompletionEngine.PERF = PerformanceStats.isEnabled(COMPLETION_PERF);
- SelectionEngine.PERF = PerformanceStats.isEnabled(SELECTION_PERF);
- DeltaProcessor.PERF = PerformanceStats.isEnabled(DELTA_LISTENER_PERF);
- JavaModelManager.PERF_VARIABLE_INITIALIZER = PerformanceStats.isEnabled(VARIABLE_INITIALIZER_PERF);
- JavaModelManager.PERF_CONTAINER_INITIALIZER = PerformanceStats.isEnabled(CONTAINER_INITIALIZER_PERF);
- ReconcileWorkingCopyOperation.PERF = PerformanceStats.isEnabled(RECONCILE_PERF);
- }
+ public static void unregisterDebugOptionsListener() {
+ // unregister debug options listener
+ DEBUG_REGISTRATION.unregister();
+ DEBUG_REGISTRATION = null;
}
/*
@@ -2678,8 +2641,11 @@
* @exception CoreException If unable to create/open the ZipFile
*/
public ZipFile getZipFile(IPath path) throws CoreException {
+ return getZipFile(path, true);
+ }
- if (isInvalidArchive(path))
+ private ZipFile getZipFile(IPath path, boolean checkInvalidArchiveCache) throws CoreException {
+ if (checkInvalidArchiveCache && isInvalidArchive(path))
throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.status_IOException, new ZipException()));
ZipCache zipCache;
@@ -3095,6 +3061,36 @@
*/
}
+ void touchProjects(final IProject[] projectsToTouch, IProgressMonitor progressMonitor) throws JavaModelException {
+ WorkspaceJob touchJob = new WorkspaceJob(Messages.synchronizing_projects_job) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ try {
+ if (monitor != null) {
+ monitor.beginTask("", projectsToTouch.length); //$NON-NLS-1$
+ }
+ for (IProject iProject : projectsToTouch) {
+ IProgressMonitor subMonitor = monitor == null ? null: new SubProgressMonitor(monitor, 1);
+ if (JavaBuilder.DEBUG) {
+ System.out.println("Touching project " + iProject.getName()); //$NON-NLS-1$
+ }
+ iProject.touch(subMonitor);
+ }
+ }
+ finally {
+ if (monitor != null) {
+ monitor.done();
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ public boolean belongsTo(Object family) {
+ return ResourcesPlugin.FAMILY_MANUAL_REFRESH == family;
+ }
+ };
+ touchJob.schedule();
+ }
+
private HashSet getClasspathBeingResolved() {
HashSet result = (HashSet) this.classpathsBeingResolved.get();
if (result == null) {
@@ -3121,12 +3117,41 @@
}
public boolean isInvalidArchive(IPath path) {
- return this.invalidArchives != null && this.invalidArchives.contains(path);
+ if (this.invalidArchives == null)
+ return false;
+ Long evictionTime = this.invalidArchives.get(path);
+ if (evictionTime == null)
+ return false;
+ long now = System.currentTimeMillis();
+
+ // If the TTL for this cache entry has expired, directly check whether the archive is still invalid.
+ // If it transitioned to being valid, remove it from the cache and force an update to project caches.
+ if (now > evictionTime) {
+ try {
+ getZipFile(path, false);
+ removeFromInvalidArchiveCache(path);
+ return false;
+ } catch (CoreException e) {
+ // Archive is still invalid, fall through to reporting it is invalid.
+ }
+ }
+ return true;
}
public void removeFromInvalidArchiveCache(IPath path) {
if (this.invalidArchives != null) {
- this.invalidArchives.remove(path);
+ if (this.invalidArchives.remove(path) != null) {
+ try {
+ // Bug 455042: Force an update of the JavaProjectElementInfo project caches.
+ for (IJavaProject project : getJavaModel().getJavaProjects()) {
+ if (project.findPackageFragmentRoot(path) != null) {
+ ((JavaProject) project).resetCaches();
+ }
+ }
+ } catch (JavaModelException e) {
+ Util.log(e, "Unable to retrieve the Java model."); //$NON-NLS-1$
+ }
+ }
}
}
@@ -3242,8 +3267,6 @@
private Set getClasspathListCache(String cacheName) throws CoreException {
if (cacheName == NON_CHAINING_JARS_CACHE)
return getNonChainingJarsCache();
- else if (cacheName == INVALID_ARCHIVES_CACHE)
- return this.invalidArchives;
else if (cacheName == EXTERNAL_FILES_CACHE)
return this.externalFiles;
else if (cacheName == ASSUMED_EXTERNAL_FILES_CACHE)
@@ -3932,6 +3955,10 @@
return null;
}
+ void removeFromJarTypeCache(BinaryType type) {
+ this.cache.removeFromJarTypeCache(type);
+ }
+
public void removePerProjectInfo(JavaProject javaProject, boolean removeExtJarInfo) {
synchronized(this.perProjectInfos) { // use the perProjectInfo collection as its own lock
IProject project = javaProject.getProject();
@@ -4341,7 +4368,6 @@
case ISaveContext.FULL_SAVE : {
// save non-chaining jar, invalid jar and external file caches on full save
saveClasspathListCache(NON_CHAINING_JARS_CACHE);
- saveClasspathListCache(INVALID_ARCHIVES_CACHE);
saveClasspathListCache(EXTERNAL_FILES_CACHE);
saveClasspathListCache(ASSUMED_EXTERNAL_FILES_CACHE);
@@ -4989,8 +5015,6 @@
public void startup() throws CoreException {
try {
- configurePluginDebugOptions();
-
// initialize Java model cache
this.cache = new JavaModelCache();
@@ -5043,6 +5067,9 @@
| IResourceChangeEvent.PRE_CLOSE
| IResourceChangeEvent.PRE_REFRESH);
+ // listen to resource changes affecting external annotations
+ ExternalAnnotationTracker.start(workspace);
+
startIndexing();
// process deltas since last activated in indexer thread so that indexes are up-to-date.
@@ -5099,6 +5126,8 @@
workspace.removeResourceChangeListener(this.deltaState);
workspace.removeSaveParticipant(JavaCore.PLUGIN_ID);
+ ExternalAnnotationTracker.shutdown(workspace);
+
// Stop listening to content-type changes
Platform.getContentTypeManager().removeContentTypeChangeListener(this);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.java
index d2a57dd..9c3820a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavaProject.java
@@ -1804,7 +1804,7 @@
return getPackageFragmentRoot(resource, null/*no entry path*/);
}
- private IPackageFragmentRoot getPackageFragmentRoot(IResource resource, IPath entryPath) {
+ IPackageFragmentRoot getPackageFragmentRoot(IResource resource, IPath entryPath) {
switch (resource.getType()) {
case IResource.FILE:
return new JarPackageFragmentRoot(resource, this);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.java
index c6d1ba4..d588814 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -32,6 +32,7 @@
char[] NESTED_CLASS_SUMMARY = "<!-- ======== NESTED CLASS SUMMARY ======== -->".toCharArray(); //$NON-NLS-1$
String PACKAGE_FILE_NAME = "package-summary.html"; //$NON-NLS-1$
char[] PACKAGE_DESCRIPTION_START = "name=\"package_description\"".toCharArray(); //$NON-NLS-1$
+ char[] PACKAGE_DESCRIPTION_START2 = "name=\"package.description\"".toCharArray(); //$NON-NLS-1$
char[] H2_PREFIX = "<H2".toCharArray(); //$NON-NLS-1$
char[] H2_SUFFIX = "</H2>".toCharArray(); //$NON-NLS-1$
int H2_SUFFIX_LENGTH = H2_SUFFIX.length;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.java
index 07331d6..b473ae1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/JavadocContents.java
@@ -87,7 +87,10 @@
public String getPackageDoc() throws JavaModelException {
if (this.content == null) return null;
int[] range = null;
- int index = CharOperation.indexOf(JavadocConstants.PACKAGE_DESCRIPTION_START, this.content, false, 0);
+ int index = CharOperation.indexOf(JavadocConstants.PACKAGE_DESCRIPTION_START2, this.content, false, 0);
+ if (index == -1) {
+ index = CharOperation.indexOf(JavadocConstants.PACKAGE_DESCRIPTION_START, this.content, false, 0);
+ }
if (index == -1) return null;
index = CharOperation.indexOf(JavadocConstants.ANCHOR_SUFFIX, this.content, false, index);
if (index == -1) return null;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.java
index d5f3de8..4af0b9e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LambdaExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 IBM Corporation and others.
+ * Copyright (c) 2014, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 458613 - [1.8] lambda not shown in quick type hierarchy
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -20,6 +22,12 @@
import org.aspectj.org.eclipse.jdt.core.WorkingCopyOwner;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Substitution;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
import org.aspectj.org.eclipse.jdt.internal.core.util.MementoTokenizer;
import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
@@ -41,11 +49,50 @@
this.sourceStart = lambdaExpression.sourceStart;
this.sourceEnd = lambdaExpression.sourceEnd;
this.arrowPosition = lambdaExpression.arrowPosition;
- this.interphase = new String(CharOperation.replaceOnCopy(lambdaExpression.resolvedType.genericTypeSignature(), '/', '.'));
+
+ TypeBinding supertype = findLambdaSuperType(lambdaExpression);
+ this.interphase = new String(CharOperation.replaceOnCopy(supertype.genericTypeSignature(), '/', '.'));
this.elementInfo = makeTypeElementInfo(this, this.interphase, this.sourceStart, this.sourceEnd, this.arrowPosition);
this.lambdaMethod = LambdaFactory.createLambdaMethod(this, lambdaExpression);
this.elementInfo.children = new IJavaElement[] { this.lambdaMethod };
}
+
+ public TypeBinding findLambdaSuperType(org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression lambdaExpression) {
+ // start from the specific type, ignoring type arguments:
+ TypeBinding original = lambdaExpression.resolvedType.original();
+ // infer type arguments from here:
+ final TypeBinding descType = lambdaExpression.descriptor.declaringClass;
+ if (descType instanceof ParameterizedTypeBinding) {
+ final ParameterizedTypeBinding descPTB = (ParameterizedTypeBinding) descType;
+ // intermediate type: original pulled up to the level of descType:
+ final TypeBinding originalSuper = original.findSuperTypeOriginatingFrom(descType);
+ return Scope.substitute(new Substitution() {
+ @Override
+ public TypeBinding substitute(TypeVariableBinding typeVariable) {
+ if (originalSuper instanceof ParameterizedTypeBinding) {
+ ParameterizedTypeBinding originalSuperPTB = (ParameterizedTypeBinding) originalSuper;
+ TypeBinding[] superArguments = originalSuperPTB.arguments;
+ for (int i = 0; i < superArguments.length; i++) {
+ // if originalSuper holds typeVariable as it i'th argument, then the i'th argument of descType is our answer:
+ if (TypeBinding.equalsEquals(superArguments[i], typeVariable))
+ return descPTB.arguments[i];
+ }
+ }
+ // regular substitution:
+ return descPTB.substitute(typeVariable);
+ }
+ @Override
+ public boolean isRawSubstitution() {
+ return descPTB.isRawType();
+ }
+ @Override
+ public LookupEnvironment environment() {
+ return descPTB.environment;
+ }
+ }, original);
+ }
+ return original;
+ }
// Construction from memento
LambdaExpression(JavaElement parent, String interphase, int sourceStart, int sourceEnd, int arrowPosition) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.java
index 13b59e2..9a16795 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/LocalVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 466308 - [hovering] Javadoc header for parameter is wrong with annotation-based null analysis
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -459,6 +461,32 @@
return true;
}
+ /**
+ * @see org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding#computeUniqueKey()
+ */
+ public String getKey(boolean forceOpen) throws JavaModelException {
+ if (this.parent.getElementType() == IJavaElement.METHOD) {
+ StringBuilder buf = new StringBuilder();
+ if (this.parent instanceof BinaryMethod)
+ buf.append(((BinaryMethod) this.parent).getKey(forceOpen));
+ else
+ buf.append(((IMethod)this.parent).getKey());
+ buf.append('#');
+ buf.append(this.name);
+ if (this.isParameter) {
+ ILocalVariable[] parameters = ((IMethod) this.parent).getParameters();
+ for (int i = 0; i < parameters.length; i++) {
+ if (this.equals(parameters[i])) {
+ buf.append("#0#").append(i); // always first occurrence, followed by parameter rank //$NON-NLS-1$
+ break;
+ }
+ }
+ }
+ return buf.toString();
+ }
+ return null;
+ }
+
protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) {
buffer.append(tabString(tab));
if (info != NO_INFO) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.java
index 9ab8c12..beedeb7 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/NameLookup.java
@@ -1174,6 +1174,12 @@
*/
ICompilationUnit cu = (ICompilationUnit) type.getParent();
String cuName = cu.getElementName().substring(0, cu.getElementName().lastIndexOf('.'));
+ /*
+ * Secondary types along with primary types have their parent as the compilation unit.
+ * The names of the primary type would match with their compilation unit.
+ */
+ if (!cuName.equals(type.getElementName()))
+ return false;
if (partialMatch) {
return cuName.regionMatches(0, name, 0, name.length());
} else {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.java
index d3223af..314d9f4 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/OpenableElementInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Vladimir Piskarev <pisv@1c.ru> - Thread safety of OpenableElementInfo - https://bugs.eclipse.org/450490
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -20,7 +21,7 @@
* object. This is an empty array if this element has
* no children.
*/
- protected IJavaElement[] children = JavaElement.NO_ELEMENTS;
+ protected volatile IJavaElement[] children = JavaElement.NO_ELEMENTS;
/**
* Is the structure of this element known
@@ -29,16 +30,19 @@
protected boolean isStructureKnown = false;
public void addChild(IJavaElement child) {
- int length = this.children.length;
+ IJavaElement[] oldChildren = this.children;
+ int length = oldChildren.length;
if (length == 0) {
this.children = new IJavaElement[] {child};
} else {
for (int i = 0; i < length; i++) {
- if (this.children[i].equals(child))
+ if (oldChildren[i].equals(child))
return; // already included
}
- System.arraycopy(this.children, 0, this.children = new IJavaElement[length+1], 0, length);
- this.children[length] = child;
+ IJavaElement[] newChildren = new IJavaElement[length+1];
+ System.arraycopy(oldChildren, 0, newChildren, 0, length);
+ newChildren[length] = child;
+ this.children = newChildren;
}
}
@@ -54,16 +58,16 @@
}
public void removeChild(IJavaElement child) {
- for (int i = 0, length = this.children.length; i < length; i++) {
- IJavaElement element = this.children[i];
- if (element.equals(child)) {
+ IJavaElement[] oldChildren = this.children;
+ for (int i = 0, length = oldChildren.length; i < length; i++) {
+ if (oldChildren[i].equals(child)) {
if (length == 1) {
this.children = JavaElement.NO_ELEMENTS;
} else {
IJavaElement[] newChildren = new IJavaElement[length-1];
- System.arraycopy(this.children, 0, newChildren , 0, i);
+ System.arraycopy(oldChildren, 0, newChildren , 0, i);
if (i < length-1)
- System.arraycopy(this.children, i+1, newChildren, i, length-1-i);
+ System.arraycopy(oldChildren, i+1, newChildren, i, length-1-i);
this.children = newChildren;
}
break;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.java
index 3f34944..9549b14 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryField.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for Bug 464615 - [dom] ASTParser.createBindings() ignores parameterization of a method invocation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -33,6 +34,10 @@
return this.uniqueKey;
}
+ public String getKey(boolean forceOpen) {
+ return this.uniqueKey;
+ }
+
/* (non-Javadoc)
* @see org.aspectj.org.eclipse.jdt.core.IField#isResolved()
*/
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java
index 831e22d..6577f4f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,9 +7,12 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for Bug 464615 - [dom] ASTParser.createBindings() ignores parameterization of a method invocation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+
/**
* Handle representing a binary method that is resolved.
* The uniqueKey contains the genericSignature of the resolved method. Use BindingKey to decode it.
@@ -31,6 +34,12 @@
public String getKey() {
return this.uniqueKey;
}
+
+ @Override
+ public String getKey(boolean forceOpen) throws JavaModelException {
+ return this.uniqueKey;
+ }
+
/* (non-Javadoc)
* @see org.aspectj.org.eclipse.jdt.core.IMethod#isResolved()
*/
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.java
index 96f0431..1520c7c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/ResolvedBinaryType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for Bug 464615 - [dom] ASTParser.createBindings() ignores parameterization of a method invocation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -38,6 +39,11 @@
public String getKey() {
return this.uniqueKey;
}
+
+ @Override
+ public String getKey(boolean forceOpen) throws JavaModelException {
+ return this.uniqueKey;
+ }
/* (non-Javadoc)
* @see org.aspectj.org.eclipse.jdt.internal.core.BinaryType#isResolved()
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.java
index 67ac620..23557e7 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SelectionRequestor.java
@@ -463,7 +463,7 @@
local.declarationSourceEnd,
local.sourceStart,
local.sourceEnd,
- local.type == null ? Signature.createTypeSignature(binding.type.readableName(), true) : Util.typeSignature(local.type),
+ local.type == null ? Signature.createTypeSignature(binding.type.signableName(), true) : Util.typeSignature(local.type),
local.annotations,
local.modifiers,
local.getKind() == AbstractVariableDeclaration.PARAMETER);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.java
index 32a3319..0a83308 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SortElementsOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -191,56 +191,66 @@
ast.accept(new ASTVisitor() {
public boolean visit(org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit compilationUnit) {
List types = compilationUnit.types();
+ boolean contains_malformed_nodes = false;
for (Iterator iter = types.iterator(); iter.hasNext();) {
AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) iter.next();
typeDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(typeDeclaration.getStartPosition()));
- compilationUnit.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(typeDeclaration)));
+ contains_malformed_nodes |= Boolean.valueOf(isMalformed(typeDeclaration));
}
+ compilationUnit.setProperty(CONTAINS_MALFORMED_NODES, contains_malformed_nodes);
return true;
}
public boolean visit(AnnotationTypeDeclaration annotationTypeDeclaration) {
List bodyDeclarations = annotationTypeDeclaration.bodyDeclarations();
+ boolean contains_malformed_nodes = false;
for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
bodyDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
- annotationTypeDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
+ contains_malformed_nodes |= Boolean.valueOf(isMalformed(bodyDeclaration));
}
+ annotationTypeDeclaration.setProperty(CONTAINS_MALFORMED_NODES, contains_malformed_nodes);
return true;
}
public boolean visit(AnonymousClassDeclaration anonymousClassDeclaration) {
List bodyDeclarations = anonymousClassDeclaration.bodyDeclarations();
+ boolean contains_malformed_nodes = false;
for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
bodyDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
- anonymousClassDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
+ contains_malformed_nodes |= Boolean.valueOf(isMalformed(bodyDeclaration));
}
+ anonymousClassDeclaration.setProperty(CONTAINS_MALFORMED_NODES, contains_malformed_nodes);
return true;
}
public boolean visit(TypeDeclaration typeDeclaration) {
List bodyDeclarations = typeDeclaration.bodyDeclarations();
+ boolean contains_malformed_nodes = false;
for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
bodyDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
- typeDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
+ contains_malformed_nodes |= Boolean.valueOf(isMalformed(bodyDeclaration));
}
+ typeDeclaration.setProperty(CONTAINS_MALFORMED_NODES, contains_malformed_nodes);
return true;
}
public boolean visit(EnumDeclaration enumDeclaration) {
List bodyDeclarations = enumDeclaration.bodyDeclarations();
+ boolean contains_malformed_nodes = false;
for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
bodyDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
- enumDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
+ contains_malformed_nodes |= Boolean.valueOf(isMalformed(bodyDeclaration));
}
List enumConstants = enumDeclaration.enumConstants();
for (Iterator iter = enumConstants.iterator(); iter.hasNext();) {
EnumConstantDeclaration enumConstantDeclaration = (EnumConstantDeclaration) iter.next();
enumConstantDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(enumConstantDeclaration.getStartPosition()));
- enumDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(enumConstantDeclaration)));
+ contains_malformed_nodes |= Boolean.valueOf(isMalformed(enumConstantDeclaration));
}
+ enumDeclaration.setProperty(CONTAINS_MALFORMED_NODES, contains_malformed_nodes);
return true;
}
});
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SourceType.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SourceType.java
index 94e5eb0..5cc03cc 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SourceType.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/SourceType.java
@@ -181,6 +181,8 @@
}
public boolean equals(Object o) {
if (!(o instanceof SourceType)) return false;
+ if (((SourceType) o).isLambda())
+ return false;
return super.equals(o);
}
/*
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.java
index 7960229..9b3bf30 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 466279 - [hovering] IAE on hover when annotation-based null analysis is enabled
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core;
@@ -77,6 +79,25 @@
protected char getHandleMementoDelimiter() {
return JavaElement.JEM_TYPE_PARAMETER;
}
+
+ public String getKey(boolean forceOpen) throws JavaModelException {
+ StringBuilder buf = new StringBuilder();
+ if (this.parent instanceof IType) {
+ if (this.parent instanceof BinaryType)
+ buf.append(((BinaryType) this.parent).getKey(forceOpen));
+ else
+ buf.append(((IType) this.parent).getKey());
+ } else if (this.parent instanceof IMember) {
+ if (this.parent instanceof BinaryMember)
+ buf.append(((BinaryMember) this.parent).getKey(forceOpen));
+ else
+ buf.append(((IMethod) this.parent).getKey());
+ }
+ buf.append(":T"); //$NON-NLS-1$
+ buf.append(this.name);
+ buf.append(';');
+ return buf.toString();
+ }
public ISourceRange getNameRange() throws JavaModelException {
SourceMapper mapper= getSourceMapper();
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.java
index f821165..86f60ca 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/TypeVector.java
@@ -52,25 +52,9 @@
this.size += newElements.length;
}
public boolean contains(IType element) {
- for (int i = this.size; --i >= 0;) {
- /* Note: When creating new subtypes of RST, need to check whether this code
- * which gives special treatment to lambda needs modification or not - refer to bug 436139
- * An alternate could have been the following:
- * if (element.equals(this.elements[i) && this.elements[i].equals(element)) return true;
- * but the above has the issue of repeating the steps in most of the cases.
- */
- IType firstElement = null;
- IType secondElement = null;
- if (element.isLambda()) {
- firstElement = element;
- secondElement = this.elements[i];
- } else {
- firstElement = this.elements[i];
- secondElement = element;
- }
- if (firstElement.equals(secondElement))
+ for (int i = this.size; --i >= 0;)
+ if (element.equals(this.elements[i]))
return true;
- }
return false;
}
public TypeVector copy() {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
index 59f7a4a..bb620aa 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,8 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Tal Lev-Ami - added package cache for zip files
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.builder;
@@ -81,12 +83,14 @@
String zipFilename; // keep for equals
IFile resource;
ZipFile zipFile;
+ZipFile annotationZipFile;
long lastModified;
boolean closeZipFileAtEnd;
SimpleSet knownPackageNames;
AccessRuleSet accessRuleSet;
+String externalAnnotationPath;
-ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) {
+ClasspathJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath) {
this.resource = resource;
try {
java.net.URI location = resource.getLocationURI();
@@ -102,31 +106,46 @@
this.zipFile = null;
this.knownPackageNames = null;
this.accessRuleSet = accessRuleSet;
+ if (externalAnnotationPath != null)
+ this.externalAnnotationPath = externalAnnotationPath.toString();
}
-ClasspathJar(String zipFilename, long lastModified, AccessRuleSet accessRuleSet) {
+ClasspathJar(String zipFilename, long lastModified, AccessRuleSet accessRuleSet, IPath externalAnnotationPath) {
this.zipFilename = zipFilename;
this.lastModified = lastModified;
this.zipFile = null;
this.knownPackageNames = null;
this.accessRuleSet = accessRuleSet;
+ if (externalAnnotationPath != null)
+ this.externalAnnotationPath = externalAnnotationPath.toString();
}
-public ClasspathJar(ZipFile zipFile, AccessRuleSet accessRuleSet) {
+public ClasspathJar(ZipFile zipFile, AccessRuleSet accessRuleSet, IPath externalAnnotationPath) {
this.zipFilename = zipFile.getName();
this.zipFile = zipFile;
this.closeZipFileAtEnd = false;
this.knownPackageNames = null;
this.accessRuleSet = accessRuleSet;
+ if (externalAnnotationPath != null)
+ this.externalAnnotationPath = externalAnnotationPath.toString();
}
public void cleanup() {
- if (this.zipFile != null && this.closeZipFileAtEnd) {
- try {
- this.zipFile.close();
- } catch(IOException e) { // ignore it
+ if (this.closeZipFileAtEnd) {
+ if (this.zipFile != null) {
+ try {
+ this.zipFile.close();
+ } catch(IOException e) { // ignore it
+ }
+ this.zipFile = null;
}
- this.zipFile = null;
+ if (this.annotationZipFile != null) {
+ try {
+ this.annotationZipFile.close();
+ } catch(IOException e) { // ignore it
+ }
+ this.annotationZipFile = null;
+ }
}
this.knownPackageNames = null;
}
@@ -148,9 +167,16 @@
try {
ClassFileReader reader = ClassFileReader.read(this.zipFile, qualifiedBinaryFileName);
if (reader != null) {
+ String fileNameWithoutExtension = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - SuffixConstants.SUFFIX_CLASS.length);
+ if (this.externalAnnotationPath != null) {
+ try {
+ this.annotationZipFile = reader.setExternalAnnotationProvider(this.externalAnnotationPath, fileNameWithoutExtension, this.annotationZipFile, null);
+ } catch (IOException e) {
+ // don't let error on annotations fail class reading
+ }
+ }
if (this.accessRuleSet == null)
return new NameEnvironmentAnswer(reader, null);
- String fileNameWithoutExtension = qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - SuffixConstants.SUFFIX_CLASS.length);
return new NameEnvironmentAnswer(reader, this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()));
}
} catch (IOException e) { // treat as if class file is missing
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
index 805441f..a28b52a 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/ClasspathLocation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.builder;
@@ -26,16 +28,16 @@
return new ClasspathDirectory(binaryFolder, isOutputFolder, accessRuleSet);
}
-static ClasspathLocation forLibrary(String libraryPathname, long lastModified, AccessRuleSet accessRuleSet) {
- return new ClasspathJar(libraryPathname, lastModified, accessRuleSet);
+static ClasspathLocation forLibrary(String libraryPathname, long lastModified, AccessRuleSet accessRuleSet, IPath annotationsPath) {
+ return new ClasspathJar(libraryPathname, lastModified, accessRuleSet, annotationsPath);
}
-static ClasspathLocation forLibrary(String libraryPathname, AccessRuleSet accessRuleSet) {
- return forLibrary(libraryPathname, 0, accessRuleSet);
+static ClasspathLocation forLibrary(String libraryPathname, AccessRuleSet accessRuleSet, IPath annotationsPath) {
+ return forLibrary(libraryPathname, 0, accessRuleSet, annotationsPath);
}
-static ClasspathLocation forLibrary(IFile library, AccessRuleSet accessRuleSet) {
- return new ClasspathJar(library, accessRuleSet);
+static ClasspathLocation forLibrary(IFile library, AccessRuleSet accessRuleSet, IPath annotationsPath) {
+ return new ClasspathJar(library, accessRuleSet, annotationsPath);
}
public abstract NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String qualifiedBinaryFileName);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
index 2cacf38..7c24903 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/NameEnvironment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
* - Another problem with inner classes referenced from jars or class folders: "The type ... cannot be resolved"
* Stephan Herrmann - Contribution for
* Bug 392727 - Cannot compile project when a java file contains $ in its file name
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.builder;
@@ -103,6 +104,7 @@
ClasspathEntry entry = (ClasspathEntry) classpathEntries[i];
IPath path = entry.getPath();
Object target = JavaModel.getTarget(path, true);
+ IPath externalAnnotationPath = ClasspathEntry.getExternalAnnotationPath(entry, javaProject.getProject(), true);
if (target == null) continue nextEntry;
switch(entry.getEntryKind()) {
@@ -172,7 +174,7 @@
&& JavaCore.IGNORE.equals(javaProject.getOption(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, true)))
? null
: entry.getAccessRuleSet();
- bLocation = ClasspathLocation.forLibrary((IFile) resource, accessRuleSet);
+ bLocation = ClasspathLocation.forLibrary((IFile) resource, accessRuleSet, externalAnnotationPath);
} else if (resource instanceof IContainer) {
AccessRuleSet accessRuleSet =
(JavaCore.IGNORE.equals(javaProject.getOption(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, true))
@@ -200,7 +202,7 @@
&& JavaCore.IGNORE.equals(javaProject.getOption(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, true)))
? null
: entry.getAccessRuleSet();
- bLocations.add(ClasspathLocation.forLibrary(path.toString(), accessRuleSet));
+ bLocations.add(ClasspathLocation.forLibrary(path.toString(), accessRuleSet, externalAnnotationPath));
}
continue nextEntry;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/State.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/State.java
index b8910cb..15d376b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/State.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/builder/State.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.builder;
@@ -45,7 +47,7 @@
private StringSet structurallyChangedTypes;
public static int MaxStructurallyChangedTypes = 100; // keep track of ? structurally changed types, otherwise consider all to be changed
-public static final byte VERSION = 0x001B;
+public static final byte VERSION = 0x001C;
static final byte SOURCE_FOLDER = 1;
static final byte BINARY_FOLDER = 2;
@@ -269,10 +271,10 @@
newState.binaryLocations[i] = ClasspathLocation.forBinaryFolder(outputFolder, in.readBoolean(), readRestriction(in));
break;
case EXTERNAL_JAR :
- newState.binaryLocations[i] = ClasspathLocation.forLibrary(in.readUTF(), in.readLong(), readRestriction(in));
+ newState.binaryLocations[i] = ClasspathLocation.forLibrary(in.readUTF(), in.readLong(), readRestriction(in), new Path(in.readUTF()));
break;
case INTERNAL_JAR :
- newState.binaryLocations[i] = ClasspathLocation.forLibrary(root.getFile(new Path(in.readUTF())), readRestriction(in));
+ newState.binaryLocations[i] = ClasspathLocation.forLibrary(root.getFile(new Path(in.readUTF())), readRestriction(in), new Path(in.readUTF()));
}
}
@@ -463,6 +465,7 @@
out.writeUTF(jar.resource.getFullPath().toString());
}
writeRestriction(jar.accessRuleSet, out);
+ out.writeUTF(jar.externalAnnotationPath != null ? jar.externalAnnotationPath : ""); //$NON-NLS-1$
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index 92e7a67..5a90b69 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -264,6 +264,9 @@
return this.lineInfo;
}
+ final LineCommentEndOffsets getLineCommentEndOffsets() {
+ return this.lineCommentEndOffsets;
+ }
/**
* Returns the extended source range for a node.
*
@@ -590,6 +593,19 @@
return !isInsertBoundToPrevious(node);
}
+ private boolean lineCommentSwallowsActualCode(int prevEnd) {
+ if (ASTRewriteAnalyzer.this.getLineCommentEndOffsets().isEndOfLineComment(prevEnd)) {
+ int lastEndOffset = getEndOfNode((ASTNode) this.list[this.list.length - 1].getOriginalValue());
+ LineInformation lInfo = ASTRewriteAnalyzer.this.getLineInformation();
+ try {
+ return lInfo.getLineOfOffset(lastEndOffset) == lInfo.getLineOfOffset(getScanner().getNextStartOffset(lastEndOffset, false));
+ } catch (CoreException e) {
+ // ignore
+ }
+ }
+ return false;
+ }
+
protected boolean mustRemoveSeparator(int originalOffset, int nodeIndex) {
return true;
}
@@ -717,6 +733,7 @@
// is last, remove previous separator: split delete to allow range copies
doTextRemove(prevEnd, currPos - prevEnd, editGroup); // remove separator
doTextRemoveAndVisit(currPos, currEnd - currPos, node, editGroup); // remove node
+ if (lineCommentSwallowsActualCode(prevEnd)) doTextInsert(currEnd, getLineDelimiter(), editGroup);
currPos= currEnd;
prevEnd= currEnd;
} else {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java
deleted file mode 100644
index fcdf40a..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/ImportRewriteAnalyzer.java
+++ /dev/null
@@ -1,1522 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contribution for Bug 378024 - Ordering of comments between imports not preserved
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.aspectj.org.eclipse.jdt.core.IBuffer;
-import org.aspectj.org.eclipse.jdt.core.ICompilationUnit;
-import org.aspectj.org.eclipse.jdt.core.IJavaElement;
-import org.aspectj.org.eclipse.jdt.core.JavaCore;
-import org.aspectj.org.eclipse.jdt.core.JavaModelException;
-import org.aspectj.org.eclipse.jdt.core.Signature;
-import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
-import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
-import org.aspectj.org.eclipse.jdt.core.dom.Comment;
-import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
-import org.aspectj.org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.aspectj.org.eclipse.jdt.core.dom.LineComment;
-import org.aspectj.org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
-import org.aspectj.org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.aspectj.org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.aspectj.org.eclipse.jdt.core.search.SearchEngine;
-import org.aspectj.org.eclipse.jdt.core.search.TypeNameRequestor;
-import org.aspectj.org.eclipse.jdt.internal.core.JavaProject;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.text.edits.DeleteEdit;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public final class ImportRewriteAnalyzer {
-
- private final ICompilationUnit compilationUnit;
- private final ArrayList packageEntries;
-
- private final List importsCreated;
- private final List staticImportsCreated;
-
- private final IRegion replaceRange;
-
- private final int importOnDemandThreshold;
- private final int staticImportOnDemandThreshold;
-
- private boolean filterImplicitImports;
- private boolean useContextToFilterImplicitImports;
- private boolean findAmbiguousImports;
-
- private IRegion[] preserveExistingCommentsRanges;
-
- private int flags= 0;
-
- private static final int F_NEEDS_LEADING_DELIM= 2;
- private static final int F_NEEDS_TRAILING_DELIM= 4;
-
- private static final String JAVA_LANG= "java.lang"; //$NON-NLS-1$
-
- public ImportRewriteAnalyzer(
- ICompilationUnit cu,
- CompilationUnit root,
- String[] importOrder,
- int threshold,
- int staticThreshold,
- boolean restoreExistingImports,
- boolean useContextToFilterImplicitImports) {
- this.compilationUnit= cu;
- this.importOnDemandThreshold= threshold;
- this.staticImportOnDemandThreshold= staticThreshold;
- this.useContextToFilterImplicitImports = useContextToFilterImplicitImports;
-
- this.filterImplicitImports= true;
- this.findAmbiguousImports= true; //!restoreExistingImports;
-
- this.packageEntries= new ArrayList(20);
- this.importsCreated= new ArrayList();
- this.staticImportsCreated= new ArrayList();
- this.flags= 0;
-
- this.replaceRange= evaluateReplaceRange(root);
- if (restoreExistingImports) {
- addExistingImports(root);
- } else {
- // collect all existing comments inside imports and concatenate them
- this.preserveExistingCommentsRanges = retrieveExistingCommentsInImports(root);
- }
-
- PackageEntry[] order= new PackageEntry[importOrder.length];
- for (int i= 0; i < order.length; i++) {
- String curr= importOrder[i];
- if (curr.length() > 0 && curr.charAt(0) == '#') {
- curr= curr.substring(1);
- order[i]= new PackageEntry(curr, curr, true); // static import group
- } else {
- order[i]= new PackageEntry(curr, curr, false); // normal import group
- }
- }
-
- addPreferenceOrderHolders(order);
- }
-
- private int getSpacesBetweenImportGroups() {
- try {
- int num= Integer.parseInt(this.compilationUnit.getJavaProject().getOption(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, true));
- if (num >= 0)
- return num;
- } catch (NumberFormatException e) {
- // fall through
- }
- return 1;
- }
-
- private boolean insertSpaceBeforeSemicolon() {
- return JavaCore.INSERT.equals(this.compilationUnit.getJavaProject().getOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, true));
- }
-
- private void addPreferenceOrderHolders(PackageEntry[] preferenceOrder) {
- if (this.packageEntries.isEmpty()) {
- // all new: copy the elements
- for (int i= 0; i < preferenceOrder.length; i++) {
- this.packageEntries.add(preferenceOrder[i]);
- }
- } else {
- // match the preference order entries to existing imports
- // entries not found are appended after the last successfully matched entry
-
- PackageEntry[] lastAssigned= new PackageEntry[preferenceOrder.length];
-
- // find an existing package entry that matches most
- for (int k= 0; k < this.packageEntries.size(); k++) {
- PackageEntry entry= (PackageEntry) this.packageEntries.get(k);
- if (!entry.isComment()) {
- String currName= entry.getName();
- int currNameLen= currName.length();
- int bestGroupIndex= -1;
- int bestGroupLen= -1;
- for (int i= 0; i < preferenceOrder.length; i++) {
- boolean currPrevStatic= preferenceOrder[i].isStatic();
- if (currPrevStatic == entry.isStatic()) {
- String currPrefEntry= preferenceOrder[i].getName();
- int currPrefLen= currPrefEntry.length();
- if (currName.startsWith(currPrefEntry) && currPrefLen >= bestGroupLen) {
- if (currPrefLen == currNameLen || currName.charAt(currPrefLen) == '.') {
- if (bestGroupIndex == -1 || currPrefLen > bestGroupLen) {
- bestGroupLen= currPrefLen;
- bestGroupIndex= i;
- }
- }
- }
- }
- }
- if (bestGroupIndex != -1) {
- entry.setGroupID(preferenceOrder[bestGroupIndex].getName());
- lastAssigned[bestGroupIndex]= entry; // remember last entry
- }
- }
- }
- // fill in not-assigned categories, keep partial order
- int currAppendIndex= 0;
- for (int i= 0; i < lastAssigned.length; i++) {
- PackageEntry entry= lastAssigned[i];
- if (entry == null) {
- PackageEntry newEntry= preferenceOrder[i];
- if (currAppendIndex == 0 && !newEntry.isStatic()) {
- currAppendIndex= getIndexAfterStatics();
- }
- this.packageEntries.add(currAppendIndex, newEntry);
- currAppendIndex++;
- } else {
- currAppendIndex= this.packageEntries.indexOf(entry) + 1;
- }
- }
- }
- }
-
- private String getQualifier(ImportDeclaration decl) {
- String name = decl.getName().getFullyQualifiedName();
- /*
- * If it's on demand import, return the fully qualified name. (e.g. pack1.Foo.* => pack.Foo, pack1.* => pack1)
- * This is because we need to have pack1.Foo.* and pack1.Bar under different qualifier groups.
- */
- if (decl.isOnDemand()) {
- return name;
- }
- return getQualifier(name, decl.isStatic());
- }
-
- private String getQualifier(String name, boolean isStatic) {
- // For static imports, return the Type name as well as part of the qualifier
- if (isStatic || !this.useContextToFilterImplicitImports) {
- return Signature.getQualifier(name);
- }
-
- char[] searchedName = name.toCharArray();
- int index = name.length();
- /* Stop at the last fragment */
- JavaProject project = (JavaProject) this.compilationUnit.getJavaProject();
- do {
- String testedName = new String(searchedName, 0, index);
- IJavaElement fragment = null;
- try {
- fragment = project.findPackageFragment(testedName);
- } catch (JavaModelException e) {
- return name;
- }
- if (fragment != null) {
- return testedName;
- }
- try {
- fragment = project.findType(testedName);
- } catch (JavaModelException e) {
- return name;
- }
- if (fragment != null) {
- index = CharOperation.lastIndexOf(Signature.C_DOT, searchedName, 0, index - 1);
- } else {
- // we use the heuristic that a name starting with a lowercase is a package name
- index = CharOperation.lastIndexOf(Signature.C_DOT, searchedName, 0, index - 1);
- if (Character.isLowerCase(searchedName[index + 1])) {
- return testedName;
- }
- }
- } while (index >= 0);
- return name;
- }
-
- private static String getFullName(ImportDeclaration decl) {
- String name= decl.getName().getFullyQualifiedName();
- return decl.isOnDemand() ? name + ".*": name; //$NON-NLS-1$
- }
-
- private void addExistingImports(CompilationUnit root) {
- List/*ImportDeclaration*/ decls= root.imports();
- if (decls.isEmpty()) {
- return;
- }
- PackageEntry currPackage= null;
-
- ImportDeclaration curr= (ImportDeclaration) decls.get(0);
- int currOffset= curr.getStartPosition();
- int currLength= curr.getLength();
- int currEndLine= root.getLineNumber(currOffset + currLength);
-
- for (int i= 1; i < decls.size(); i++) {
- boolean isStatic= curr.isStatic();
- String name= getFullName(curr);
- String packName= getQualifier(curr);
- if (currPackage == null || currPackage.compareTo(packName, isStatic) != 0) {
- currPackage= new PackageEntry(packName, null, isStatic);
- this.packageEntries.add(currPackage);
- }
-
- ImportDeclaration next= (ImportDeclaration) decls.get(i);
- int nextOffset= next.getStartPosition();
- int nextLength= next.getLength();
- int nextOffsetLine= root.getLineNumber(nextOffset);
-
- int extendedStart = root.getExtendedStartPosition(curr);
- int extendedLength = root.getExtendedLength(curr);
- if (extendedStart < this.replaceRange.getOffset()) {
- // don't touch the first comments before the start of import declarations
- extendedLength -= (currOffset - extendedStart);
- extendedStart = currOffset;
- }
-
- // if next import is on a different line, modify the end position to the next line begin offset
- int nextLineOffset = nextOffset; // offset at the start of next line. Next import may not start here
- if (currEndLine < nextOffsetLine) {
- currEndLine++;
- nextLineOffset = root.getPosition(currEndLine, 0);
- // There may be some leading comments (or line delimiters) before the next import. The start of those comments
- // is not the real start offset of the next import. So don't change nextOffset
- }
- // retrieve preceding and trailing comments if any
- IRegion rangeBefore = null;
- IRegion rangeAfter = null;
-
- if (currOffset > extendedStart) {
- rangeBefore = new Region(extendedStart, currOffset - extendedStart);
- }
- int currLen = curr.getLength();
- if (currLen < extendedLength - (currOffset - extendedStart)) {
- int currEndOffset = currOffset + currLen;
- int rangeBeforeLen = rangeBefore != null? rangeBefore.getLength() : 0;
- rangeAfter = new Region(currEndOffset, extendedLength - rangeBeforeLen - currLen);
- }
- currPackage.add(
- new ImportDeclEntry(
- packName.length(),
- name,
- isStatic,
- new Region(currOffset, nextLineOffset - currOffset), // should not include leading comments of next import, line delimiters, etc.
- rangeBefore,
- rangeAfter));
- currOffset= nextOffset;
- curr= next;
-
- // add a comment entry for spacing between imports
- if (currEndLine < nextOffsetLine) {
- nextOffset= root.getPosition(nextOffsetLine, 0);
-
- int length = nextOffset - nextLineOffset;
- if (length > 2) { // valid comment has at least two chars
- currPackage.add(new ImportDeclEntry(packName.length(), null, false, new Region(nextLineOffset, length)));
- }
-
- currOffset= nextOffset;
- }
- currEndLine= root.getLineNumber(nextOffset + nextLength);
- }
-
- boolean isStatic= curr.isStatic();
- String name= getFullName(curr);
- String packName= getQualifier(curr);
- if (currPackage == null || currPackage.compareTo(packName, isStatic) != 0) {
- currPackage= new PackageEntry(packName, null, isStatic);
- this.packageEntries.add(currPackage);
- }
- int currStartOffset = curr.getStartPosition();
- int currLen = curr.getLength();
- int extendedStartOffset = root.getExtendedStartPosition(curr);
- IRegion leadingComments = null;
- IRegion allTrailingComments = null;
-
- if (currStartOffset > extendedStartOffset) {
- leadingComments = new Region(extendedStartOffset, currOffset - extendedStartOffset);
- }
- int length= this.replaceRange.getOffset() + this.replaceRange.getLength() - currStartOffset;
- int extendedLength = root.getExtendedLength(curr);
- if (currLen < extendedLength - (currOffset - extendedStartOffset)) {
- int currEndOffset = currOffset + currLen;
- int leadingCommentsLen = leadingComments != null? leadingComments.getLength() : 0;
- allTrailingComments = new Region(currEndOffset, extendedLength - leadingCommentsLen - currLen);
- }
- currPackage.add(new ImportDeclEntry(packName.length(), name, isStatic, new Region(curr.getStartPosition(), length), leadingComments, allTrailingComments));
- }
-
- private IRegion[] retrieveExistingCommentsInImports(CompilationUnit root) {
- List/*ImportDeclaration*/ decls= root.imports();
- if (decls.isEmpty()) {
- return null;
- }
-
- List commentList = root.getCommentList();
- int numberOfComments = commentList.size();
- List regions = null;
- int currentExtendedEnd = -1;
- int currEndLine= -1;
-
- /* for the first comment, we only take the trailing comment if any and the replace range doesn't
- * include the preceding comment
- */
- for (int i= 0; i < decls.size(); i++) {
- ImportDeclaration next= (ImportDeclaration) decls.get(i);
- int nextOffset= next.getStartPosition();
- int nextLength= next.getLength();
-
- int extendedStart = root.getExtendedStartPosition(next);
- int extendedLength = root.getExtendedLength(next);
- int nextOffsetLine= root.getLineNumber(nextOffset);
-
- if (nextOffset != extendedStart) {
- // preceding comment
- int lengthOfPrecedingComment = nextOffset - extendedStart;
- if (i != 0) {
- if (regions == null) {
- regions = new ArrayList();
- }
- regions.add(new Region(extendedStart, lengthOfPrecedingComment));
- }
-
- if (extendedLength != (nextLength + lengthOfPrecedingComment)) {
- // Preceding and trailing comments
- int regionLength = extendedLength - (nextLength + lengthOfPrecedingComment);
- if (regions == null) {
- regions = new ArrayList();
- }
- regions.add(new Region(nextOffset + nextLength, regionLength));
- }
- } else if (nextLength != extendedLength) {
- // no extended start - only trailing comment
- int regionLength = extendedLength - nextLength;
- if (regions == null) {
- regions = new ArrayList();
- }
- regions.add(new Region(nextOffset + nextLength, regionLength));
- }
- if (i > 0) {
- // record comments between the previous comment and the current one that are not part
- // of any comment extended range.
- if ((nextOffsetLine - currEndLine) > 1) {
- // check for comments between the two imports
- LineComment comment = root.getAST().newLineComment();
- comment.setSourceRange(currentExtendedEnd + 1, 0);
- int index = Collections.binarySearch(commentList, comment, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((Comment) o1).getStartPosition() - ((Comment) o2).getStartPosition();
- }
- });
- // index = -(insertion point) - 1.
- if (index < 0) {
- loop: for (int j = -(index + 1); j < numberOfComments; j++) {
- Comment currentComment = (Comment) commentList.get(j);
- int commentStartPosition = currentComment.getStartPosition();
- int commentLength = currentComment.getLength();
- if ((commentStartPosition > currentExtendedEnd)
- && ((commentStartPosition + commentLength - 1) < extendedStart)) {
- if (regions == null) {
- regions = new ArrayList();
- }
- regions.add(new Region(commentStartPosition, commentLength));
- } else {
- break loop;
- }
- }
- }
- }
- }
- currentExtendedEnd = extendedStart + extendedLength - 1;
- currEndLine = root.getLineNumber(currentExtendedEnd);
- }
- if (regions == null) {
- return null;
- }
- // sort regions according to their positions to restore comments in the same order
- IRegion[] result = (IRegion[]) regions.toArray(new IRegion[regions.size()]);
- Arrays.sort(result, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((IRegion) o1).getOffset() - ((IRegion) o2).getOffset();
- }
- });
- return result;
- }
- /**
- * Specifies that implicit imports (for types in <code>java.lang</code>, types in the same package as the rewrite
- * compilation unit and types in the compilation unit's main type) should not be created, except if necessary to
- * resolve an on-demand import conflict.
- * <p>
- * The filter is enabled by default.
- * </p>
- * <p>
- * Note: {@link #ImportRewriteAnalyzer(ICompilationUnit, CompilationUnit, String[], int, int, boolean, boolean)} with true as the last
- * parameter can be used to filter implicit imports when a context is used.
- * </p>
- *
- * @param filterImplicitImports
- * if <code>true</code>, implicit imports will be filtered
- *
- * @see #ImportRewriteAnalyzer(ICompilationUnit, CompilationUnit, String[], int, int, boolean, boolean)
- */
- public void setFilterImplicitImports(boolean filterImplicitImports) {
- this.filterImplicitImports= filterImplicitImports;
- }
- /**
- * When set searches for imports that can not be folded into on-demand
- * imports but must be specified explicitly
- * @param findAmbiguousImports The new value
- */
- public void setFindAmbiguousImports(boolean findAmbiguousImports) {
- this.findAmbiguousImports= findAmbiguousImports;
- }
-
- private static class PackageMatcher {
- private String newName;
- private String bestName;
- private int bestMatchLen;
-
- public PackageMatcher() {
- // initialization in 'initialize'
- }
-
- public void initialize(String newImportName, String bestImportName) {
- this.newName= newImportName;
- this.bestName= bestImportName;
- this.bestMatchLen= getCommonPrefixLength(bestImportName, newImportName);
- }
-
- public boolean isBetterMatch(String currName, boolean preferCurr) {
- boolean isBetter;
- int currMatchLen= getCommonPrefixLength(currName, this.newName);
- int matchDiff= currMatchLen - this.bestMatchLen;
- if (matchDiff == 0) {
- if (currMatchLen == this.newName.length() && currMatchLen == currName.length() && currMatchLen == this.bestName.length()) {
- // duplicate entry and complete match
- isBetter= preferCurr;
- } else {
- isBetter= sameMatchLenTest(currName);
- }
- } else {
- isBetter= (matchDiff > 0); // curr has longer match
- }
- if (isBetter) {
- this.bestName= currName;
- this.bestMatchLen= currMatchLen;
- }
- return isBetter;
- }
-
- private boolean sameMatchLenTest(String currName) {
- int matchLen= this.bestMatchLen;
- // known: bestName and currName differ from newName at position 'matchLen'
- // currName and bestName don't have to differ at position 'matchLen'
-
- // determine the order and return true if currName is closer to newName
- char newChar= getCharAt(this.newName, matchLen);
- char currChar= getCharAt(currName, matchLen);
- char bestChar= getCharAt(this.bestName, matchLen);
-
- if (newChar < currChar) {
- if (bestChar < newChar) { // b < n < c
- return (currChar - newChar) < (newChar - bestChar); // -> (c - n) < (n - b)
- } else { // n < b && n < c
- if (currChar == bestChar) { // longer match between curr and best
- return false; // keep curr and best together, new should be before both
- } else {
- return currChar < bestChar; // -> (c < b)
- }
- }
- } else {
- if (bestChar > newChar) { // c < n < b
- return (newChar - currChar) < (bestChar - newChar); // -> (n - c) < (b - n)
- } else { // n > b && n > c
- if (currChar == bestChar) { // longer match between curr and best
- return true; // keep curr and best together, new should be ahead of both
- } else {
- return currChar > bestChar; // -> (c > b)
- }
- }
- }
- }
- }
-
- /* package */ static int getCommonPrefixLength(String s, String t) {
- int len= Math.min(s.length(), t.length());
- for (int i= 0; i < len; i++) {
- if (s.charAt(i) != t.charAt(i)) {
- return i;
- }
- }
- return len;
- }
-
- /* package */ static char getCharAt(String str, int index) {
- if (str.length() > index) {
- return str.charAt(index);
- }
- return 0;
- }
-
- private PackageEntry findBestMatch(String newName, boolean isStatic) {
- if (this.packageEntries.isEmpty()) {
- return null;
- }
- String groupId= null;
- int longestPrefix= -1;
- PackageEntry matchingCommentEntry = null;
- // find the matching group
- for (int i= 0; i < this.packageEntries.size(); i++) {
- PackageEntry curr= (PackageEntry) this.packageEntries.get(i);
- if (isStatic == curr.isStatic()) {
- String currGroup= curr.getGroupID();
- if (currGroup != null && newName.startsWith(currGroup)) {
- int prefixLen= currGroup.length();
- if (prefixLen == newName.length() && !curr.isComment()) {
- return curr; // perfect fit, use entry
- } else if (curr.isComment()) {
- matchingCommentEntry = curr; // may be the only fit if no actual import of this group is already present
- continue;
- }
- if ((newName.charAt(prefixLen) == '.' || prefixLen == 0) && prefixLen > longestPrefix) {
- longestPrefix= prefixLen;
- groupId= currGroup;
- }
- }
- }
- }
- if (matchingCommentEntry != null) {
- return matchingCommentEntry;
- }
- PackageEntry bestMatch= null;
- PackageMatcher matcher= new PackageMatcher();
- matcher.initialize(newName, ""); //$NON-NLS-1$
- for (int i= 0; i < this.packageEntries.size(); i++) { // find the best match with the same group
- PackageEntry curr= (PackageEntry) this.packageEntries.get(i);
- if (!curr.isComment() && curr.isStatic() == isStatic) {
- if (groupId == null || groupId.equals(curr.getGroupID())) {
- boolean preferrCurr= (bestMatch == null) || (curr.getNumberOfImports() > bestMatch.getNumberOfImports());
- if (matcher.isBetterMatch(curr.getName(), preferrCurr)) {
- bestMatch= curr;
- }
- }
- }
- }
- return bestMatch;
- }
-
- private boolean isImplicitImport(String qualifier) {
- if (JAVA_LANG.equals(qualifier)) {
- return true;
- }
- ICompilationUnit cu= this.compilationUnit;
- String packageName= cu.getParent().getElementName();
- if (qualifier.equals(packageName)) {
- return true;
- }
- String mainTypeName= JavaCore.removeJavaLikeExtension(cu.getElementName());
- if (packageName.length() == 0) {
- return qualifier.equals(mainTypeName);
- }
- return qualifier.equals(packageName +'.' + mainTypeName);
- }
-
- public void addImport(String fullTypeName, boolean isStatic, CompilationUnit root, boolean restoreExistingImports) {
- String typeContainerName= getQualifier(fullTypeName, isStatic);
- ImportDeclEntry decl;
- if (restoreExistingImports) {
- decl = new ImportDeclEntry(typeContainerName.length(), fullTypeName, isStatic, null);
- } else {
- decl = addImportDeclEntry(typeContainerName, fullTypeName, isStatic, root);
- }
- sortIn(typeContainerName, decl, isStatic);
- }
-
- /**
- * adds the import entry, but if its an existing import entry then preserves the comments surrounding the import
- */
- private ImportDeclEntry addImportDeclEntry(String containerName, String fullTypeName, boolean isStatic, CompilationUnit root) {
- List/*ImportDeclaration*/ decls= root.imports();
- if (decls.isEmpty() || this.preserveExistingCommentsRanges == null || this.preserveExistingCommentsRanges.length == 0) {
- return new ImportDeclEntry(containerName.length(), fullTypeName, isStatic, null);
- }
- IRegion precedingCommentRange = null;
- IRegion trailingCommentRange = null;
- int prevOffset = this.replaceRange.getOffset(); // will store offset of the previous import's extended end
- int numOfImports = decls.size();
- for (int i= 0; i < numOfImports; i++) {
- ImportDeclaration curr= (ImportDeclaration) decls.get(i);
- int currOffset= curr.getStartPosition();
- int currLength= curr.getLength();
- int currExtendedStart = root.getExtendedStartPosition(curr);
- int currExtendedLen = root.getExtendedLength(curr);
- String name= getFullName(curr);
- String packName= getQualifier(curr);
- if (packName.equals(containerName) && (name.equals(fullTypeName) || name.endsWith("*"))) {//$NON-NLS-1$
- int preserveCommentsLen = this.preserveExistingCommentsRanges.length;
- for (int j = 0; j < preserveCommentsLen; j++) {
- int offset = this.preserveExistingCommentsRanges[j].getOffset();
- boolean wasRangeUsed = false;
- int existingCommentLength = this.preserveExistingCommentsRanges[j].getLength();
- if (offset == currExtendedStart) {
- // comments belonging to this import's extended start
- precedingCommentRange = new Region(offset, existingCommentLength);
- wasRangeUsed = true;
- } else if (offset < currExtendedStart && offset > prevOffset) {
- // comment between two imports but not inside either's extended ranges
- // to preserve the position of these comments add a dummy comment entry
- PackageEntry commentEntry = new PackageEntry(); // create a comment package entry for this
- commentEntry.setGroupID(packName); // the comment should belong to the current group
- this.packageEntries.add(commentEntry);
- commentEntry.add(new ImportDeclEntry(packName.length(), null, false, new Region(offset, existingCommentLength)));
- wasRangeUsed = true;
- } else if ((currExtendedStart + currExtendedLen) != (currOffset + currLength)){
- if (offset == currOffset + currLength) {
- // comment is in the extended end of the import
- trailingCommentRange = new Region(offset, existingCommentLength);
- wasRangeUsed = true;
- } else if (offset > (currOffset + currLength)) {
- break;
- }
- }
- if (wasRangeUsed) {
- // remove this comment from preserveExistingCommentsRanges array
- IRegion[] tempRegions = new IRegion[--preserveCommentsLen];
- System.arraycopy(this.preserveExistingCommentsRanges, 0, tempRegions, 0, j);
- System.arraycopy(this.preserveExistingCommentsRanges, j+1, tempRegions, j, tempRegions.length - j);
- this.preserveExistingCommentsRanges = tempRegions;
- j--;
- }
- }
- return new ImportDeclEntry(containerName.length(), fullTypeName, isStatic, null, precedingCommentRange, trailingCommentRange);
- }
- prevOffset = currExtendedStart + currExtendedLen - 1;
- }
- return new ImportDeclEntry(containerName.length(), fullTypeName, isStatic, null);
- }
-
- public boolean removeImport(String qualifiedName, boolean isStatic) {
- String containerName= getQualifier(qualifiedName, isStatic);
-
- int nPackages= this.packageEntries.size();
- for (int i= 0; i < nPackages; i++) {
- PackageEntry entry= (PackageEntry) this.packageEntries.get(i);
- if (entry.compareTo(containerName, isStatic) == 0) {
- if (entry.remove(qualifiedName, isStatic)) {
- return true;
- }
- }
- }
- return false;
- }
-
- private int getIndexAfterStatics() {
- for (int i= 0; i < this.packageEntries.size(); i++) {
- if (!((PackageEntry) this.packageEntries.get(i)).isStatic()) {
- return i;
- }
- }
- return this.packageEntries.size();
- }
-
-
- private void sortIn(String typeContainerName, ImportDeclEntry decl, boolean isStatic) {
- PackageEntry bestMatch= findBestMatch(typeContainerName, isStatic);
- if (bestMatch == null) {
- PackageEntry packEntry= new PackageEntry(typeContainerName, null, isStatic);
- packEntry.add(decl);
- int insertPos= packEntry.isStatic() ? 0 : getIndexAfterStatics();
- this.packageEntries.add(insertPos, packEntry);
- } else {
- int cmp= typeContainerName.compareTo(bestMatch.getName());
- if (cmp == 0) {
- bestMatch.sortIn(decl);
- } else {
- // create a new package entry
- String group= bestMatch.getGroupID();
- if (group != null) {
- if (!typeContainerName.startsWith(group)) {
- group= null;
- }
- }
- PackageEntry packEntry= new PackageEntry(typeContainerName, group, isStatic);
- packEntry.add(decl);
- int index= this.packageEntries.indexOf(bestMatch);
- if (cmp < 0) {
- // insert ahead of best match
- this.packageEntries.add(index, packEntry);
- } else {
- // insert after best match
- this.packageEntries.add(index + 1, packEntry);
- }
- }
- }
- }
-
- private IRegion evaluateReplaceRange(CompilationUnit root) {
- List imports= root.imports();
- if (!imports.isEmpty()) {
- ImportDeclaration first= (ImportDeclaration) imports.get(0);
- ImportDeclaration last= (ImportDeclaration) imports.get(imports.size() - 1);
-
- int startPos= first.getStartPosition(); // no extended range for first: bug 121428
- int endPos= root.getExtendedStartPosition(last) + root.getExtendedLength(last);
- int endLine= root.getLineNumber(endPos);
- if (endLine > 0) {
- int nextLinePos= root.getPosition(endLine + 1, 0);
- if (nextLinePos >= 0) {
- int firstTypePos= getFirstTypeBeginPos(root);
- if (firstTypePos != -1 && firstTypePos < nextLinePos) {
- endPos= firstTypePos;
- } else {
- endPos= nextLinePos;
- }
- }
- }
- return new Region(startPos, endPos - startPos);
- } else {
- int start= getPackageStatementEndPos(root);
- return new Region(start, 0);
- }
- }
-
- public MultiTextEdit getResultingEdits(IProgressMonitor monitor) throws JavaModelException {
- if (monitor == null) {
- monitor= new NullProgressMonitor();
- }
- try {
- int importsStart= this.replaceRange.getOffset();
- int importsLen= this.replaceRange.getLength();
-
- String lineDelim= this.compilationUnit.findRecommendedLineSeparator();
- IBuffer buffer= this.compilationUnit.getBuffer();
-
- int currPos= importsStart;
- MultiTextEdit resEdit= new MultiTextEdit();
-
- if ((this.flags & F_NEEDS_LEADING_DELIM) != 0) {
- // new import container
- resEdit.addChild(new InsertEdit(currPos, lineDelim));
- }
-
- PackageEntry lastPackage= null;
-
- Set onDemandConflicts= null;
- if (this.findAmbiguousImports) {
- onDemandConflicts= evaluateStarImportConflicts(monitor);
- }
-
- int spacesBetweenGroups= getSpacesBetweenImportGroups();
-
- ArrayList stringsToInsert= new ArrayList();
-
- int nPackageEntries= this.packageEntries.size();
- for (int i= 0; i < nPackageEntries; i++) {
- PackageEntry pack= (PackageEntry) this.packageEntries.get(i);
- if (this.filterImplicitImports && !pack.isStatic() && isImplicitImport(pack.getName())) {
- pack.filterImplicitImports(this.useContextToFilterImplicitImports);
- }
- int nImports= pack.getNumberOfImports();
- if (nImports == 0) {
- continue;
- }
-
- if (spacesBetweenGroups > 0 && lastPackage != null) {
- // add a space between two different groups by looking at the two adjacent imports
- if (!lastPackage.isComment() && !pack.isComment() && !pack.isSameGroup(lastPackage)) {
- for (int k= spacesBetweenGroups; k > 0; k--) {
- stringsToInsert.add(lineDelim);
- }
- } else if (lastPackage.isComment() && pack.isSameGroup(lastPackage)) {
- // the last pack may be a dummy for a comment which doesn't belong to any extended range
- stringsToInsert.add(lineDelim);
- }
- }
- lastPackage= pack;
-
- boolean isStatic= pack.isStatic();
- int threshold= isStatic ? this.staticImportOnDemandThreshold : this.importOnDemandThreshold;
-
- boolean doStarImport= pack.hasStarImport(threshold, onDemandConflicts);
- boolean allImportsAddedToStar = false;
- if (doStarImport && (pack.find("*") == null)) { //$NON-NLS-1$
- String[] imports = getNewImportStrings(buffer, pack, isStatic, lineDelim);
- for (int j = 0, max = imports.length; j < max; j++) {
- stringsToInsert.add(imports[j]);
- }
- allImportsAddedToStar = true; // may still need to handle onDemandConflicts below
- }
-
- for (int k= 0; k < nImports; k++) {
- ImportDeclEntry currDecl= pack.getImportAt(k);
- IRegion region= currDecl.getSourceRange();
- boolean isConflict = !currDecl.isComment() && onDemandConflicts != null && onDemandConflicts.contains(currDecl.getSimpleName());
- boolean addRegularToStar = doStarImport && !currDecl.isOnDemand();
-
- if (region == null) { // new entry
- if (!addRegularToStar || isConflict) {
- IRegion rangeBefore = currDecl.getPrecedingCommentRange();
- IRegion rangeAfter = currDecl.getTrailingCommentRange();
- if (rangeBefore != null) {
- stringsToInsert.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
- }
-
- String trailingComment = null;
- if (rangeAfter != null) {
- trailingComment = buffer.getText(rangeAfter.getOffset(), rangeAfter.getLength());
- }
- String str= getNewImportString(currDecl.getElementName(), isStatic, trailingComment, lineDelim);
- stringsToInsert.add(str);
- } else if (addRegularToStar && !allImportsAddedToStar) {
- String simpleName = currDecl.getTypeQualifiedName();
- if (simpleName.indexOf('.') != -1) {
- String str= getNewImportString(currDecl.getElementName(), isStatic, lineDelim);
- if (stringsToInsert.indexOf(str) == -1) {
- stringsToInsert.add(str);
- }
- }
- }
- } else if (!addRegularToStar || isConflict) {
- int offset= region.getOffset();
- IRegion rangeBefore = currDecl.getPrecedingCommentRange();
- if (rangeBefore != null && currPos > rangeBefore.getOffset()) {
- // moved ahead of the leading comments, bring the currPos back
- currPos = rangeBefore.getOffset();
- }
- if (rangeBefore != null) {
- stringsToInsert.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
- }
- removeAndInsertNew(buffer, currPos, offset, stringsToInsert, resEdit);
- stringsToInsert.clear();
- currPos= offset + region.getLength();
- } else if (addRegularToStar && !allImportsAddedToStar && !currDecl.isComment()) {
- String simpleName = currDecl.getTypeQualifiedName();
- if (simpleName.indexOf('.') != -1) {
- IRegion rangeBefore = currDecl.getPrecedingCommentRange();
- if (rangeBefore != null && currPos > rangeBefore.getOffset()) {
- // moved ahead of the leading comments, bring the currPos back
- currPos = rangeBefore.getOffset();
- }
- if (rangeBefore != null) {
- stringsToInsert.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
- }
- IRegion rangeAfter = currDecl.getTrailingCommentRange();
- String trailingComment = null;
- if (rangeAfter != null) {
- trailingComment = buffer.getText(rangeAfter.getOffset(), rangeAfter.getLength());
- }
- String str= getNewImportString(currDecl.getElementName(), isStatic, trailingComment, lineDelim);
- if (stringsToInsert.indexOf(str) == -1) {
- stringsToInsert.add(str);
- }
- }
- }
- }
- }
-
- // insert back all existing imports comments since existing imports were not preserved
- if (this.preserveExistingCommentsRanges != null) {
- for (int i = 0, max = this.preserveExistingCommentsRanges.length; (i < max && this.preserveExistingCommentsRanges[i] != null); i++) {
- IRegion region = this.preserveExistingCommentsRanges[i];
- String text = buffer.getText(region.getOffset(), region.getLength());
- // remove preceding whitespaces
- int index = 0;
- int length = text.length();
- loop: while (index < length) {
- if (Character.isWhitespace(text.charAt(index))) {
- index++;
- } else {
- break loop;
- }
- }
- if (index != 0) {
- text = text.substring(index);
- }
- if (!text.endsWith(lineDelim)) {
- text += lineDelim;
- }
- stringsToInsert.add(text);
- }
- }
- int end= importsStart + importsLen;
- removeAndInsertNew(buffer, currPos, end, stringsToInsert, resEdit);
-
- if (importsLen == 0) {
- if (!this.importsCreated.isEmpty() || !this.staticImportsCreated.isEmpty()) { // new import container
- if ((this.flags & F_NEEDS_TRAILING_DELIM) != 0) {
- resEdit.addChild(new InsertEdit(currPos, lineDelim));
- }
- } else {
- return new MultiTextEdit(); // no changes
- }
- }
- return resEdit;
- } finally {
- monitor.done();
- }
- }
-
- private void removeAndInsertNew(IBuffer buffer, int contentOffset, int contentEnd, ArrayList stringsToInsert, MultiTextEdit resEdit) {
- int pos= contentOffset;
- for (int i= 0; i < stringsToInsert.size(); i++) {
- String curr= (String) stringsToInsert.get(i);
- int idx= findInBuffer(buffer, curr, pos, contentEnd);
- if (idx != -1) {
- if (idx != pos) {
- resEdit.addChild(new DeleteEdit(pos, idx - pos));
- }
- pos= idx + curr.length();
- } else {
- resEdit.addChild(new InsertEdit(pos, curr));
- }
- }
- if (pos < contentEnd) {
- resEdit.addChild(new DeleteEdit(pos, contentEnd - pos));
- }
- }
-
- private int findInBuffer(IBuffer buffer, String str, int start, int end) {
- int pos= start;
- int len= str.length();
- if (pos + len > end || str.length() == 0) {
- return -1;
- }
- char first= str.charAt(0);
- int step= str.indexOf(first, 1);
- if (step == -1) {
- step= len;
- }
- while (pos + len <= end) {
- if (buffer.getChar(pos) == first) {
- int k= 1;
- while (k < len && buffer.getChar(pos + k) == str.charAt(k)) {
- k++;
- }
- if (k == len) {
- return pos; // found
- }
- if (k < step) {
- pos+= k;
- } else {
- pos+= step;
- }
- } else {
- pos++;
- }
- }
- return -1;
- }
-
- private Set evaluateStarImportConflicts(IProgressMonitor monitor) throws JavaModelException {
- //long start= System.currentTimeMillis();
-
- final HashSet/*String*/ onDemandConflicts= new HashSet();
-
- IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { this.compilationUnit.getJavaProject() });
-
- ArrayList/*<char[][]>*/ starImportPackages= new ArrayList();
- ArrayList/*<char[][]>*/ simpleTypeNames= new ArrayList();
- int nPackageEntries= this.packageEntries.size();
- for (int i= 0; i < nPackageEntries; i++) {
- PackageEntry pack= (PackageEntry) this.packageEntries.get(i);
- if (!pack.isStatic() && pack.hasStarImport(this.importOnDemandThreshold, null)) {
- starImportPackages.add(pack.getName().toCharArray());
- for (int k= 0; k < pack.getNumberOfImports(); k++) {
- ImportDeclEntry curr= pack.getImportAt(k);
- if (!curr.isOnDemand() && !curr.isComment()) {
- simpleTypeNames.add(curr.getSimpleName().toCharArray());
- }
- }
- }
- }
- if (starImportPackages.isEmpty()) {
- return null;
- }
-
- starImportPackages.add(this.compilationUnit.getParent().getElementName().toCharArray());
- starImportPackages.add(JAVA_LANG.toCharArray());
-
- char[][] allPackages= (char[][]) starImportPackages.toArray(new char[starImportPackages.size()][]);
- char[][] allTypes= (char[][]) simpleTypeNames.toArray(new char[simpleTypeNames.size()][]);
-
- TypeNameRequestor requestor= new TypeNameRequestor() {
- HashMap foundTypes= new HashMap();
-
- private String getTypeContainerName(char[] packageName, char[][] enclosingTypeNames) {
- StringBuffer buf= new StringBuffer();
- buf.append(packageName);
- for (int i= 0; i < enclosingTypeNames.length; i++) {
- if (buf.length() > 0)
- buf.append('.');
- buf.append(enclosingTypeNames[i]);
- }
- return buf.toString();
- }
-
- public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) {
- String name= new String(simpleTypeName);
- String containerName= getTypeContainerName(packageName, enclosingTypeNames);
-
- String oldContainer= (String) this.foundTypes.put(name, containerName);
- if (oldContainer != null && !oldContainer.equals(containerName)) {
- onDemandConflicts.add(name);
- }
- }
- };
- new SearchEngine().searchAllTypeNames(allPackages, allTypes, scope, requestor, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, monitor);
- return onDemandConflicts;
- }
-
- private String getNewImportString(String importName, boolean isStatic, String lineDelim) {
- return getNewImportString(importName, isStatic, null, lineDelim);
- }
-
- private String getNewImportString(String importName, boolean isStatic, String trailingComment, String lineDelim) {
- StringBuffer buf= new StringBuffer();
- buf.append("import "); //$NON-NLS-1$
- if (isStatic) {
- buf.append("static "); //$NON-NLS-1$
- }
- buf.append(importName);
- if (insertSpaceBeforeSemicolon()) buf.append(' ');
- buf.append(';');
- if (trailingComment != null) {
- buf.append(trailingComment);
- }
- buf.append(lineDelim);
-
- if (isStatic) {
- this.staticImportsCreated.add(importName);
- } else {
- this.importsCreated.add(importName);
- }
- return buf.toString();
- }
-
- private String[] getNewImportStrings(IBuffer buffer, PackageEntry packageEntry, boolean isStatic, String lineDelim) {
- boolean isStarImportAdded = false;
- List allImports = new ArrayList();
- int nImports = packageEntry.getNumberOfImports();
- StringBuffer allComments = null;
- StringBuffer allCommentsLead = null;
- for (int i= 0; i < nImports; i++) {
- ImportDeclEntry curr= packageEntry.getImportAt(i);
- if (curr.isComment()) {
- IRegion rangeBefore = curr.getPrecedingCommentRange();
- if (rangeBefore != null) {
- allImports.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
- }
- IRegion rangeAfter = curr.getTrailingCommentRange();
- String trailingComment = null;
- if (rangeAfter != null) {
- trailingComment = buffer.getText(rangeAfter.getOffset(), rangeAfter.getLength());
- }
- if (trailingComment != null) {
- allImports.add(buffer.getText(rangeAfter.getOffset(), rangeAfter.getLength()));
- }
- } else {
- String simpleName = curr.getTypeQualifiedName();
- if (simpleName.indexOf('.') != -1) {
- // member type imports - we preserve it
- IRegion rangeBefore = curr.getPrecedingCommentRange();
- if (rangeBefore != null) {
- allImports.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
- }
- IRegion rangeAfter = curr.getTrailingCommentRange();
- String trailingComment = null;
- if (rangeAfter != null) {
- trailingComment = buffer.getText(rangeAfter.getOffset(), rangeAfter.getLength());
- }
- allImports.add(getNewImportString(curr.getElementName(), isStatic, trailingComment, lineDelim));
- } else if (!isStarImportAdded) {
- String starImportString= packageEntry.getName() + ".*"; //$NON-NLS-1$
- // collect all comments
- IRegion rangeBefore = curr.getPrecedingCommentRange();
- if (rangeBefore != null) {
- allImports.add(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
- }
- IRegion rangeAfter = curr.getTrailingCommentRange();
- String trailComments = null;
- if (rangeAfter != null) {
- trailComments = buffer.getText(rangeAfter.getOffset(), rangeAfter.getLength());
- }
- allImports.add(getNewImportString(starImportString, isStatic, trailComments, lineDelim));
- isStarImportAdded = true;
- } else {
- // collect all comments
- IRegion rangeBefore = curr.getPrecedingCommentRange();
- if (rangeBefore != null) {
- if (allCommentsLead == null) {
- allCommentsLead = new StringBuffer();
- }
- allCommentsLead.append(buffer.getText(rangeBefore.getOffset(), rangeBefore.getLength()));
- }
- IRegion rangeAfter = curr.getTrailingCommentRange();
- if (rangeAfter != null) {
- if (allComments == null) {
- allComments = new StringBuffer();
- }
- allComments.append(buffer.getText(rangeAfter.getOffset(), rangeAfter.getLength()));
- }
- }
- }
- }
- if (allCommentsLead != null) {
- allImports.add(0, String.valueOf(allCommentsLead));
- }
- if (allComments != null) {
- allImports.add(String.valueOf(allComments.append(lineDelim)));
- }
- return (String[]) allImports.toArray(new String[allImports.size()]);
- }
-
- private static int getFirstTypeBeginPos(CompilationUnit root) {
- List types= root.types();
- if (!types.isEmpty()) {
- return root.getExtendedStartPosition(((ASTNode) types.get(0)));
- }
- return -1;
- }
-
- private int getPackageStatementEndPos(CompilationUnit root) {
- PackageDeclaration packDecl= root.getPackage();
- if (packDecl != null) {
- int afterPackageStatementPos= -1;
- int lineNumber= root.getLineNumber(packDecl.getStartPosition() + packDecl.getLength());
- if (lineNumber >= 0) {
- int lineAfterPackage= lineNumber + 1;
- afterPackageStatementPos= root.getPosition(lineAfterPackage, 0);
- }
- if (afterPackageStatementPos < 0) {
- this.flags|= F_NEEDS_LEADING_DELIM;
- return packDecl.getStartPosition() + packDecl.getLength();
- }
- int firstTypePos= getFirstTypeBeginPos(root);
- if (firstTypePos != -1 && firstTypePos <= afterPackageStatementPos) {
- this.flags|= F_NEEDS_TRAILING_DELIM;
- if (firstTypePos == afterPackageStatementPos) {
- this.flags|= F_NEEDS_LEADING_DELIM;
- }
- return firstTypePos;
- }
- this.flags|= F_NEEDS_LEADING_DELIM;
- return afterPackageStatementPos; // insert a line after after package statement
- }
- this.flags |= F_NEEDS_TRAILING_DELIM;
- return 0;
- }
-
- public String toString() {
- int nPackages= this.packageEntries.size();
- StringBuffer buf= new StringBuffer("\n-----------------------\n"); //$NON-NLS-1$
- for (int i= 0; i < nPackages; i++) {
- PackageEntry entry= (PackageEntry) this.packageEntries.get(i);
- if (entry.isStatic()) {
- buf.append("static "); //$NON-NLS-1$
- }
- buf.append(entry.toString());
- }
- return buf.toString();
- }
-
- private static final class ImportDeclEntry {
-
- private String elementName;
- private IRegion sourceRange;
- private final boolean isStatic;
- private int containerNameLength;
- IRegion precedingCommentRange;
- IRegion trailingCommentRange;
-
- public ImportDeclEntry(
- int containerNameLength,
- String elementName,
- boolean isStatic,
- IRegion sourceRange,
- IRegion precedingCommentRange,
- IRegion trailingCommentRange) {
- this(containerNameLength, elementName, isStatic, sourceRange);
- this.precedingCommentRange = precedingCommentRange;
- this.trailingCommentRange = trailingCommentRange;
- }
-
- public ImportDeclEntry(int containerNameLength, String elementName, boolean isStatic, IRegion sourceRange) {
- this.elementName= elementName;
- this.sourceRange= sourceRange;
- this.isStatic= isStatic;
- this.containerNameLength = containerNameLength;
- }
-
- public String getElementName() {
- return this.elementName;
- }
-
- public int compareTo(String fullName, boolean isStaticImport) {
- int cmp= this.elementName.compareTo(fullName);
- if (cmp == 0) {
- if (this.isStatic == isStaticImport) {
- return 0;
- }
- return this.isStatic ? -1 : 1;
- }
- return cmp;
- }
-
- public String getSimpleName() {
- return Signature.getSimpleName(this.elementName);
- }
-
- public String getTypeQualifiedName() {
- return this.elementName.substring(this.containerNameLength + 1);
- }
-
- public boolean isOnDemand() {
- return this.elementName != null && this.elementName.endsWith(".*"); //$NON-NLS-1$
- }
-
- public boolean isStatic() {
- return this.isStatic;
- }
-
- public boolean isNew() {
- return this.sourceRange == null;
- }
-
- public boolean isComment() {
- return this.elementName == null;
- }
-
- public IRegion getSourceRange() {
- return this.sourceRange;
- }
-
- public IRegion getPrecedingCommentRange() {
- return this.precedingCommentRange;
- }
-
- public IRegion getTrailingCommentRange() {
- return this.trailingCommentRange;
- }
- }
-
- /*
- * Internal element for the import structure: A container for imports
- * of all types from the same package
- */
- private final static class PackageEntry {
- private String name;
- private ArrayList importEntries;
- private String group;
- private boolean isStatic;
-
- /**
- * Comment package entry
- */
- public PackageEntry() {
- this("!", null, false); //$NON-NLS-1$
- }
-
- /**
- * @param name Name of the package entry. e.g. org.aspectj.org.eclipse.jdt.ui, containing imports like
- * org.aspectj.org.eclipse.jdt.ui.JavaUI.
- * @param group The index of the preference order entry assigned
- * different group id's will result in spacers between the entries
- */
- public PackageEntry(String name, String group, boolean isStatic) {
- this.name= name;
- this.importEntries= new ArrayList(5);
- this.group= group;
- this.isStatic= isStatic;
- }
-
- public boolean isStatic() {
- return this.isStatic;
- }
-
- public int compareTo(String otherName, boolean isOtherStatic) {
- int cmp= this.name.compareTo(otherName);
- if (cmp == 0) {
- if (this.isStatic == isOtherStatic) {
- return 0;
- }
- return this.isStatic ? -1 : 1;
- }
- return cmp;
- }
-
- public void sortIn(ImportDeclEntry imp) {
- String fullImportName= imp.getElementName();
- int insertPosition= -1;
- int nInports= this.importEntries.size();
- for (int i= 0; i < nInports; i++) {
- ImportDeclEntry curr= getImportAt(i);
- if (!curr.isComment()) {
- int cmp= curr.compareTo(fullImportName, imp.isStatic());
- if (cmp == 0) {
- return; // exists already
- } else if (cmp > 0 && insertPosition == -1) {
- insertPosition= i;
- }
- }
- }
- if (insertPosition == -1) {
- this.importEntries.add(imp);
- } else {
- this.importEntries.add(insertPosition, imp);
- }
- }
-
-
- public void add(ImportDeclEntry imp) {
- this.importEntries.add(imp);
- }
-
- public ImportDeclEntry find(String simpleName) {
- int nInports= this.importEntries.size();
- for (int i= 0; i < nInports; i++) {
- ImportDeclEntry curr= getImportAt(i);
- if (!curr.isComment()) {
- String currName= curr.getElementName();
- if (currName.endsWith(simpleName)) {
- int dotPos= currName.length() - simpleName.length() - 1;
- if ((dotPos == -1) || (dotPos > 0 && currName.charAt(dotPos) == '.')) {
- return curr;
- }
- }
- }
- }
- return null;
- }
-
- public boolean remove(String fullName, boolean isStaticImport) {
- int nInports= this.importEntries.size();
- for (int i= 0; i < nInports; i++) {
- ImportDeclEntry curr= getImportAt(i);
- if (!curr.isComment() && curr.compareTo(fullName, isStaticImport) == 0) {
- this.importEntries.remove(i);
- return true;
- }
- }
- return false;
- }
-
- public void filterImplicitImports(boolean useContextToFilterImplicitImports) {
- int nInports= this.importEntries.size();
- for (int i= nInports - 1; i >= 0; i--) {
- ImportDeclEntry curr= getImportAt(i);
- if (curr.isNew()) {
- if (!useContextToFilterImplicitImports) {
- this.importEntries.remove(i);
- } else {
- String elementName = curr.getElementName();
- int lastIndexOf = elementName.lastIndexOf('.');
- boolean internalClassImport = lastIndexOf > getName().length();
- if (!internalClassImport) {
- this.importEntries.remove(i);
- }
- }
- }
- }
- }
-
- public ImportDeclEntry getImportAt(int index) {
- return (ImportDeclEntry) this.importEntries.get(index);
- }
-
- public boolean hasStarImport(int threshold, Set explicitImports) {
- if (isComment() || isDefaultPackage()) { // can not star import default package
- return false;
- }
- int nImports= getNumberOfImports();
- int count= 0;
- boolean containsNew= false;
- for (int i= 0; i < nImports; i++) {
- ImportDeclEntry curr= getImportAt(i);
- if (curr.isOnDemand()) {
- return true;
- }
- if (!curr.isComment()) {
- count++;
- boolean isExplicit= !curr.isStatic() && (explicitImports != null) && explicitImports.contains(curr.getSimpleName());
- containsNew |= curr.isNew() && !isExplicit;
- }
- }
- return (count >= threshold) && containsNew;
- }
-
- public int getNumberOfImports() {
- return this.importEntries.size();
- }
-
- public String getName() {
- return this.name;
- }
-
- public String getGroupID() {
- return this.group;
- }
-
- public void setGroupID(String groupID) {
- this.group= groupID;
- }
-
- public boolean isSameGroup(PackageEntry other) {
- if (this.group == null) {
- return other.getGroupID() == null;
- } else {
- return this.group.equals(other.getGroupID()) && (this.isStatic == other.isStatic());
- }
- }
-
- public boolean isComment() {
- return "!".equals(this.name); //$NON-NLS-1$
- }
-
- public boolean isDefaultPackage() {
- return this.name.length() == 0;
- }
-
- public String toString() {
- StringBuffer buf= new StringBuffer();
- if (isComment()) {
- buf.append("comment\n"); //$NON-NLS-1$
- } else {
- buf.append(this.name); buf.append(", groupId: "); buf.append(this.group); buf.append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
- int nImports= getNumberOfImports();
- for (int i= 0; i < nImports; i++) {
- ImportDeclEntry curr= getImportAt(i);
- buf.append(" "); //$NON-NLS-1$
- if (curr.isComment()) {
- buf.append("comment"); //$NON-NLS-1$
- } else {
- if (curr.isStatic()) {
- buf.append("static "); //$NON-NLS-1$
- }
- buf.append(curr.getTypeQualifiedName());
- }
- if (curr.isNew()) {
- buf.append(" (new)"); //$NON-NLS-1$
- }
- buf.append("\n"); //$NON-NLS-1$
- }
- }
- return buf.toString();
- }
- }
-
- public String[] getCreatedImports() {
- return (String[]) this.importsCreated.toArray(new String[this.importsCreated.size()]);
- }
-
- public String[] getCreatedStaticImports() {
- return (String[]) this.staticImportsCreated.toArray(new String[this.staticImportsCreated.size()]);
- }
-
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier.java
new file mode 100644
index 0000000..848dd40
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictIdentifier.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+
+public class ConflictIdentifier {
+ /**
+ * Encapsulates those simple names (of type imports and of static imports) which would be
+ * imported from multiple on-demand or implicit import containers.
+ */
+ static final class Conflicts {
+ final Set<String> typeConflicts;
+ final Set<String> staticConflicts;
+
+ Conflicts(Set<String> typeConflicts, Set<String> staticConflicts) {
+ this.typeConflicts = Collections.unmodifiableSet(new HashSet<String>(typeConflicts));
+ this.staticConflicts = Collections.unmodifiableSet(new HashSet<String>(staticConflicts));
+ }
+
+ @Override
+ public String toString() {
+ return String.format(
+ "Conflicts(type: %s; static: %s)", this.typeConflicts, this.staticConflicts); //$NON-NLS-1$
+ }
+ }
+
+ private final OnDemandComputer onDemandComputer;
+ private final TypeConflictingSimpleNameFinder typeConflictFinder;
+ private final StaticConflictingSimpleNameFinder staticConflictFinder;
+ private final Set<String> implicitImportContainers;
+
+ ConflictIdentifier(
+ OnDemandComputer onDemandComputer,
+ TypeConflictingSimpleNameFinder typeConflictFinder,
+ StaticConflictingSimpleNameFinder staticConflictFinder,
+ Set<String> implicitImportContainers) {
+ this.onDemandComputer = onDemandComputer;
+ this.typeConflictFinder = typeConflictFinder;
+ this.staticConflictFinder = staticConflictFinder;
+ this.implicitImportContainers = implicitImportContainers;
+ }
+
+ /**
+ * Identifies the simple names (of the elements of {@code imports}) which would be imported from
+ * multiple on-demand or implicit import containers.
+ *
+ * @param imports
+ * imports whose simple names are to be considered for conflicts
+ * @param addedImports
+ * imports which have been added as part of the rewrite (and could therefore trigger
+ * on-demand reductions; a subset of {@code imports}
+ * @param typeExplicitSimpleNames
+ * simple names of types which are already known to require explicit imports
+ * @param staticExplicitSimpleNames
+ * simple names of statics which are already known to require explicit imports
+ * @param progressMonitor
+ * a progress monitor used to track time spent searching for conflicts
+ * @return a {@link Conflicts} object encapsulating the found conflicting type and static names
+ * @throws JavaModelException if an error occurs while searching for declarations
+ */
+ Conflicts identifyConflicts(
+ Set<ImportName> imports,
+ Set<ImportName> addedImports,
+ Set<String> typeExplicitSimpleNames,
+ Set<String> staticExplicitSimpleNames,
+ IProgressMonitor progressMonitor) throws JavaModelException {
+ Collection<OnDemandReduction> onDemandCandidates = this.onDemandComputer.identifyPossibleReductions(
+ imports, addedImports, typeExplicitSimpleNames, staticExplicitSimpleNames);
+
+ Set<String> typeOnDemandContainers = new HashSet<String>(extractContainerNames(onDemandCandidates, false));
+ Set<String> staticOnDemandContainers = new HashSet<String>(extractContainerNames(onDemandCandidates, true));
+
+ if (!typeOnDemandContainers.isEmpty()) {
+ // Existing on-demands might conflict with new or existing on-demands.
+ typeOnDemandContainers.addAll(extractOnDemandContainerNames(imports, false));
+
+ // Implicitly imported types might conflict with type on-demands.
+ typeOnDemandContainers.addAll(this.implicitImportContainers);
+
+ // Member types imported by static on-demands might conflict with type on-demands.
+ typeOnDemandContainers.addAll(staticOnDemandContainers);
+ }
+
+ if (!staticOnDemandContainers.isEmpty()) {
+ // Existing on-demands might conflict with new or existing on-demands.
+ staticOnDemandContainers.addAll(extractOnDemandContainerNames(imports, true));
+ }
+
+ Set<String> typeConflicts = findConflictingSimpleNames(
+ this.typeConflictFinder, imports, false, typeOnDemandContainers, progressMonitor);
+
+ Set<String> staticConflicts = findConflictingSimpleNames(
+ this.staticConflictFinder, imports, true, staticOnDemandContainers, progressMonitor);
+
+ return new Conflicts(typeConflicts, staticConflicts);
+ }
+
+ private Collection<String> extractContainerNames(
+ Collection<OnDemandReduction> onDemandCandidates, boolean isStatic) {
+ Collection<String> containerNames = new ArrayList<String>(onDemandCandidates.size());
+ for (OnDemandReduction onDemandCandidate : onDemandCandidates) {
+ ImportName containerOnDemand = onDemandCandidate.containerOnDemand;
+ if (containerOnDemand.isStatic == isStatic) {
+ containerNames.add(containerOnDemand.containerName);
+ }
+ }
+
+ return containerNames;
+ }
+
+ private Collection<String> extractOnDemandContainerNames(
+ Collection<ImportName> imports, boolean isStatic) {
+ Collection<String> onDemandContainerNames = new ArrayList<String>(imports.size());
+ for (ImportName importName : imports) {
+ if (importName.isOnDemand() && importName.isStatic == isStatic) {
+ onDemandContainerNames.add(importName.containerName);
+ }
+ }
+
+ return onDemandContainerNames;
+ }
+
+ private Set<String> findConflictingSimpleNames(
+ ConflictingSimpleNameFinder conflictFinder,
+ Set<ImportName> imports,
+ boolean isStatic,
+ Set<String> onDemandImportedContainers,
+ IProgressMonitor monitor) throws JavaModelException {
+ if (onDemandImportedContainers.isEmpty() || imports.isEmpty()) {
+ return Collections.emptySet();
+ }
+
+ Set<String> simpleNames = new HashSet<String>();
+ for (ImportName currentImport : imports) {
+ if (currentImport.isStatic == isStatic) {
+ simpleNames.add(currentImport.simpleName);
+ }
+ }
+
+ return conflictFinder.findConflictingSimpleNames(simpleNames, onDemandImportedContainers, monitor);
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictingSimpleNameFinder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictingSimpleNameFinder.java
new file mode 100644
index 0000000..654b7cb
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ConflictingSimpleNameFinder.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+
+import java.util.Set;
+
+interface ConflictingSimpleNameFinder {
+ /**
+ * Finds duplicate declarations of the specified simple names within the specified on-demand and
+ * implicit import containers.
+ *
+ * @param simpleNames
+ * simple names of single imports in the compilation unit
+ * @param onDemandAndImplicitContainerNames
+ * names of on-demand and implicitly imported containers (e.g. "java.lang")
+ * @param monitor
+ * a progress monitor used to track time spent searching for conflicts
+ */
+ Set<String> findConflictingSimpleNames(
+ Set<String> simpleNames,
+ Set<String> onDemandAndImplicitContainerNames,
+ IProgressMonitor monitor) throws JavaModelException;
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportAdder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportAdder.java
new file mode 100644
index 0000000..7b877df
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportAdder.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.Collection;
+import java.util.List;
+
+interface ImportAdder {
+ /**
+ * Returns a new list containing the elements of {@code existingImports} and also containing
+ * each element of {@code importsToAdd} for which {@code existingImports} does not contain an
+ * equal element.
+ */
+ List<ImportName> addImports(Collection<ImportName> existingImports, Collection<ImportName> importsToAdd);
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComment.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComment.java
new file mode 100644
index 0000000..4c650cb
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComment.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import org.eclipse.jface.text.IRegion;
+
+final class ImportComment {
+ /** The original location of this comment in the compilation unit. */
+ final IRegion region;
+
+ /**
+ * The number of line delimiters following this comment and preceding the next comment or the
+ * associated import declaration. Used to preserve blank lines between comments and/or import
+ * declarations. Will be 0 for a trailing comment.
+ */
+ final int succeedingLineDelimiters;
+
+ ImportComment(IRegion region, int succeedingLineDelims) {
+ this.region = region;
+ this.succeedingLineDelimiters = succeedingLineDelims;
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator.java
new file mode 100644
index 0000000..6fad5b7
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportComparator.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.Comparator;
+
+/**
+ * Sorts imports by, in order of decreasing precedence, the following:
+ * <ul>
+ * <li>configured import group order</li>
+ * <li>package name and/or qualified name of containing type (lexicographically)</li>
+ * <li>qualified name of import (lexicographically)</li>
+ * </ul>
+ */
+final class ImportComparator implements Comparator<ImportName> {
+ private static Comparator<ImportName> createQualifiedNameComparator() {
+ return new Comparator<ImportName>() {
+ @Override
+ public int compare(ImportName o1, ImportName o2) {
+ return o1.qualifiedName.compareTo(o2.qualifiedName);
+ }
+ };
+ }
+
+ private final Comparator<ImportName> importGroupComparator;
+ private final Comparator<ImportName> typeContainerComparator;
+ private final Comparator<ImportName> staticContainerComparator;
+ private final Comparator<ImportName> qualifiedNameComparator;
+
+ ImportComparator(
+ ImportGroupComparator importGroupComparator,
+ Comparator<ImportName> typeContainerComparator,
+ Comparator<ImportName> staticContainerComparator) {
+ this.importGroupComparator = importGroupComparator;
+ this.typeContainerComparator = typeContainerComparator;
+ this.staticContainerComparator = staticContainerComparator;
+ this.qualifiedNameComparator = createQualifiedNameComparator();
+ }
+
+ @Override
+ public int compare(ImportName o1, ImportName o2) {
+ final int comparison;
+
+ int importGroupComparison = this.importGroupComparator.compare(o1, o2);
+ if (importGroupComparison != 0) {
+ comparison = importGroupComparison;
+ } else {
+ // The two imports sorted into the same import group, so o2.isStatic == o1.isStatic.
+ Comparator<ImportName> containerComparator =
+ o1.isStatic ? this.staticContainerComparator : this.typeContainerComparator;
+
+ int containerComparison = containerComparator.compare(o1, o2);
+ if (containerComparison != 0) {
+ comparison = containerComparison;
+ } else {
+ comparison = this.qualifiedNameComparator.compare(o1, o2);
+ }
+ }
+
+ return comparison;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportDeclarationWriter.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportDeclarationWriter.java
new file mode 100644
index 0000000..572c899
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportDeclarationWriter.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+final class ImportDeclarationWriter {
+ private final boolean insertSpaceBeforeSemicolon;
+
+ ImportDeclarationWriter(boolean insertSpaceBeforeSemicolon) {
+ this.insertSpaceBeforeSemicolon = insertSpaceBeforeSemicolon;
+ }
+
+ /**
+ * Writes the Java source for an import declaration of the given name.
+ */
+ String writeImportDeclaration(ImportName importName) {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append("import "); //$NON-NLS-1$
+
+ if (importName.isStatic) {
+ sb.append("static "); //$NON-NLS-1$
+ }
+
+ sb.append(importName.qualifiedName);
+
+ if (this.insertSpaceBeforeSemicolon) {
+ sb.append(' ');
+ }
+
+ sb.append(';');
+
+ return sb.toString();
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor.java
new file mode 100644
index 0000000..734bb78
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEditor.java
@@ -0,0 +1,536 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.text.edits.DeleteEdit;
+import org.eclipse.text.edits.InsertEdit;
+import org.eclipse.text.edits.MoveSourceEdit;
+import org.eclipse.text.edits.MoveTargetEdit;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.RangeMarker;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Creates TextEdits to apply changes to the order of import declarations to a compilation unit.
+ */
+final class ImportEditor {
+ /**
+ * Iterates through the compilation unit's original import order, providing in turn each
+ * original import and the original start position of that import's leading delimiter.
+ */
+ private static final class OriginalImportsCursor {
+ private final Iterator<OriginalImportEntry> originalImportIterator;
+ OriginalImportEntry currentOriginalImport;
+ int currentPosition;
+
+ OriginalImportsCursor(int startPosition, Collection<OriginalImportEntry> originalImportEntries) {
+ this.originalImportIterator = originalImportEntries.iterator();
+ this.currentPosition = startPosition;
+ this.currentOriginalImport =
+ this.originalImportIterator.hasNext() ? this.originalImportIterator.next() : null;
+ }
+
+ /**
+ * Advances this cursor to the next import in the original order.
+ */
+ void advance() {
+ IRegion declarationAndComments = this.currentOriginalImport.declarationAndComments;
+ this.currentPosition = declarationAndComments.getOffset() + declarationAndComments.getLength();
+ this.currentOriginalImport =
+ this.originalImportIterator.hasNext() ? this.originalImportIterator.next() : null;
+ }
+ }
+
+ private static final class ImportEdits {
+ final Collection<TextEdit> leadingDelimiterEdits;
+ final Collection<TextEdit> commentAndDeclarationEdits;
+
+ ImportEdits(
+ Collection<TextEdit> leadingDelimiterEdits,
+ Collection<TextEdit> commentAndDeclarationEdits) {
+ this.leadingDelimiterEdits = leadingDelimiterEdits;
+ this.commentAndDeclarationEdits = commentAndDeclarationEdits;
+ }
+ }
+
+ /**
+ * Maps by identity each import (as key), except the last, to the import (as value) which comes
+ * before it.
+ * <p>
+ * Maps by identity (rather than by hashcode) to handle cases of duplicate import declarations.
+ */
+ private static Map<ImportName, ImportEntry> mapPrecedingImports(Collection<? extends ImportEntry> importEntries) {
+ Map<ImportName, ImportEntry> precedingImports =
+ new IdentityHashMap<ImportName, ImportEntry>(importEntries.size());
+
+ ImportEntry previousImport = null;
+ for (ImportEntry currentImport : importEntries) {
+ ImportName currentImportName = currentImport.importName;
+ precedingImports.put(currentImportName, previousImport);
+ previousImport = currentImport;
+ }
+
+ return precedingImports;
+ }
+
+ private static boolean containsFloatingComment(Iterable<ImportComment> comments) {
+ for (ImportComment comment : comments) {
+ if (comment.succeedingLineDelimiters > 1) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private final String lineDelimiter;
+ private final String twoLineDelimiters;
+ private final boolean fixAllLineDelimiters;
+ private final int lineDelimitersBetweenImportGroups;
+ private final ImportGroupComparator importGroupComparator;
+ private final RemovedImportCommentReassigner commentReassigner;
+ private final Map<ImportName, ImportEntry> originalPrecedingImports;
+ private final List<OriginalImportEntry> originalImportEntries;
+ private final RewriteSite rewriteSite;
+ private final ImportDeclarationWriter declarationWriter;
+
+ /**
+ * @param lineDelimiter
+ * the string to use as a line delimiter when generating text edits
+ * @param fixAllLineDelimiters
+ * specifies whether to standardize whitespace between all imports (if true), or only
+ * between pairs of imports not originally subsequent (if false)
+ * @param lineDelimitersBetweenImportGroups
+ * the number of line delimiters desired between import declarations matching
+ * different import groups
+ * @param importGroupComparator
+ * used to determine whether two subsequent imports match the same import group
+ * @param originalImports
+ * the original order of imports in the compilation unit
+ * @param rewriteSite
+ * describes the location in the compilation unit where imports shall be rewriten
+ * @param importDeclarationWriter
+ * used to render each new import declaration (one not originally present in the
+ * compilation unit) as a string
+ */
+ ImportEditor(
+ String lineDelimiter,
+ boolean fixAllLineDelimiters,
+ int lineDelimitersBetweenImportGroups,
+ ImportGroupComparator importGroupComparator,
+ List<OriginalImportEntry> originalImports,
+ RewriteSite rewriteSite,
+ ImportDeclarationWriter importDeclarationWriter) {
+ this.lineDelimiter = lineDelimiter;
+ this.twoLineDelimiters = this.lineDelimiter.concat(this.lineDelimiter);
+ this.fixAllLineDelimiters = fixAllLineDelimiters;
+ this.lineDelimitersBetweenImportGroups = lineDelimitersBetweenImportGroups;
+ this.importGroupComparator = importGroupComparator;
+ this.originalImportEntries = originalImports;
+ this.rewriteSite = rewriteSite;
+ this.declarationWriter = importDeclarationWriter;
+
+ this.commentReassigner = new RemovedImportCommentReassigner(originalImports);
+
+ if (fixAllLineDelimiters) {
+ this.originalPrecedingImports = Collections.emptyMap();
+ } else {
+ this.originalPrecedingImports = Collections.unmodifiableMap(mapPrecedingImports(originalImports));
+ }
+ }
+
+ /**
+ * Generates and returns a TextEdit to replace or update the import declarations in the
+ * compilation unit to match the given list.
+ * <p>
+ * Standardizes whitespace between subsequent imports to the correct number of line delimiters
+ * (either for every pair of subsequent imports, or only for pairs not originally subsequent,
+ * depending on the value of {@link #fixAllLineDelimiters}).
+ * <p>
+ * Relocates leading and trailing comments of removed imports as determined by
+ * {@link #commentReassigner}.
+ */
+ TextEdit createTextEdit(Collection<ImportEntry> resultantImports) {
+ TextEdit edit = new MultiTextEdit();
+
+ IRegion surroundingRegion = this.rewriteSite.surroundingRegion;
+
+ if (resultantImports.isEmpty()) {
+ if (this.originalImportEntries.isEmpty()) {
+ // Leave the compilation unit as is.
+ }
+ else {
+ // Replace original imports and surrounding whitespace with enough line delimiters
+ // around preceding and/or succeeding elements.
+
+ String newWhitespace;
+ if (this.rewriteSite.hasPrecedingElements) {
+ int newDelims = this.rewriteSite.hasSucceedingElements ? 2 : 1;
+ newWhitespace = createDelimiter(newDelims);
+ } else {
+ newWhitespace = ""; //$NON-NLS-1$
+ }
+
+ edit.addChild(new ReplaceEdit(
+ surroundingRegion.getOffset(), surroundingRegion.getLength(), newWhitespace));
+ }
+ }
+ else {
+ if (this.originalImportEntries.isEmpty()) {
+ // Replace existing whitespace with preceding line delimiters, import declarations,
+ // and succeeding line delimiters.
+
+ Collection<TextEdit> importEdits = determineEditsForImports(
+ surroundingRegion, resultantImports);
+
+ if (this.rewriteSite.hasPrecedingElements) {
+ edit.addChild(new InsertEdit(surroundingRegion.getOffset(), createDelimiter(2)));
+ }
+
+ edit.addChildren(importEdits.toArray(new TextEdit[importEdits.size()]));
+
+ int newSucceedingDelims = this.rewriteSite.hasSucceedingElements ? 2 : 1;
+ String newSucceeding = createDelimiter(newSucceedingDelims);
+ edit.addChild(new InsertEdit(surroundingRegion.getOffset(), newSucceeding));
+ }
+ else {
+ // Replace original imports with new ones, leaving surrounding whitespace in place.
+
+ Collection<TextEdit> importEdits = determineEditsForImports(
+ this.rewriteSite.importsRegion, resultantImports);
+
+ edit.addChildren(importEdits.toArray(new TextEdit[importEdits.size()]));
+ }
+ }
+ return edit;
+ }
+
+ /**
+ * Concatenates the given number of line delimiters into a single string.
+ */
+ private String createDelimiter(int numberOfLineDelimiters) {
+ if (numberOfLineDelimiters < 1) {
+ throw new IllegalArgumentException();
+ }
+
+ if (numberOfLineDelimiters == 1) {
+ return this.lineDelimiter;
+ }
+
+ if (numberOfLineDelimiters == 2) {
+ return this.twoLineDelimiters;
+ }
+
+ StringBuilder correctDelimiter = new StringBuilder();
+ for (int i = 0; i < numberOfLineDelimiters; i++) {
+ correctDelimiter.append(this.lineDelimiter);
+ }
+ return correctDelimiter.toString();
+ }
+
+ private Collection<TextEdit> determineEditsForImports(
+ IRegion importsRegion,
+ Collection<ImportEntry> resultantImports) {
+ Collection<TextEdit> edits = new ArrayList<TextEdit>();
+
+ Map<ImportEntry, Collection<ImportComment>> commentReassignments =
+ this.commentReassigner.reassignComments(resultantImports);
+
+ OriginalImportsCursor cursor = new OriginalImportsCursor(
+ importsRegion.getOffset(), this.originalImportEntries);
+
+ edits.addAll(placeResultantImports(cursor, resultantImports, commentReassignments));
+
+ edits.addAll(deleteRemainingText(importsRegion, edits));
+
+ // Omit the RangeMarkers used temporarily to mark the text of non-relocated imports.
+ Collection<TextEdit> editsWithoutRangeMarkers = new ArrayList<TextEdit>(edits.size());
+ for (TextEdit edit : edits) {
+ if (!(edit instanceof RangeMarker)) {
+ editsWithoutRangeMarkers.add(edit);
+ }
+ }
+
+ return editsWithoutRangeMarkers;
+ }
+
+ /**
+ * Creates TextEdits that place each resultant import in the correct (rewritten) position.
+ */
+ private Collection<TextEdit> placeResultantImports(
+ OriginalImportsCursor cursor,
+ Collection<ImportEntry> resultantImports,
+ Map<ImportEntry, Collection<ImportComment>> commentReassignments) {
+ Collection<TextEdit> edits = new ArrayList<TextEdit>();
+
+ ImportEntry lastResultantImport = null;
+ for (ImportEntry currentResultantImport : resultantImports) {
+ if (currentResultantImport.isOriginal()) {
+ // Skip forward to this import's place in the original order.
+ while (cursor.currentOriginalImport != null
+ && cursor.currentOriginalImport != currentResultantImport) {
+ cursor.advance();
+ }
+ }
+
+ Collection<ImportComment> reassignedComments = commentReassignments.get(currentResultantImport);
+ if (reassignedComments == null) {
+ reassignedComments = Collections.emptyList();
+ }
+
+ ImportEdits importPlacement;
+ if (currentResultantImport.isOriginal()) {
+ OriginalImportEntry originalImport = currentResultantImport.asOriginalImportEntry();
+ if (cursor.currentOriginalImport == currentResultantImport) {
+ importPlacement = preserveStationaryImport(originalImport);
+ } else {
+ importPlacement = moveOriginalImport(originalImport, cursor.currentPosition);
+ }
+ } else {
+ importPlacement = placeNewImport(currentResultantImport, cursor.currentPosition);
+ }
+
+ String newDelimiter = determineNewDelimiter(
+ lastResultantImport, currentResultantImport, reassignedComments);
+ if (newDelimiter == null) {
+ edits.addAll(importPlacement.leadingDelimiterEdits);
+ } else if (!newDelimiter.isEmpty()) {
+ edits.add(new InsertEdit(cursor.currentPosition, newDelimiter));
+ }
+
+ if (!reassignedComments.isEmpty()) {
+ edits.addAll(relocateComments(reassignedComments, cursor.currentPosition));
+
+ boolean hasFloatingComment = currentResultantImport.isOriginal()
+ && containsFloatingComment(currentResultantImport.asOriginalImportEntry().comments);
+ String delimiterAfterReassignedComments =
+ hasFloatingComment ? this.twoLineDelimiters : this.lineDelimiter;
+ edits.add(new InsertEdit(cursor.currentPosition, delimiterAfterReassignedComments));
+ }
+
+ edits.addAll(importPlacement.commentAndDeclarationEdits);
+
+ if (currentResultantImport == cursor.currentOriginalImport) {
+ cursor.advance();
+ }
+
+ lastResultantImport = currentResultantImport;
+ }
+
+ return edits;
+ }
+
+ /**
+ * Creates text edits to insert the text of a new import.
+ */
+ private ImportEdits placeNewImport(ImportEntry currentResultantImport, int position) {
+ String declaration = this.declarationWriter.writeImportDeclaration(currentResultantImport.importName);
+ return new ImportEdits(
+ Collections.<TextEdit>emptySet(),
+ Collections.<TextEdit>singleton(new InsertEdit(position, declaration)));
+ }
+
+ /**
+ * Creates text edits to move an import's text to a new position.
+ */
+ private ImportEdits moveOriginalImport(OriginalImportEntry importEntry, int position) {
+ MoveSourceEdit leadingSourceEdit = new MoveSourceEdit(
+ importEntry.leadingDelimiter.getOffset(), importEntry.leadingDelimiter.getLength());
+ MoveTargetEdit leadingTargetEdit = new MoveTargetEdit(position, leadingSourceEdit);
+ Collection<TextEdit> leadingDelimiterEdits = Arrays.asList(leadingSourceEdit, leadingTargetEdit);
+
+ MoveSourceEdit importSourceEdit = new MoveSourceEdit(
+ importEntry.declarationAndComments.getOffset(), importEntry.declarationAndComments.getLength());
+ MoveTargetEdit importTargetEdit = new MoveTargetEdit(position, importSourceEdit);
+ Collection<TextEdit> declarationAndCommentEdits = Arrays.asList(importSourceEdit, importTargetEdit);
+
+ return new ImportEdits(leadingDelimiterEdits, declarationAndCommentEdits);
+ }
+
+ /**
+ * Creates RangeMarkers to mark a non-relocated import's text to prevent its deletion.
+ */
+ private ImportEdits preserveStationaryImport(OriginalImportEntry importEntry) {
+ return new ImportEdits(
+ Collections.<TextEdit>singleton(new RangeMarker(
+ importEntry.leadingDelimiter.getOffset(),
+ importEntry.leadingDelimiter.getLength())),
+ Collections.<TextEdit>singleton(new RangeMarker(
+ importEntry.declarationAndComments.getOffset(),
+ importEntry.declarationAndComments.getLength())));
+
+ }
+
+ /**
+ * Determines whether and how to standardize the whitespace between the end of the previous
+ * import (or its last trailing comment) and the start of the current import (or its first
+ * leading comment).
+ * <p>
+ * Returns a string containing the correct whitespace to place between the two imports, or
+ * {@code null} if the current import's original leading whitespace should be preserved.
+ */
+ private String determineNewDelimiter(
+ ImportEntry lastImport,
+ ImportEntry currentImport,
+ Collection<ImportComment> reassignedComments) {
+ if (lastImport == null) {
+ // The first import in the compilation unit needs no preceding line delimiters.
+ return ""; //$NON-NLS-1$
+ }
+
+ boolean hasReassignedComments = !reassignedComments.isEmpty();
+
+ if (!needsStandardDelimiter(lastImport, currentImport, hasReassignedComments)) {
+ return null;
+ }
+
+ int numberOfLineDelimiters = 1;
+
+ Collection<ImportComment> leadingComments;
+ if (hasReassignedComments) {
+ leadingComments = reassignedComments;
+ } else if (currentImport.isOriginal()) {
+ leadingComments = currentImport.asOriginalImportEntry().comments;
+ } else {
+ leadingComments = Collections.emptyList();
+ }
+ if (containsFloatingComment(leadingComments)) {
+ // Prevent a floating leading comment from becoming attached to the preceding import.
+ numberOfLineDelimiters = 2;
+ }
+
+ if (this.importGroupComparator.compare(lastImport.importName, currentImport.importName) != 0) {
+ // Separate imports belonging to different import groups.
+ numberOfLineDelimiters = Math.max(numberOfLineDelimiters, this.lineDelimitersBetweenImportGroups);
+ }
+
+ String standardDelimiter = createDelimiter(numberOfLineDelimiters);
+
+ // Reuse the original preceding delimiter if it matches the standard delimiter, but only
+ // if there are no reassigned comments (which would necessitate relocating the delimiter).
+ if (currentImport.isOriginal() && !hasReassignedComments) {
+ OriginalImportEntry originalImport = currentImport.asOriginalImportEntry();
+ IRegion originalDelimiter = originalImport.leadingDelimiter;
+ if (originalImport.precedingLineDelimiters == numberOfLineDelimiters) {
+ boolean delimiterIsSameLength = originalDelimiter == null && standardDelimiter.isEmpty()
+ || originalDelimiter != null && originalDelimiter.getLength() == standardDelimiter.length();
+ if (delimiterIsSameLength) {
+ return null;
+ }
+ }
+ }
+
+ return standardDelimiter;
+ }
+
+ /**
+ * Determines whether the whitespace between two subsequent imports should be set to a standard
+ * number of line delimiters.
+ */
+ private boolean needsStandardDelimiter(
+ ImportEntry lastImport,
+ ImportEntry currentImport,
+ boolean hasReassignedComments) {
+ boolean needsStandardDelimiter = false;
+
+ if (this.fixAllLineDelimiters) {
+ // In "Organize Imports" mode, all delimiters between imports are standardized.
+ needsStandardDelimiter = true;
+ } else if (!currentImport.isOriginal()) {
+ // This (new) import does not have an original leading delimiter.
+ needsStandardDelimiter = true;
+ } else if (hasReassignedComments) {
+ // Comments reassigned from removed imports are being prepended to this import.
+ needsStandardDelimiter = true;
+ } else {
+ ImportEntry originalPrecedingImport = this.originalPrecedingImports.get(currentImport.importName);
+ if (originalPrecedingImport == null || lastImport.importName != originalPrecedingImport.importName) {
+ // This import follows a different import post-rewrite than pre-rewrite.
+ needsStandardDelimiter = true;
+ }
+ }
+
+ return needsStandardDelimiter;
+ }
+
+ private Collection<TextEdit> relocateComments(Collection<ImportComment> reassignedComments, int insertPosition) {
+ if (reassignedComments.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ Collection<TextEdit> edits = new ArrayList<TextEdit>(reassignedComments.size() * 3);
+
+ ImportComment lastComment = null;
+ for (ImportComment currentComment : reassignedComments) {
+ MoveSourceEdit sourceEdit = new MoveSourceEdit(
+ currentComment.region.getOffset(), currentComment.region.getLength());
+ edits.add(sourceEdit);
+
+ if (lastComment != null) {
+ // Preserve blank lines between comments.
+ int succeedingLineDelimiters = lastComment.succeedingLineDelimiters > 1 ? 2 : 1;
+
+ edits.add(new InsertEdit(insertPosition, createDelimiter(succeedingLineDelimiters)));
+ }
+
+ edits.add(new MoveTargetEdit(insertPosition, sourceEdit));
+
+ lastComment = currentComment;
+ }
+
+ return edits;
+ }
+
+ /**
+ * Creates TextEdits that delete text remaining between and after resultant imports.
+ */
+ private static Collection<TextEdit> deleteRemainingText(IRegion importRegion, Collection<TextEdit> edits) {
+ List<TextEdit> sortedEdits = new ArrayList<TextEdit>(edits);
+ Collections.sort(sortedEdits, new Comparator<TextEdit>() {
+ @Override
+ public int compare(TextEdit o1, TextEdit o2) {
+ return o1.getOffset() - o2.getOffset();
+ }
+ });
+
+ int deletePosition = importRegion.getOffset();
+
+ Collection<TextEdit> deleteRemainingTextEdits = new ArrayList<TextEdit>();
+ for (TextEdit edit : sortedEdits) {
+ if (edit.getOffset() > deletePosition) {
+ deleteRemainingTextEdits.add(new DeleteEdit(deletePosition, edit.getOffset() - deletePosition));
+ }
+
+ int editEndPosition = edit.getOffset() + edit.getLength();
+ deletePosition = Math.max(deletePosition, editEndPosition);
+ }
+
+ // Delete text remaining after the last import.
+ int importRegionEndPosition = importRegion.getOffset() + importRegion.getLength();
+ if (deletePosition < importRegionEndPosition) {
+ deleteRemainingTextEdits.add(new DeleteEdit(deletePosition, importRegionEndPosition - deletePosition));
+ }
+
+ return deleteRemainingTextEdits;
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEntry.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEntry.java
new file mode 100644
index 0000000..59ac4af
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportEntry.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+/**
+ * Describes an import declaration, encapsulating the imported name and, for an import declaration
+ * originally present in the compilation unit, the regions originally occupied by the import
+ * declaration and its associated comments.
+ * <p>
+ * As the Java Language Specification allows duplicate import declarations, a compilation unit
+ * may contain multiple {@code ImportEntry}s with equal {@code ImportName}s.
+ */
+abstract class ImportEntry {
+ final ImportName importName;
+
+ protected ImportEntry(ImportName importName) {
+ this.importName = importName;
+ }
+
+ /**
+ * Returns true if this import declaration occurred originally (before the rewrite).
+ */
+ abstract boolean isOriginal();
+
+ /**
+ * If this import declaration occurred originally, returns it as an OriginalImportEntry;
+ * otherwise throws an exception.
+ */
+ abstract OriginalImportEntry asOriginalImportEntry();
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java
new file mode 100644
index 0000000..b779e34
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportGroupComparator.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.TreeMap;
+
+/**
+ * Sorts imports according to the order of import groups defined on the Organize Imports preference
+ * page. Considers equal any two imports matching the same import group.
+ */
+final class ImportGroupComparator implements Comparator<ImportName>{
+ private static final class ImportGroup {
+ private final String name;
+ private final int index;
+ private final ImportGroup prefix;
+
+ public ImportGroup(String name, int index, ImportGroup prefix) {
+ this.name = name;
+ this.index = index;
+ this.prefix = prefix;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("ImportGroup(%d:%s)", getIndex(), getName()); //$NON-NLS-1$
+ }
+
+ String getName() {
+ return this.name;
+ }
+
+ int getIndex() {
+ return this.index;
+ }
+
+ ImportGroup getPrefix() {
+ return this.prefix;
+ }
+ }
+
+ private static final class IndexedImportGroups {
+ final NavigableMap<String, ImportGroup> typeImportGroupsByName;
+ final NavigableMap<String, ImportGroup> staticImportGroupByName;
+
+ IndexedImportGroups(
+ NavigableMap<String, ImportGroup> typeImportGroupsByName,
+ NavigableMap<String, ImportGroup> staticImportGroupsByName) {
+ this.typeImportGroupsByName = typeImportGroupsByName;
+ this.staticImportGroupByName = staticImportGroupsByName;
+ }
+ }
+
+ private static final String MATCH_ALL = ""; //$NON-NLS-1$
+ private static final String STATIC_PREFIX = "#"; //$NON-NLS-1$
+ private static final String STATIC_MATCH_ALL = STATIC_PREFIX + MATCH_ALL;
+
+ private static List<String> memoizedImportOrder = null;
+ private static IndexedImportGroups memoizedIndexedImportGroups = null;
+
+ private static List<String> includeMatchAllImportGroups(List<String> importOrder) {
+ boolean needsTypeMatchAll = !importOrder.contains(MATCH_ALL);
+ boolean needsStaticMatchAll = !importOrder.contains(STATIC_MATCH_ALL);
+
+ if (!needsTypeMatchAll && !needsStaticMatchAll) {
+ return importOrder;
+ }
+
+ List<String> augmentedOrder = new ArrayList<String>(importOrder.size() + 2);
+
+ if (needsStaticMatchAll) {
+ augmentedOrder.add(STATIC_MATCH_ALL);
+ }
+
+ augmentedOrder.addAll(importOrder);
+
+ if (needsTypeMatchAll) {
+ augmentedOrder.add(MATCH_ALL);
+ }
+
+ return augmentedOrder;
+ }
+
+ private static synchronized IndexedImportGroups indexImportOrder(List<String> importOrder) {
+ if (importOrder.equals(memoizedImportOrder)) {
+ return memoizedIndexedImportGroups;
+ }
+
+ Map<String, Integer> typeGroupsAndIndices = new HashMap<String, Integer>();
+ Map<String, Integer> staticGroupsAndIndices = new HashMap<String, Integer>();
+ for (int i = 0; i < importOrder.size(); i++) {
+ String importGroupString = importOrder.get(i);
+
+ final Map<String, Integer> groupsAndIndices;
+ if (importGroupString.startsWith(STATIC_PREFIX)) {
+ groupsAndIndices = staticGroupsAndIndices;
+ importGroupString = importGroupString.substring(1);
+ } else {
+ groupsAndIndices = typeGroupsAndIndices;
+ }
+
+ groupsAndIndices.put(importGroupString, i);
+ }
+
+ memoizedImportOrder = importOrder;
+
+ memoizedIndexedImportGroups = new IndexedImportGroups(
+ mapImportGroups(typeGroupsAndIndices),
+ mapImportGroups(staticGroupsAndIndices));
+
+ return memoizedIndexedImportGroups;
+ }
+
+ private static NavigableMap<String, ImportGroup> mapImportGroups(Map<String, Integer> importGroupNamesAndIndices) {
+ if (importGroupNamesAndIndices.isEmpty()) {
+ importGroupNamesAndIndices = Collections.singletonMap(MATCH_ALL, 0);
+ }
+
+ List<String> sortedNames = new ArrayList<String>(importGroupNamesAndIndices.keySet());
+ Collections.sort(sortedNames);
+
+ ArrayList<ImportGroup> importGroups = new ArrayList<ImportGroup>(sortedNames.size());
+
+ Deque<ImportGroup> prefixingGroups = new ArrayDeque<ImportGroup>();
+ for (String name : sortedNames) {
+ while (!prefixingGroups.isEmpty()
+ && !isWholeSegmentPrefix(prefixingGroups.getLast().getName(), name)) {
+ prefixingGroups.removeLast();
+ }
+ ImportGroup prefix = prefixingGroups.peekLast();
+
+ ImportGroup group = new ImportGroup(name, importGroupNamesAndIndices.get(name), prefix);
+
+ importGroups.add(group);
+
+ prefixingGroups.addLast(group);
+ }
+
+ NavigableMap<String, ImportGroup> groupsByName = new TreeMap<String, ImportGroup>();
+ for (ImportGroup group : importGroups) {
+ groupsByName.put(group.getName(), group);
+ }
+
+ return groupsByName;
+ }
+
+ private static boolean isWholeSegmentPrefix(String prefix, String name) {
+ if (!name.startsWith(prefix)) {
+ return false;
+ }
+
+ return prefix.isEmpty() || name.length() == prefix.length() || name.charAt(prefix.length()) == '.';
+ }
+
+ private final IndexedImportGroups indexedImportGroups;
+
+ ImportGroupComparator(List<String> importOrder) {
+ List<String> importOrderWithMatchAllGroups = includeMatchAllImportGroups(importOrder);
+ this.indexedImportGroups = indexImportOrder(importOrderWithMatchAllGroups);
+ }
+
+ @Override
+ public int compare(ImportName o1, ImportName o2) {
+ return determineSortPosition(o1) - determineSortPosition(o2);
+ }
+
+ private int determineSortPosition(ImportName importName) {
+ String name = (importName.isOnDemand() ? importName.containerName : importName.qualifiedName);
+
+ NavigableMap<String, ImportGroup> groupsByName = importName.isStatic
+ ? this.indexedImportGroups.staticImportGroupByName
+ : this.indexedImportGroups.typeImportGroupsByName;
+
+ ImportGroup prefixingGroup = groupsByName.floorEntry(name).getValue();
+ while (!isWholeSegmentPrefix(prefixingGroup.getName(), name)) {
+ prefixingGroup = prefixingGroup.getPrefix();
+ }
+
+ return prefixingGroup.getIndex();
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportName.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportName.java
new file mode 100644
index 0000000..42fbd19
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportName.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import org.aspectj.org.eclipse.jdt.core.Signature;
+import org.aspectj.org.eclipse.jdt.core.dom.ImportDeclaration;
+
+/**
+ * Encapsulates an import's fully qualified name, whether it is on-demand, and whether it is static.
+ * <p>
+ * The fully qualified name is divided into two parts:
+ * <ul>
+ * <li>a container name, which is everything preceding the last dot ('.').
+ * <li>a simple name, which is the part following the last dot ("*" for an on-demand import).
+ * </ul>
+ */
+public final class ImportName {
+ static ImportName createFor(ImportDeclaration importDeclaration) {
+ String declName = importDeclaration.getName().getFullyQualifiedName();
+ if (importDeclaration.isOnDemand()) {
+ return createOnDemand(importDeclaration.isStatic(), declName);
+ }
+ return createFor(importDeclaration.isStatic(), declName);
+ }
+
+ static ImportName createOnDemand(boolean isStatic, String containerName) {
+ return new ImportName(isStatic, containerName, "*"); //$NON-NLS-1$
+ }
+
+ public static ImportName createFor(boolean isStatic, String qualifiedName) {
+ String containerName = Signature.getQualifier(qualifiedName);
+ String simpleName = Signature.getSimpleName(qualifiedName);
+ return new ImportName(isStatic, containerName, simpleName);
+ }
+
+ public final boolean isStatic;
+ public final String containerName;
+ public final String simpleName;
+ public final String qualifiedName;
+
+ private ImportName(boolean isStatic, String containerName, String simpleName) {
+ this.isStatic = isStatic;
+ this.containerName = containerName;
+ this.simpleName = simpleName;
+
+ this.qualifiedName = containerName.isEmpty() ? simpleName : containerName + "." + simpleName; //$NON-NLS-1$;
+ }
+
+ @Override
+ public String toString() {
+ String template = this.isStatic ? "staticImport(%s)" : "typeImport(%s)"; //$NON-NLS-1$ //$NON-NLS-2$
+ return String.format(template, this.qualifiedName);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = this.qualifiedName.hashCode();
+ result = 31 * result + (this.isStatic ? 1 : 0);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof ImportName)) {
+ return false;
+ }
+
+ ImportName other = (ImportName) obj;
+
+ return this.qualifiedName.equals(other.qualifiedName) && this.isStatic == other.isStatic;
+ }
+
+ public boolean isOnDemand() {
+ return this.simpleName.equals("*"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns an on-demand ImportName with the same isStatic and containerName as this ImportName.
+ */
+ ImportName getContainerOnDemand() {
+ if (this.isOnDemand()) {
+ return this;
+ }
+
+ return ImportName.createOnDemand(this.isStatic, this.containerName);
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer.java
new file mode 100644
index 0000000..3377f38
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteAnalyzer.java
@@ -0,0 +1,664 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2013, 2014, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for Bug 378024 - Ordering of comments between imports not preserved
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.NavigableMap;
+import java.util.Set;
+import java.util.TreeMap;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.aspectj.org.eclipse.jdt.core.ICompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.IJavaProject;
+import org.aspectj.org.eclipse.jdt.core.JavaCore;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
+import org.aspectj.org.eclipse.jdt.core.dom.Comment;
+import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
+import org.aspectj.org.eclipse.jdt.core.search.SearchEngine;
+import org.aspectj.org.eclipse.jdt.internal.core.JavaProject;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports.ConflictIdentifier.Conflicts;
+import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Allows the caller to specify imports to be added to or removed from a compilation unit and
+ * creates a TextEdit which, applied to the compilation unit, effects the specified additions and
+ * removals.
+ * <p>
+ * Operates in either of two modes (selected via {@link ImportRewriteConfiguration.Builder}'s
+ * static factory methods):
+ * <ul>
+ * <li>Discarding original imports and totally sorting all imports added thereafter. This mode is
+ * used by the Organize Imports operation.</li>
+ * <li>Preserving original imports and placing each added import adjacent to the one most closely
+ * matching it. This mode is used e.g. when Content Assist adds an import for a completed name.</li>
+ * </ul>
+ */
+public final class ImportRewriteAnalyzer {
+ /**
+ * Encapsulates, for a computed import rewrite, a {@code TextEdit} that can be applied to effect
+ * the rewrite as well as the names of imports created by the rewrite.
+ */
+ public static final class RewriteResult {
+ private final TextEdit textEdit;
+ private final Set<ImportName> createdImports;
+
+ RewriteResult(TextEdit textEdit, Set<ImportName> createdImports) {
+ this.textEdit = textEdit;
+ this.createdImports = Collections.unmodifiableSet(createdImports);
+ }
+
+ /**
+ * Returns a {@link TextEdit} describing the changes necessary to perform the rewrite.
+ */
+ public TextEdit getTextEdit() {
+ return this.textEdit;
+ }
+
+ public String[] getCreatedImports() {
+ return extractQualifiedNames(false, this.createdImports);
+ }
+
+ public String[] getCreatedStaticImports() {
+ return extractQualifiedNames(true, this.createdImports);
+ }
+
+ private String[] extractQualifiedNames(boolean b, Collection<ImportName> imports) {
+ List<String> names = new ArrayList<String>(imports.size());
+ for (ImportName importName : imports) {
+ if (importName.isStatic == b) {
+ names.add(importName.qualifiedName);
+ }
+ }
+
+ return names.toArray(new String[names.size()]);
+ }
+ }
+
+ /**
+ * Returns the value of the formatter option specifying how many blank lines to insert between
+ * import groups.
+ */
+ private static int getBlankLinesBetweenImportGroups(IJavaProject javaProject) {
+ int num = -1;
+
+ String blankLinesOptionValue =
+ javaProject.getOption(DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS, true);
+ try {
+ num = Integer.parseInt(blankLinesOptionValue);
+ } catch (NumberFormatException e) {
+ String message = String.format(
+ "Could not parse the value of %s as an integer: %s", //$NON-NLS-1$
+ DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS,
+ blankLinesOptionValue);
+ Util.log(new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, message, e));
+ }
+
+ return num >= 0 ? num : 1;
+ }
+
+ /**
+ * Returns the value of the formatter option specifying whether to insert a space between the
+ * imported name and the semicolon in an import declaration.
+ */
+ private static boolean shouldInsertSpaceBeforeSemicolon(IJavaProject javaProject) {
+ return JavaCore.INSERT.equals(
+ javaProject.getOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, true));
+ }
+
+ /**
+ * Reads the positions of each existing import declaration along with any associated comments,
+ * and returns these in a list whose iteration order reflects the existing order of the imports
+ * in the compilation unit.
+ */
+ private static List<OriginalImportEntry> readOriginalImports(CompilationUnit compilationUnit) {
+ List<ImportDeclaration> importDeclarations = compilationUnit.imports();
+
+ if (importDeclarations.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ List<Comment> comments = compilationUnit.getCommentList();
+
+ int currentCommentIndex = 0;
+
+ // Skip over package and file header comments (see https://bugs.eclipse.org/121428).
+ ImportDeclaration firstImport = importDeclarations.get(0);
+ PackageDeclaration packageDeclaration = compilationUnit.getPackage();
+ int firstImportStartPosition = packageDeclaration == null
+ ? firstImport.getStartPosition()
+ : compilationUnit.getExtendedStartPosition(packageDeclaration)
+ + compilationUnit.getExtendedLength(packageDeclaration);
+ while (currentCommentIndex < comments.size()
+ && comments.get(currentCommentIndex).getStartPosition() < firstImportStartPosition) {
+ currentCommentIndex++;
+ }
+
+ List<OriginalImportEntry> imports = new ArrayList<OriginalImportEntry>(importDeclarations.size());
+ int previousExtendedEndPosition = -1;
+ for (ImportDeclaration currentImport : importDeclarations) {
+ int extendedEndPosition = compilationUnit.getExtendedStartPosition(currentImport)
+ + compilationUnit.getExtendedLength(currentImport);
+
+ int commentAfterImportIndex = currentCommentIndex;
+ while (commentAfterImportIndex < comments.size()
+ && comments.get(commentAfterImportIndex).getStartPosition() < extendedEndPosition) {
+ commentAfterImportIndex++;
+ }
+
+ List<ImportComment> importComments;
+ if (commentAfterImportIndex == currentCommentIndex) {
+ importComments = Collections.emptyList();
+ } else {
+ importComments = selectImportComments(
+ compilationUnit,
+ comments,
+ currentImport.getStartPosition(),
+ currentCommentIndex,
+ commentAfterImportIndex);
+ }
+
+ int importAndCommentsStartPosition = importComments.isEmpty()
+ ? currentImport.getStartPosition()
+ : Math.min(currentImport.getStartPosition(), importComments.get(0).region.getOffset());
+
+ IRegion leadingWhitespaceRegion;
+ int precedingLineDelimiters;
+ if (previousExtendedEndPosition == -1) {
+ leadingWhitespaceRegion = new Region(importAndCommentsStartPosition, 0);
+ precedingLineDelimiters = 0;
+ } else {
+ leadingWhitespaceRegion = new Region(
+ previousExtendedEndPosition, importAndCommentsStartPosition - previousExtendedEndPosition);
+ int importAndCommentsFirstLine = compilationUnit.getLineNumber(importAndCommentsStartPosition);
+ int lastLineOfPrevious = compilationUnit.getLineNumber(previousExtendedEndPosition - 1);
+ precedingLineDelimiters = importAndCommentsFirstLine - lastLineOfPrevious;
+ }
+ IRegion importAndCommentsRegion =
+ new Region(importAndCommentsStartPosition, extendedEndPosition - importAndCommentsStartPosition);
+
+ imports.add(new OriginalImportEntry(
+ ImportName.createFor(currentImport),
+ importComments,
+ precedingLineDelimiters,
+ leadingWhitespaceRegion,
+ importAndCommentsRegion));
+
+ currentCommentIndex = commentAfterImportIndex;
+ previousExtendedEndPosition = extendedEndPosition;
+ }
+
+ return imports;
+ }
+
+ private static List<ImportComment> selectImportComments(
+ CompilationUnit compilationUnit,
+ List<Comment> comments,
+ int importDeclarationStartPosition,
+ int commentStartIndex,
+ int commentEndIndex) {
+ List<ImportComment> importComments = new ArrayList<ImportComment>(comments.size());
+
+ Iterator<Comment> commentIterator = comments.subList(commentStartIndex, commentEndIndex).iterator();
+ Comment currentComment = commentIterator.hasNext() ? commentIterator.next() : null;
+ while (currentComment != null) {
+ int currentCommentStartPosition = currentComment.getStartPosition();
+ int currentCommentLength = currentComment.getLength();
+
+ Comment nextComment = commentIterator.hasNext() ? commentIterator.next() : null;
+
+ int succeedingLineDelims;
+ int nextCommentStartPosition = nextComment == null ? Integer.MAX_VALUE : nextComment.getStartPosition();
+ int nextStartPosition = Math.min(importDeclarationStartPosition, nextCommentStartPosition);
+ if (nextStartPosition == Integer.MAX_VALUE) {
+ // This trailing comment is located at the end of the import's extended range
+ // and we don't care how many line delimiters follow it.
+ succeedingLineDelims = 0;
+ } else {
+ int currentCommentEndLine =
+ compilationUnit.getLineNumber(currentCommentStartPosition + currentCommentLength);
+ int nextStartLine = compilationUnit.getLineNumber(nextStartPosition);
+ succeedingLineDelims = nextStartLine - currentCommentEndLine;
+ }
+
+ importComments.add(new ImportComment(
+ new Region(currentCommentStartPosition, currentCommentLength), succeedingLineDelims));
+
+ currentComment = nextComment;
+ }
+
+ return importComments;
+ }
+
+ private static RewriteSite determineRewriteSite(
+ CompilationUnit compilationUnit, List<OriginalImportEntry> originalImports) {
+ IRegion importsRegion = determineImportsRegion(originalImports);
+
+ IRegion surroundingRegion = determineSurroundingRegion(compilationUnit, importsRegion);
+
+ boolean hasPrecedingElements = surroundingRegion.getOffset() != 0;
+
+ boolean hasSucceedingElements =
+ surroundingRegion.getOffset() + surroundingRegion.getLength() != compilationUnit.getLength();
+
+ return new RewriteSite(
+ surroundingRegion,
+ importsRegion,
+ hasPrecedingElements,
+ hasSucceedingElements);
+ }
+
+ /**
+ * Determines the region originally occupied by imports and their associated comments.
+ * <p>
+ * Returns null if originalImports is null or empty.
+ */
+ private static IRegion determineImportsRegion(List<OriginalImportEntry> originalImports) {
+ if (originalImports == null || originalImports.isEmpty()) {
+ return null;
+ }
+
+ OriginalImportEntry firstImport = originalImports.get(0);
+ int start = firstImport.declarationAndComments.getOffset();
+
+ OriginalImportEntry lastImport = originalImports.get(originalImports.size() - 1);
+ int end = lastImport.declarationAndComments.getOffset()
+ + lastImport.declarationAndComments.getLength();
+
+ return new Region(start, end - start);
+ }
+
+ /**
+ * Determines the region to be occupied by imports, their associated comments, and surrounding
+ * whitespace.
+ */
+ private static IRegion determineSurroundingRegion(CompilationUnit compilationUnit, IRegion importsRegion) {
+ NavigableMap<Integer, ASTNode> nodesTreeMap = mapTopLevelNodes(compilationUnit);
+
+ int surroundingStart;
+ int positionAfterImports;
+ if (importsRegion == null) {
+ PackageDeclaration packageDeclaration = compilationUnit.getPackage();
+ if (packageDeclaration != null) {
+ surroundingStart = compilationUnit.getExtendedStartPosition(packageDeclaration)
+ + compilationUnit.getExtendedLength(packageDeclaration);
+ }
+ else {
+ surroundingStart = 0;
+ }
+
+ positionAfterImports = surroundingStart;
+ } else {
+ Entry<Integer, ASTNode> lowerEntry = nodesTreeMap.lowerEntry(importsRegion.getOffset());
+ if (lowerEntry != null) {
+ ASTNode precedingNode = lowerEntry.getValue();
+ surroundingStart = precedingNode.getStartPosition() + precedingNode.getLength();
+ } else {
+ surroundingStart = 0;
+ }
+
+ positionAfterImports = importsRegion.getOffset() + importsRegion.getLength();
+ }
+
+ Integer ceilingKey = nodesTreeMap.ceilingKey(positionAfterImports);
+ int surroundingEnd = ceilingKey != null ? ceilingKey : compilationUnit.getLength();
+
+ return new Region(surroundingStart, surroundingEnd - surroundingStart);
+ }
+
+ /**
+ * Builds a NavigableMap containing all of the given compilation unit's top-level nodes
+ * (package declaration, import declarations, type declarations, and non-doc comments),
+ * keyed by start position.
+ */
+ private static NavigableMap<Integer, ASTNode> mapTopLevelNodes(CompilationUnit compilationUnit) {
+ NavigableMap<Integer, ASTNode> map = new TreeMap<Integer, ASTNode>();
+
+ Collection<ASTNode> nodes = new ArrayList<ASTNode>();
+ if (compilationUnit.getPackage() != null) {
+ nodes.add(compilationUnit.getPackage());
+ }
+ nodes.addAll(compilationUnit.imports());
+ nodes.addAll(compilationUnit.types());
+ for (Comment comment : ((List<Comment>) compilationUnit.getCommentList())) {
+ // Include only top-level (non-doc) comments;
+ // doc comments are contained within their parent nodes' ranges.
+ if (comment.getParent() == null) {
+ nodes.add(comment);
+ }
+ }
+
+ for (ASTNode node : nodes) {
+ map.put(node.getStartPosition(), node);
+ }
+
+ return map;
+ }
+
+ /**
+ * Builds an {@code IdentityHashMap} having the elements of {@code imports} as values and each
+ * element's {@code importName} as corresponding key. This map can be used to recall the {@code
+ * ImportEntry} corresponding to a given {@code ImportName} instance even when there are
+ * duplicate import declarations (where multiple {@code ImportEntry}s have equal, but not
+ * identical, {@code ImportName}s).
+ */
+ private static Map<ImportName, OriginalImportEntry> mapImportsByNameIdentity(List<OriginalImportEntry> imports) {
+ Map<ImportName, OriginalImportEntry> importsByName = new IdentityHashMap<ImportName, OriginalImportEntry>();
+
+ for (OriginalImportEntry currentImport : imports) {
+ importsByName.put(currentImport.importName, currentImport);
+ }
+
+ return Collections.unmodifiableMap(importsByName);
+ }
+
+ /**
+ * Returns a new {@code List} containing those elements of {@code imports} (in their existing
+ * order) not contained in {@code importsToSubtract}.
+ */
+ private static List<ImportName> subtractImports(
+ Collection<ImportName> existingImports, Set<ImportName> importsToSubtract) {
+ List<ImportName> remainingImports = new ArrayList<ImportName>(existingImports.size());
+ for (ImportName existingImport : existingImports) {
+ if (!importsToSubtract.contains(existingImport)) {
+ remainingImports.add(existingImport);
+ }
+ }
+ return remainingImports;
+ }
+
+ private final List<OriginalImportEntry> originalImportEntries;
+ private final List<ImportName> originalImportsList;
+ private final Set<ImportName> originalImportsSet;
+
+ private final ImportDeclarationWriter importDeclarationWriter;
+
+ private final ImportAdder importAdder;
+
+ private final Set<ImportName> importsToAdd;
+ private final Set<ImportName> importsToRemove;
+
+ private final boolean reportAllResultantImportsAsCreated;
+
+ private final Set<String> typeExplicitSimpleNames;
+ private final Set<String> staticExplicitSimpleNames;
+
+ private final Set<String> implicitImportContainerNames;
+
+ private final ConflictIdentifier conflictIdentifier;
+
+ private final OnDemandComputer onDemandComputer;
+
+ private final Map<ImportName, OriginalImportEntry> importsByNameIdentity;
+
+ private final String lineDelimiter;
+
+ private final ImportEditor importEditor;
+
+ public ImportRewriteAnalyzer(
+ ICompilationUnit cu,
+ CompilationUnit astRoot,
+ ImportRewriteConfiguration configuration) throws JavaModelException {
+ this.originalImportEntries = Collections.unmodifiableList(readOriginalImports(astRoot));
+
+ List<ImportName> importsList = new ArrayList<ImportName>(this.originalImportEntries.size());
+ Set<ImportName> importsSet = new HashSet<ImportName>();
+ for (ImportEntry originalImportEntry : this.originalImportEntries) {
+ ImportName importName = originalImportEntry.importName;
+ importsList.add(importName);
+ importsSet.add(importName);
+ }
+ this.originalImportsList = Collections.unmodifiableList(importsList);
+ this.originalImportsSet = Collections.unmodifiableSet(importsSet);
+
+ this.importsToAdd = new LinkedHashSet<ImportName>();
+
+ this.importsToRemove = new LinkedHashSet<ImportName>();
+ if (configuration.originalImportHandling.shouldRemoveOriginalImports()) {
+ this.importsToRemove.addAll(importsSet);
+ this.reportAllResultantImportsAsCreated = true;
+ } else {
+ this.reportAllResultantImportsAsCreated = false;
+ }
+
+ this.typeExplicitSimpleNames = new HashSet<String>();
+ this.staticExplicitSimpleNames = new HashSet<String>();
+
+ ImportGroupComparator importGroupComparator = new ImportGroupComparator(configuration.importOrder);
+
+ JavaProject javaProject = (JavaProject) cu.getJavaProject();
+
+ this.importAdder = configuration.originalImportHandling.createImportAdder(new ImportComparator(
+ importGroupComparator,
+ configuration.typeContainerSorting.createContainerComparator(javaProject),
+ configuration.staticContainerSorting.createContainerComparator(javaProject)));
+
+ this.implicitImportContainerNames =
+ configuration.implicitImportIdentification.determineImplicitImportContainers(cu);
+
+ this.onDemandComputer = new OnDemandComputer(
+ configuration.typeOnDemandThreshold,
+ configuration.staticOnDemandThreshold);
+
+ this.conflictIdentifier = new ConflictIdentifier(
+ this.onDemandComputer,
+ new TypeConflictingSimpleNameFinder(javaProject, new SearchEngine()),
+ new StaticConflictingSimpleNameFinder(javaProject),
+ this.implicitImportContainerNames);
+
+ this.importsByNameIdentity = mapImportsByNameIdentity(this.originalImportEntries);
+
+ this.importDeclarationWriter = new ImportDeclarationWriter(shouldInsertSpaceBeforeSemicolon(javaProject));
+
+ this.lineDelimiter = cu.findRecommendedLineSeparator();
+
+ this.importEditor = new ImportEditor(
+ this.lineDelimiter,
+ configuration.originalImportHandling.shouldFixAllLineDelimiters(),
+ getBlankLinesBetweenImportGroups(javaProject) + 1,
+ importGroupComparator,
+ this.originalImportEntries,
+ determineRewriteSite(astRoot, this.originalImportEntries),
+ this.importDeclarationWriter);
+ }
+
+ /**
+ * Specifies that applying the rewrite should result in the compilation unit containing the
+ * specified import.
+ * <p>
+ * Has no effect if the compilation unit otherwise would contain the given import.
+ * <p>
+ * Overrides any previous corresponding call to {@link #removeImport}.
+ */
+ public void addImport(boolean isStatic, String qualifiedName) {
+ ImportName importToAdd = ImportName.createFor(isStatic, qualifiedName);
+ this.importsToAdd.add(importToAdd);
+ this.importsToRemove.remove(importToAdd);
+ }
+
+ /**
+ * Specifies that applying the rewrite should result in the compilation unit not containing the
+ * specified import.
+ * <p>
+ * Has no effect if the compilation unit otherwise would not contain the given import.
+ * <p>
+ * Overrides any previous corresponding call to {@link #addImport}.
+ */
+ public void removeImport(boolean isStatic, String qualifiedName) {
+ ImportName importToRemove = ImportName.createFor(isStatic, qualifiedName);
+ this.importsToAdd.remove(importToRemove);
+ this.importsToRemove.add(importToRemove);
+ }
+
+ /**
+ * Specifies that any import of the given simple name must be explicit - that it may neither be
+ * reduced into an on-demand (".*") import nor be filtered as an implicit (e.g. "java.lang.*")
+ * import.
+ */
+ public void requireExplicitImport(boolean isStatic, String simpleName) {
+ if (isStatic) {
+ this.staticExplicitSimpleNames.add(simpleName);
+ } else {
+ this.typeExplicitSimpleNames.add(simpleName);
+ }
+ }
+
+ /**
+ * Computes and returns the result of performing the rewrite, incorporating all changes
+ * specified by calls to {@link #addImport}, {@link #removeImport}, and
+ * {@link #requireExplicitImport}.
+ * <p>
+ * This method has no side-effects.
+ */
+ public RewriteResult analyzeRewrite(IProgressMonitor monitor) throws JavaModelException {
+ List<ImportName> computedImportOrder = computeImportOrder(monitor);
+
+ List<ImportEntry> resultingImportEntries = matchExistingOrCreateNew(computedImportOrder);
+
+ TextEdit edit = this.importEditor.createTextEdit(resultingImportEntries);
+
+ Set<ImportName> createdImports = new HashSet<ImportName>(computedImportOrder);
+ if (!this.reportAllResultantImportsAsCreated) {
+ createdImports.removeAll(this.originalImportsSet);
+ }
+
+ return new RewriteResult(edit, createdImports);
+ }
+
+ private List<ImportName> computeImportOrder(IProgressMonitor progressMonitor) throws JavaModelException {
+ Set<ImportName> importsWithAdditionsAndRemovals = new HashSet<ImportName>(this.originalImportsSet);
+ importsWithAdditionsAndRemovals.addAll(this.importsToAdd);
+ importsWithAdditionsAndRemovals.removeAll(this.importsToRemove);
+
+ Set<ImportName> touchedContainers = determineTouchedContainers();
+
+ Conflicts conflicts = this.conflictIdentifier.identifyConflicts(
+ importsWithAdditionsAndRemovals,
+ touchedContainers,
+ this.typeExplicitSimpleNames,
+ this.staticExplicitSimpleNames,
+ progressMonitor);
+
+ Set<String> allTypeExplicitSimpleNames = new HashSet<String>(this.typeExplicitSimpleNames);
+ allTypeExplicitSimpleNames.addAll(conflicts.typeConflicts);
+
+ Set<String> allStaticExplicitSimpleNames = new HashSet<String>(this.staticExplicitSimpleNames);
+ allStaticExplicitSimpleNames.addAll(conflicts.staticConflicts);
+
+ Set<ImportName> implicitImports = identifyImplicitImports(this.importsToAdd, allTypeExplicitSimpleNames);
+ List<ImportName> importsWithoutImplicits =
+ subtractImports(importsWithAdditionsAndRemovals, implicitImports);
+
+ Collection<OnDemandReduction> onDemandReductions = this.onDemandComputer.identifyPossibleReductions(
+ new HashSet<ImportName>(importsWithoutImplicits),
+ touchedContainers,
+ allTypeExplicitSimpleNames,
+ allStaticExplicitSimpleNames);
+
+ ImportsDelta delta = computeDelta(implicitImports, onDemandReductions);
+
+ List<ImportName> importsWithRemovals = subtractImports(this.originalImportsList, delta.importsToRemove);
+
+ List<ImportName> importsWithAdditions = this.importAdder.addImports(importsWithRemovals, delta.importsToAdd);
+
+ return importsWithAdditions;
+ }
+
+ private Set<ImportName> determineTouchedContainers() {
+ Collection<ImportName> touchedContainers = new ArrayList<ImportName>(
+ this.importsToAdd.size() + this.importsToRemove.size());
+
+ for (ImportName addedImport : this.importsToAdd) {
+ touchedContainers.add(addedImport.getContainerOnDemand());
+ }
+ for (ImportName removedImport : this.importsToRemove) {
+ touchedContainers.add(removedImport.getContainerOnDemand());
+ }
+
+ return Collections.unmodifiableSet(new HashSet<ImportName>(touchedContainers));
+ }
+
+ private Set<ImportName> identifyImplicitImports(
+ Collection<ImportName> addedImports, Set<String> allTypeExplicitSimpleNames) {
+ if (this.implicitImportContainerNames.isEmpty()) {
+ return Collections.emptySet();
+ }
+
+ Collection<ImportName> implicits = new ArrayList<ImportName>(addedImports.size());
+ for (ImportName addedImport : addedImports) {
+ boolean isImplicit = this.implicitImportContainerNames.contains(addedImport.containerName)
+ && !allTypeExplicitSimpleNames.contains(addedImport.simpleName);
+ if (isImplicit) {
+ implicits.add(addedImport);
+ }
+ }
+
+ if (implicits.isEmpty()) {
+ return Collections.emptySet();
+ }
+
+ return new HashSet<ImportName>(implicits);
+ }
+
+ private List<ImportEntry> matchExistingOrCreateNew(Collection<ImportName> importNames) {
+ List<ImportEntry> importEntries = new ArrayList<ImportEntry>(importNames.size());
+ for (ImportName importName : importNames) {
+ ImportEntry importEntry = this.importsByNameIdentity.get(importName);
+
+ if (importEntry == null) {
+ importEntry = new NewImportEntry(importName);
+ }
+
+ importEntries.add(importEntry);
+ }
+ return importEntries;
+ }
+
+ private ImportsDelta computeDelta(
+ Collection<ImportName> implicitImports, Collection<OnDemandReduction> onDemandReductions) {
+ Collection<ImportName> additions = new ArrayList<ImportName>(this.originalImportsList.size());
+ additions.addAll(this.importsToAdd);
+
+ Collection<ImportName> removals = new ArrayList<ImportName>(this.originalImportsList.size());
+ removals.addAll(this.importsToRemove);
+ removals.addAll(implicitImports);
+
+ additions.removeAll(removals);
+
+ for (OnDemandReduction onDemandReduction : onDemandReductions) {
+ additions.removeAll(onDemandReduction.reducibleImports);
+ removals.addAll(onDemandReduction.reducibleImports);
+
+ additions.add(onDemandReduction.containerOnDemand);
+ removals.remove(onDemandReduction.containerOnDemand);
+ }
+
+ return new ImportsDelta(additions, removals);
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration.java
new file mode 100644
index 0000000..0ba0279
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportRewriteConfiguration.java
@@ -0,0 +1,282 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.aspectj.org.eclipse.jdt.core.ICompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.IJavaElement;
+import org.aspectj.org.eclipse.jdt.core.IPackageDeclaration;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+import org.aspectj.org.eclipse.jdt.internal.core.JavaProject;
+
+/**
+ * Used as a constructor parameter to ImportRewriteAnalyzer to configure its behavior.
+ * <p>
+ * The starting points are the two static factory methods of {@link Builder}.
+ */
+public final class ImportRewriteConfiguration {
+ public enum OriginalImportHandling {
+ /**
+ * Specifies to discard original imports and totally sort all new imports, as in the case of
+ * the "Organize Imports" operation.
+ */
+ DISCARD {
+ @Override
+ boolean shouldRemoveOriginalImports() {
+ return true;
+ }
+
+ @Override
+ boolean shouldFixAllLineDelimiters() {
+ return true;
+ }
+
+ @Override
+ ImportAdder createImportAdder(Comparator<ImportName> importComparator) {
+ return new ReorderingImportAdder(importComparator);
+ }
+ },
+ /**
+ * Specifies to keep original imports in their original order, placing each newly added
+ * import adjacent to the original import that it most closely matches.
+ */
+ PRESERVE_IN_ORDER {
+ @Override
+ boolean shouldRemoveOriginalImports() {
+ return false;
+ }
+
+ @Override
+ boolean shouldFixAllLineDelimiters() {
+ return false;
+ }
+
+ @Override
+ ImportAdder createImportAdder(Comparator<ImportName> importComparator) {
+ return new OrderPreservingImportAdder(importComparator);
+ }
+ },
+ ;
+
+ /**
+ * If true, ImportRewriteAnalyzer will, during its initialization, mark all original imports
+ * for removal.
+ */
+ abstract boolean shouldRemoveOriginalImports();
+
+ /**
+ * If true, line delimiters will be standardized between every pair of adjacent imports.
+ * Otherwise, line delimiters will be corrected only between pairs of adjacent imports that
+ * were not adjacent originally.
+ */
+ abstract boolean shouldFixAllLineDelimiters();
+
+ /**
+ * Creates the {@link ImportAdder} which will combine and order new and existing imports
+ * together.
+ */
+ abstract ImportAdder createImportAdder(Comparator<ImportName> importComparator);
+ }
+
+ /**
+ * Specifies how to sort import declarations by their packages and/or containing types.
+ */
+ public enum ImportContainerSorting {
+ /**
+ * Sorts imports by each import's package and any containing types, in lexicographic order.
+ * For example (assuming that all of the imports belong to the same import group):
+ * <pre>
+ * import java.net.Socket;
+ * import java.util.Map;
+ * import java.util.Set;
+ * import java.util.Map.Entry;
+ * </pre>
+ */
+ BY_PACKAGE_AND_CONTAINING_TYPE {
+ @Override
+ Comparator<ImportName> createContainerComparator(JavaProject javaProject) {
+ return new PackageAndContainingTypeImportComparator();
+ }
+ },
+
+ /**
+ * Sorts imports by each import's package, in lexicographic order. For example (assuming all
+ * of the imports belong to the same import group):
+ * <pre>
+ * import java.net.Socket;
+ * import java.util.Map;
+ * import java.util.Map.Entry;
+ * import java.util.Set;
+ * </pre>
+ */
+ BY_PACKAGE {
+ @Override
+ Comparator<ImportName> createContainerComparator(JavaProject javaProject) {
+ return new PackageImportComparator(javaProject);
+ }
+ },
+ ;
+
+ abstract Comparator<ImportName> createContainerComparator(JavaProject javaProject);
+ }
+
+ /**
+ * Specifies which types are considered to be implicitly imported.
+ * <p>
+ * An import declaration of such a type will not be added to the compilation unit unless it is
+ * needed to resolve a conflict with an on-demand imports, or the type's simple name has been
+ * specified with {@link ImportRewriteAnalyzer#requireExplicitImport}.
+ * <p>
+ * Also, implicitly imported types will be considered for conflicts when deciding which types
+ * from other packages can be reduced into on-demand imports. E.g. if java.lang.Integer were
+ * considered to be implicitly imported, that would prevent an import of com.example.Integer
+ * from being reduced into an on-demand import of com.example.*.
+ */
+ public enum ImplicitImportIdentification {
+ /**
+ * Specifies that types from the following packages are considered to be implicitly
+ * imported:
+ * <ul>
+ * <li>java.lang</li>
+ * <li>the package of the compilation unit being rewritten</li>
+ * </ul>
+ */
+ JAVA_LANG_AND_CU_PACKAGE {
+ @Override
+ Set<String> determineImplicitImportContainers(ICompilationUnit compilationUnit) {
+ Set<String> implicitImportContainerNames = new HashSet<String>();
+
+ implicitImportContainerNames.add("java.lang"); //$NON-NLS-1$
+
+ IJavaElement packageFragment = compilationUnit.getParent();
+ String compilationUnitPackageName = packageFragment.getElementName();
+ if (compilationUnitPackageName.isEmpty() && !packageFragment.exists() && compilationUnit.exists()) {
+ /*
+ * For a file outside of the build path, JavaCore#create(IFile) creates an
+ * ICompilationUnit with the file's parent folder as package fragment root, and a default package.
+ * That "wrong" package is problematic for the ImportRewrite, since it doesn't get filtered
+ * and eventually leads to unused import statements.
+ */
+ try {
+ IPackageDeclaration[] packageDeclarations = compilationUnit.getPackageDeclarations();
+ if (packageDeclarations.length > 0) {
+ implicitImportContainerNames.add(packageDeclarations[0].getElementName());
+ return implicitImportContainerNames;
+ }
+ } catch (JavaModelException e) {
+ // continue
+ }
+ }
+ implicitImportContainerNames.add(compilationUnitPackageName);
+
+ return implicitImportContainerNames;
+ }
+ },
+ /**
+ * Specifies that no types are considered to be implicitly imported.
+ */
+ NONE {
+ @Override
+ Set<String> determineImplicitImportContainers(ICompilationUnit compilationUnit) {
+ return Collections.emptySet();
+ }
+ },
+ ;
+
+ abstract Set<String> determineImplicitImportContainers(ICompilationUnit compilationUnit);
+ }
+
+ public static class Builder {
+ public static Builder discardingOriginalImports() {
+ return new Builder(OriginalImportHandling.DISCARD);
+ }
+
+ public static Builder preservingOriginalImports() {
+ return new Builder(OriginalImportHandling.PRESERVE_IN_ORDER);
+ }
+
+ final OriginalImportHandling originalImportHandling;
+ ImportContainerSorting typeContainerSorting;
+ ImportContainerSorting staticContainerSorting;
+ ImplicitImportIdentification implicitImportIdentification;
+ List<String> importOrder;
+ Integer typeOnDemandThreshold;
+ Integer staticOnDemandThreshold;
+
+ private Builder(OriginalImportHandling originalImportHandling) {
+ this.originalImportHandling = originalImportHandling;
+ this.typeContainerSorting = ImportContainerSorting.BY_PACKAGE;
+ this.staticContainerSorting = ImportContainerSorting.BY_PACKAGE_AND_CONTAINING_TYPE;
+ this.implicitImportIdentification = ImplicitImportIdentification.JAVA_LANG_AND_CU_PACKAGE;
+ this.importOrder = Collections.emptyList();
+ this.typeOnDemandThreshold = null;
+ this.staticOnDemandThreshold = null;
+ }
+
+ public Builder setTypeContainerSorting(ImportContainerSorting typeContainerSorting) {
+ this.typeContainerSorting = typeContainerSorting;
+ return this;
+ }
+
+ public Builder setStaticContainerSorting(ImportContainerSorting staticContainerSorting) {
+ this.staticContainerSorting = staticContainerSorting;
+ return this;
+ }
+
+ public Builder setImplicitImportIdentification(ImplicitImportIdentification implicitImportIdentification) {
+ this.implicitImportIdentification = implicitImportIdentification;
+ return this;
+ }
+
+ public Builder setImportOrder(List<String> importOrder) {
+ this.importOrder = Collections.unmodifiableList(new ArrayList<String>(importOrder));
+ return this;
+ }
+
+ public Builder setTypeOnDemandThreshold(int typeOnDemandThreshold) {
+ this.typeOnDemandThreshold = typeOnDemandThreshold;
+ return this;
+ }
+
+ public Builder setStaticOnDemandThreshold(int staticOnDemandThreshold) {
+ this.staticOnDemandThreshold = staticOnDemandThreshold;
+ return this;
+ }
+
+ public ImportRewriteConfiguration build() {
+ return new ImportRewriteConfiguration(this);
+ }
+ }
+
+ final OriginalImportHandling originalImportHandling;
+ final ImportContainerSorting typeContainerSorting;
+ final ImportContainerSorting staticContainerSorting;
+ final ImplicitImportIdentification implicitImportIdentification;
+ final List<String> importOrder;
+ final int typeOnDemandThreshold;
+ final int staticOnDemandThreshold;
+
+ ImportRewriteConfiguration(Builder builder) {
+ this.originalImportHandling = builder.originalImportHandling;
+ this.typeContainerSorting = builder.typeContainerSorting;
+ this.staticContainerSorting = builder.staticContainerSorting;
+ this.implicitImportIdentification = builder.implicitImportIdentification;
+ this.importOrder = builder.importOrder;
+ this.typeOnDemandThreshold = builder.typeOnDemandThreshold;
+ this.staticOnDemandThreshold = builder.staticOnDemandThreshold;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportsDelta.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportsDelta.java
new file mode 100644
index 0000000..c8e6043
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ImportsDelta.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Encapsulates a set of imports to add and a set of imports to remove.
+ */
+final class ImportsDelta {
+ final Set<ImportName> importsToAdd;
+ final Set<ImportName> importsToRemove;
+
+ ImportsDelta(Collection<ImportName> importsToAdd, Collection<ImportName> importsToRemove) {
+ this.importsToAdd = Collections.unmodifiableSet(new HashSet<ImportName>(importsToAdd));
+ this.importsToRemove = Collections.unmodifiableSet(new HashSet<ImportName>(importsToRemove));
+ }
+
+ @Override
+ public String toString() {
+ return String.format(
+ "(additions: %s, removals: %s)", //$NON-NLS-1$
+ this.importsToAdd,
+ this.importsToRemove);
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/NewImportEntry.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/NewImportEntry.java
new file mode 100644
index 0000000..12d52b7
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/NewImportEntry.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+/**
+ * Represents an import declaration that did not originally occur in the compilation unit.
+ */
+class NewImportEntry extends ImportEntry {
+ NewImportEntry(ImportName importName) {
+ super(importName);
+ }
+
+ @Override
+ public String toString() {
+ return String.format("NewImportEntry(%s)", this.importName); //$NON-NLS-1$
+ }
+
+ @Override
+ boolean isOriginal() {
+ return false;
+ }
+
+ @Override
+ OriginalImportEntry asOriginalImportEntry() {
+ throw new UnsupportedOperationException();
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandComputer.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandComputer.java
new file mode 100644
index 0000000..ba4b1aa
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandComputer.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+class OnDemandComputer {
+ private int typeOnDemandThreshold;
+ private int staticOnDemandThreshold;
+
+ OnDemandComputer(int typeOnDemandThreshold, int staticOnDemandThreshold) {
+ this.typeOnDemandThreshold = typeOnDemandThreshold;
+ this.staticOnDemandThreshold = staticOnDemandThreshold;
+ }
+
+ /**
+ * Identifies on-demand reductions (additions of on-demand imports with corresponding removal of
+ * single imports) satisfying the type and static on-demand import thresholds.
+ * <p>
+ * Only the containers imports which have been added or removed as part of the rewrite
+ * will be considered for on-demand reductions.
+ *
+ * @param imports
+ * the imports in the compilation unit
+ * @param touchedContainers
+ * the containers of all imports being added or removed as part of this rewrite,
+ * which should be considered for on-demand reductions (specified as an on-demand
+ * ImportName for each container)
+ * @param typeExplicitSimpleNames
+ * simple names of non-static single imports which must be preserved as single
+ * imports and not reduced into on-demand imports
+ * @param staticExplicitSimpleNames
+ * simple names of static single imports which must be preserved as single
+ * imports and not reduced into on-demand imports
+ */
+ Collection<OnDemandReduction> identifyPossibleReductions(
+ Set<ImportName> imports,
+ Set<ImportName> touchedContainers,
+ Set<String> typeExplicitSimpleNames,
+ Set<String> staticExplicitSimpleNames) {
+ Collection<OnDemandReduction> candidates = new ArrayList<OnDemandReduction>();
+
+ Map<ImportName, Collection<ImportName>> importsByContainer = mapByContainer(imports);
+
+ for (Map.Entry<ImportName, Collection<ImportName>> containerAndImports : importsByContainer.entrySet()) {
+ ImportName containerOnDemand = containerAndImports.getKey();
+
+ // Imports from an unnamed package should not be reduced (see bug 461863).
+ boolean isUnnamedPackage = containerOnDemand.containerName.isEmpty();
+
+ if (touchedContainers.contains(containerOnDemand) && !isUnnamedPackage) {
+ Collection<ImportName> containerImports = containerAndImports.getValue();
+
+ Set<String> explicitSimpleNames =
+ containerOnDemand.isStatic ? staticExplicitSimpleNames : typeExplicitSimpleNames;
+
+ int onDemandThreshold =
+ containerOnDemand.isStatic ? this.staticOnDemandThreshold : this.typeOnDemandThreshold;
+
+ OnDemandReduction candidate = maybeReduce(
+ containerOnDemand, containerImports, onDemandThreshold, explicitSimpleNames);
+ if (candidate != null) {
+ candidates.add(candidate);
+ }
+ }
+ }
+
+ return candidates;
+ }
+
+ private Map<ImportName, Collection<ImportName>> mapByContainer(Collection<ImportName> imports) {
+ Map<ImportName, Collection<ImportName>> importsByContainer = new HashMap<ImportName, Collection<ImportName>>();
+ for (ImportName importName : imports) {
+ ImportName containerOnDemand = importName.getContainerOnDemand();
+
+ Collection<ImportName> containerImports = importsByContainer.get(containerOnDemand);
+ if (containerImports == null) {
+ containerImports = new ArrayList<ImportName>();
+ importsByContainer.put(containerOnDemand, containerImports);
+ }
+
+ containerImports.add(importName);
+ }
+
+ return importsByContainer;
+ }
+
+ private OnDemandReduction maybeReduce(
+ ImportName containerOnDemand,
+ Collection<ImportName> containerImports,
+ int onDemandThreshold,
+ Set<String> explicitSimpleNames) {
+ boolean containerHasOnDemand = false;
+ Collection<ImportName> reducibleImports = new ArrayList<ImportName>();
+
+ for (ImportName currentImport : containerImports) {
+ if (currentImport.isOnDemand()) {
+ containerHasOnDemand = true;
+ } else {
+ if (!explicitSimpleNames.contains(currentImport.simpleName)) {
+ reducibleImports.add(currentImport);
+ }
+ }
+ }
+
+ if (containerHasOnDemand || reducibleImports.size() >= onDemandThreshold) {
+ return new OnDemandReduction(containerOnDemand, reducibleImports);
+ }
+
+ return null;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandReduction.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandReduction.java
new file mode 100644
index 0000000..28fe473
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OnDemandReduction.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * Indicates that one or more single imports ({@code reducibleImports}) are unnecessary or could be
+ * rendered unnecessary by the presence of an on-demand (.*) import ({@code containerOnDemand}) of
+ * their containing type or package.
+ * <p>
+ * This "reduction" can be applied by removing all declarations of {@code reducibleImports}
+ * from the compilation unit and adding a declaration of {@code containerOnDemand} to the
+ * compilation unit if one is not already present.
+ */
+class OnDemandReduction {
+ final ImportName containerOnDemand;
+ final Collection<ImportName> reducibleImports;
+
+ OnDemandReduction(ImportName containerName, Collection<ImportName> reducibleImports) {
+ this.containerOnDemand = containerName;
+ this.reducibleImports = Collections.unmodifiableCollection(new ArrayList<ImportName>(reducibleImports));
+ }
+
+ @Override
+ public String toString() {
+ return String.format("{%s: %s}", this.containerOnDemand.containerName, this.reducibleImports); //$NON-NLS-1$
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder.java
new file mode 100644
index 0000000..8be5a60
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OrderPreservingImportAdder.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NavigableSet;
+import java.util.TreeSet;
+
+/**
+ * Keeping existing imports in their existing order, inserts each new import before or after the
+ * import to which it would be adjacent if all (existing and new) imports were totally ordered
+ * together.
+ * <p>
+ * A new import that would sort between two existing imports which are not adjacent in the
+ * existing order will be placed adjacent to the existing import with which it shares a longer
+ * prefix of dot-separated name segments.
+ */
+final class OrderPreservingImportAdder implements ImportAdder {
+ static class AdjacentImports {
+ final Collection<ImportName> importsBefore = new ArrayList<ImportName>();
+ final Collection<ImportName> importsAfter = new ArrayList<ImportName>();
+
+ @Override
+ public String toString() {
+ return String.format("(%s, %s)", this.importsBefore.toString(), this.importsAfter.toString()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Returns the number of prefixing dot-separated segments shared between the two names.
+ * <p>
+ * For example, {@code countMatchingPrefixSegments("foo.pack1.Class", "foo.pack2.Class")} will
+ * return 1 and {@code countMatchingPrefixSegments("foo.pack1.Class", "com.foo.pack1.Class")}
+ * will return 0.
+ */
+ private static int countMatchingPrefixSegments(String name1, String name2) {
+ if (name1.isEmpty() || name2.isEmpty()) {
+ return 0;
+ }
+
+ int matchingSegments = 0;
+ for (int i = 0; i <= name1.length() && i <= name2.length(); i++) {
+ boolean atEndOfName1Segment = i == name1.length() || name1.charAt(i) == '.';
+ boolean atEndOfName2Segment = i == name2.length() || name2.charAt(i) == '.';
+ if (atEndOfName1Segment && atEndOfName2Segment) {
+ matchingSegments++;
+ } else if (atEndOfName1Segment || atEndOfName2Segment) {
+ break;
+ } else if (name1.charAt(i) != name2.charAt(i)) {
+ break;
+ }
+ }
+
+ return matchingSegments;
+ }
+
+ private final Comparator<ImportName> importComparator;
+
+ OrderPreservingImportAdder(Comparator<ImportName> importComparator) {
+ this.importComparator = importComparator;
+ }
+
+ @Override
+ public List<ImportName> addImports(Collection<ImportName> existingImports, Collection<ImportName> importsToAdd) {
+ if (importsToAdd.isEmpty()) {
+ return new ArrayList<ImportName>(existingImports);
+ }
+
+ List<ImportName> sortedNewImports = new ArrayList<ImportName>(importsToAdd);
+ sortedNewImports.removeAll(new HashSet<ImportName>(existingImports));
+ Collections.sort(sortedNewImports, this.importComparator);
+
+ if (existingImports.isEmpty()) {
+ return sortedNewImports;
+ }
+
+ Map<ImportName, AdjacentImports> adjacentNewImports =
+ determineAdjacentNewImports(new ArrayList<ImportName>(existingImports), sortedNewImports);
+
+ List<ImportName> importsWithAdditions =
+ new ArrayList<ImportName>(existingImports.size() + sortedNewImports.size());
+ for (ImportName existingImport : existingImports) {
+ // Remove the adjacent imports so they don't get inserted multiple times in the case
+ // of duplicate imports.
+ AdjacentImports adjacentImports = adjacentNewImports.remove(existingImport);
+
+ if (adjacentImports != null) {
+ importsWithAdditions.addAll(adjacentImports.importsBefore);
+ }
+
+ importsWithAdditions.add(existingImport);
+
+ if (adjacentImports != null) {
+ importsWithAdditions.addAll(adjacentImports.importsAfter);
+ }
+ }
+
+ return importsWithAdditions;
+ }
+
+ /**
+ * Determines which new imports to place before and after each existing import.
+ * <p>
+ * Returns a Map where each key is an existing import and each corresponding value is an
+ * AdjacentImports containing those new imports which should be placed before and after that
+ * existing import. Each new import will be placed either before or after exactly one existing
+ * import.
+ *
+ * @param existingImports
+ * Existing imports.
+ * @param sortedNewImports
+ * Imports to be added. Must be in order as if sorted by this.importComparator.
+ */
+ private Map<ImportName, AdjacentImports> determineAdjacentNewImports(
+ Collection<ImportName> existingImports,
+ Iterable<ImportName> sortedNewImports) {
+ NavigableSet<ImportName> existingImportsTreeSet = new TreeSet<ImportName>(this.importComparator);
+ existingImportsTreeSet.addAll(existingImports);
+
+ Map<ImportName, AdjacentImports> adjacentNewImports = new HashMap<ImportName, AdjacentImports>();
+ for (ImportName existingImport : existingImports) {
+ adjacentNewImports.put(existingImport, new AdjacentImports());
+ }
+
+ for (ImportName newImport : sortedNewImports) {
+ ImportName precedingExistingImport = existingImportsTreeSet.lower(newImport);
+ ImportName succeedingExistingImport = existingImportsTreeSet.higher(newImport);
+
+ if (shouldGroupWithSucceeding(newImport, precedingExistingImport, succeedingExistingImport)) {
+ adjacentNewImports.get(succeedingExistingImport).importsBefore.add(newImport);
+ } else {
+ adjacentNewImports.get(precedingExistingImport).importsAfter.add(newImport);
+ }
+ }
+
+ return adjacentNewImports;
+ }
+
+ /**
+ * Returns true if the new import should be placed before the existing import that would succeed
+ * it in sorted order, or false if the new import should be placed after the existing import
+ * that would precede it in sorted order.
+ */
+ private boolean shouldGroupWithSucceeding(
+ ImportName newImport, ImportName precedingExistingImport, ImportName succeedingExistingImport) {
+ if (precedingExistingImport == null) {
+ return true;
+ } else if (succeedingExistingImport == null) {
+ return false;
+ } else {
+ String containerName = newImport.containerName;
+
+ int prefixSharedWithPreceding =
+ countMatchingPrefixSegments(containerName, precedingExistingImport.containerName);
+
+ int prefixSharedWithSucceeding =
+ countMatchingPrefixSegments(containerName, succeedingExistingImport.containerName);
+
+ return prefixSharedWithSucceeding > prefixSharedWithPreceding;
+ }
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OriginalImportEntry.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OriginalImportEntry.java
new file mode 100644
index 0000000..cb7e194
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/OriginalImportEntry.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.jface.text.IRegion;
+
+/**
+ * Represents an import declaration that originally occurred in the compilation unit.
+ */
+class OriginalImportEntry extends ImportEntry {
+ /**
+ * The comments associated with (either preceding, embedded within, or following) this import
+ * declaration.
+ */
+ final List<ImportComment> comments;
+
+ /**
+ * The difference between the line number of the start of the import declaration (or the start
+ * of its first leading comment, if any) and the line number of the end of the preceding import
+ * declaration (or the end of that import's trailing comment, if any). Zero for the first import
+ * in the compilation unit.
+ */
+ final int precedingLineDelimiters;
+
+ /**
+ * The region of the compilation unit occupied by the whitespace (e.g. line delimiters) between
+ * the previous import (or its last trailing comment, if any) and this import declaration (or
+ * its first leading comment, if any).
+ */
+ final IRegion leadingDelimiter;
+
+ /**
+ * The region of the compilation unit occupied by the import declaration itself, its associated
+ * comments, and any whitespace between the import declaration and its comments.
+ */
+ final IRegion declarationAndComments;
+
+ OriginalImportEntry(
+ ImportName importName,
+ Collection<ImportComment> comments,
+ int precedingLeadingDelimiters,
+ IRegion leadingWhitespace,
+ IRegion declarationAndComments) {
+ super(importName);
+
+ this.comments = Collections.unmodifiableList(new ArrayList<ImportComment>(comments));
+ this.precedingLineDelimiters = precedingLeadingDelimiters;
+ this.leadingDelimiter = leadingWhitespace;
+ this.declarationAndComments = declarationAndComments;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("OriginalImportEntry(%s)", this.importName); //$NON-NLS-1$
+ }
+
+ @Override
+ boolean isOriginal() {
+ return true;
+ }
+
+ @Override
+ OriginalImportEntry asOriginalImportEntry() {
+ return this;
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageAndContainingTypeImportComparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageAndContainingTypeImportComparator.java
new file mode 100644
index 0000000..3cd0d2f
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageAndContainingTypeImportComparator.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.Comparator;
+
+/**
+ * Sorts imports according to a lexicographic comparison of their full container names (including
+ * package name and any containing type names).
+ * <p>
+ * The alternative is {@link PackageImportComparator}. See https://bugs.eclipse.org/194358.
+ */
+final class PackageAndContainingTypeImportComparator implements Comparator<ImportName> {
+ @Override
+ public int compare(ImportName o1, ImportName o2) {
+ return o1.containerName.compareTo(o2.containerName);
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageImportComparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageImportComparator.java
new file mode 100644
index 0000000..de7d5cf
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/PackageImportComparator.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.Comparator;
+
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+import org.aspectj.org.eclipse.jdt.core.Signature;
+import org.aspectj.org.eclipse.jdt.internal.core.JavaProject;
+
+/**
+ * Sorts imports according to a lexicographic comparison of their containing package names.
+ * <p>
+ * This requires use of the JavaProject to look up packages and/or types by name in order to
+ * distinguish segments of the import's container name as containing package name vs. containing
+ * type name.
+ * <p>
+ * The alternative is {@link PackageAndContainingTypeImportComparator}. See
+ * https://bugs.eclipse.org/194358.
+ */
+final class PackageImportComparator implements Comparator<ImportName> {
+ private final JavaProject javaProject;
+
+ PackageImportComparator(JavaProject javaProject) {
+ this.javaProject = javaProject;
+ }
+
+ @Override
+ public int compare(ImportName o1, ImportName o2) {
+ return determinePackageName(o1).compareTo(determinePackageName(o2));
+ }
+
+ private String determinePackageName(ImportName importName) {
+ String containerName = importName.containerName;
+
+ try {
+ // Loop from longest to shortest prefix (of dot-separated name segments) of the
+ // container name until a package name is found.
+ String containerNamePrefix = containerName;
+ while (true) {
+ // Try to find a package named with this prefix.
+ if (this.javaProject.findPackageFragment(containerNamePrefix) != null) {
+ return containerNamePrefix;
+ }
+
+ int lastSegmentStart = containerNamePrefix.lastIndexOf(Signature.C_DOT) + 1;
+
+ // Use the heuristic that a prefix whose last segment starts with a lowercase letter
+ // is a package name, if we don't recognize the prefix as the name of a type.
+ if (this.javaProject.findType(containerNamePrefix) == null) {
+ if (Character.isLowerCase(containerNamePrefix.charAt(lastSegmentStart))) {
+ return containerNamePrefix;
+ }
+ }
+
+ if (lastSegmentStart == 0) {
+ // No prefix of containerName could be resolved to a package name.
+ break;
+ }
+
+ containerNamePrefix = containerNamePrefix.substring(0, lastSegmentStart - 1);
+ }
+ } catch (JavaModelException e) {
+ // An error occurred when we asked the JavaProject to resolve a name,
+ // so there is no point in proceeding with the loop.
+ }
+
+ return containerName;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RemovedImportCommentReassigner.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RemovedImportCommentReassigner.java
new file mode 100644
index 0000000..92626d5
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RemovedImportCommentReassigner.java
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Reassigns comments associated with removed imports (those present before but not present
+ * after the rewrite) to resultant imports (those present after the rewrite).
+ * <p>
+ * Reassigns comments of removed single imports to the first (in iteration order) resultant
+ * on-demand import having the same container name, if one exists.
+ * <p>
+ * Reassigns comments of removed on-demand imports to the first (in iteration order) resultant
+ * single import having the same container name, if one exists.
+ * <p>
+ * Leaves unassigned any removed import comment not matching the above cases.
+ */
+final class RemovedImportCommentReassigner {
+ private static Collection<OriginalImportEntry> retainImportsWithComments(Collection<OriginalImportEntry> imports) {
+ Collection<OriginalImportEntry> importsWithComments = new ArrayList<OriginalImportEntry>(imports.size());
+ for (OriginalImportEntry currentImport : imports) {
+ if (!currentImport.comments.isEmpty()) {
+ importsWithComments.add(currentImport);
+ }
+ }
+
+ return importsWithComments;
+ }
+
+ private static boolean hasFloatingComment(OriginalImportEntry nextAssignedImport) {
+ for (ImportComment importComment : nextAssignedImport.comments) {
+ if (importComment.succeedingLineDelimiters > 1) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private final Collection<OriginalImportEntry> originalImportsWithComments;
+
+ RemovedImportCommentReassigner(List<OriginalImportEntry> originalImports) {
+ this.originalImportsWithComments = retainImportsWithComments(originalImports);
+ }
+
+ /**
+ * Assigns comments of removed import entries (those in {@code originalImports} but not in
+ * {@code resultantImports}) to resultant import entries.
+ * <p>
+ * Returns a map containing the resulting assignments, where each key is an element of
+ * {@code resultantImports} and each value is a collection of comments reassigned to that
+ * resultant import.
+ */
+ Map<ImportEntry, Collection<ImportComment>> reassignComments(Collection<ImportEntry> resultantImports) {
+ Map<ImportEntry, Collection<OriginalImportEntry>> importAssignments = assignRemovedImports(resultantImports);
+
+ Map<ImportEntry, Collection<ImportComment>> commentAssignments =
+ new HashMap<ImportEntry, Collection<ImportComment>>();
+
+ for (Map.Entry<ImportEntry, Collection<OriginalImportEntry>> importAssignment : importAssignments.entrySet()) {
+ ImportEntry targetImport = importAssignment.getKey();
+ if (targetImport != null) {
+ Deque<ImportComment> assignedComments = new ArrayDeque<ImportComment>();
+
+ Collection<OriginalImportEntry> assignedImports = importAssignment.getValue();
+
+ Iterator<OriginalImportEntry> nextAssignedImportIterator = assignedImports.iterator();
+ if (nextAssignedImportIterator.hasNext()) {
+ nextAssignedImportIterator.next();
+ }
+
+ Iterator<OriginalImportEntry> assignedImportIterator = assignedImports.iterator();
+ while (assignedImportIterator.hasNext()) {
+ OriginalImportEntry currentAssignedImport = assignedImportIterator.next();
+ OriginalImportEntry nextAssignedImport =
+ nextAssignedImportIterator.hasNext() ? nextAssignedImportIterator.next() : null;
+
+ assignedComments.addAll(currentAssignedImport.comments);
+
+ if (nextAssignedImport != null && hasFloatingComment(nextAssignedImport)) {
+ // Ensure that a blank line separates this removed import's comments
+ // from the next removed import's floating comments.
+ ImportComment lastComment = assignedComments.removeLast();
+ ImportComment lastCommentWithTrailingBlankLine = new ImportComment(lastComment.region, 2);
+ assignedComments.add(lastCommentWithTrailingBlankLine);
+ }
+ }
+
+ commentAssignments.put(targetImport, assignedComments);
+ }
+ }
+
+ return commentAssignments;
+ }
+
+ private Map<ImportEntry, Collection<OriginalImportEntry>> assignRemovedImports(Collection<ImportEntry> imports) {
+ Collection<OriginalImportEntry> removedImportsWithComments = identifyRemovedImportsWithComments(imports);
+ if (removedImportsWithComments.isEmpty()) {
+ return Collections.emptyMap();
+ }
+
+ Map<ImportName, ImportEntry> firstSingleForOnDemand = identifyFirstSingleForEachOnDemand(imports);
+ Map<ImportName, ImportEntry> firstOccurrences = identifyFirstOccurrenceOfEachImportName(imports);
+
+ Map<ImportEntry, Collection<OriginalImportEntry>> removedImportsForRetainedImport =
+ new HashMap<ImportEntry, Collection<OriginalImportEntry>>();
+ for (ImportEntry retainedImport : imports) {
+ removedImportsForRetainedImport.put(retainedImport, new ArrayList<OriginalImportEntry>());
+ }
+ // The null key will map to the removed imports not assigned to any import.
+ removedImportsForRetainedImport.put(null, new ArrayList<OriginalImportEntry>());
+
+ for (OriginalImportEntry removedImport : removedImportsWithComments) {
+ ImportName removedImportName = removedImport.importName;
+
+ final ImportEntry retainedImport;
+ if (removedImportName.isOnDemand()) {
+ retainedImport = firstSingleForOnDemand.get(removedImportName);
+ } else {
+ retainedImport = firstOccurrences.get(removedImportName.getContainerOnDemand());
+ }
+
+ // retainedImport will be null if there's no corresponding import to which to assign the removed import.
+ removedImportsForRetainedImport.get(retainedImport).add(removedImport);
+ }
+
+ return removedImportsForRetainedImport;
+ }
+
+ private Collection<OriginalImportEntry> identifyRemovedImportsWithComments(Collection<ImportEntry> imports) {
+ Collection<OriginalImportEntry> removedImports =
+ new ArrayList<OriginalImportEntry>(this.originalImportsWithComments);
+ removedImports.removeAll(imports);
+ return removedImports;
+ }
+
+ /**
+ * Assigns each removed on-demand import to the first single import in {@code imports} having
+ * the same container name.
+ * <p>
+ * Returns a map where each key is a single import and each value is the corresponding
+ * removed on-demand import.
+ * <p>
+ * The returned map only contains mappings to removed on-demand imports for which there are
+ * corresponding single imports in {@code imports}.
+ */
+ private Map<ImportName, ImportEntry> identifyFirstSingleForEachOnDemand(Iterable<ImportEntry> imports) {
+ Map<ImportName, ImportEntry> firstSingleImportForContainer = new HashMap<ImportName, ImportEntry>();
+ for (ImportEntry currentImport : imports) {
+ if (!currentImport.importName.isOnDemand()) {
+ ImportName containerOnDemand = currentImport.importName.getContainerOnDemand();
+ if (!firstSingleImportForContainer.containsKey(containerOnDemand)) {
+ firstSingleImportForContainer.put(containerOnDemand, currentImport);
+ }
+ }
+ }
+ return firstSingleImportForContainer;
+ }
+
+ private Map<ImportName, ImportEntry> identifyFirstOccurrenceOfEachImportName(Iterable<ImportEntry> imports) {
+ Map<ImportName, ImportEntry> firstOccurrenceOfImport = new HashMap<ImportName, ImportEntry>();
+ for (ImportEntry resultantImport : imports) {
+ if (!firstOccurrenceOfImport.containsKey(resultantImport.importName)) {
+ firstOccurrenceOfImport.put(resultantImport.importName, resultantImport);
+ }
+ }
+ return firstOccurrenceOfImport;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ReorderingImportAdder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ReorderingImportAdder.java
new file mode 100644
index 0000000..a3e0846
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/ReorderingImportAdder.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Totally sorts new and existing imports together, discarding the order of existing imports.
+ */
+final class ReorderingImportAdder implements ImportAdder {
+ private final Comparator<ImportName> importComparator;
+
+ ReorderingImportAdder(Comparator<ImportName> importComparator) {
+ this.importComparator = importComparator;
+ }
+
+ @Override
+ public List<ImportName> addImports(Collection<ImportName> existingImports, Collection<ImportName> importsToAdd) {
+ Set<ImportName> existingImportsSet = new HashSet<ImportName>(existingImports);
+
+ List<ImportName> importsWithAdditions = new ArrayList<ImportName>(existingImports.size() + importsToAdd.size());
+ importsWithAdditions.addAll(existingImports);
+ for (ImportName importToAdd : importsToAdd) {
+ if (!existingImportsSet.contains(importToAdd)) {
+ importsWithAdditions.add(importToAdd);
+ }
+ }
+
+ Collections.sort(importsWithAdditions, this.importComparator);
+
+ return importsWithAdditions;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RewriteSite.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RewriteSite.java
new file mode 100644
index 0000000..b58e041
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/RewriteSite.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import org.eclipse.jface.text.IRegion;
+
+/**
+ * Describes the location in the compilation unit to be occupied by import declarations.
+ */
+class RewriteSite {
+ /**
+ * The region where import declarations, their associated comments, and any adjacent whitespace
+ * should be placed.
+ * <p>
+ * Extends from the end of the AST node preceding import declarations and their comments (or the
+ * start of the compilation unit, if no such node exists) to the start of the AST node
+ * succeeding import declarations and their comments (or the end of the compilation unit, if no
+ * such node exists).
+ */
+ final IRegion surroundingRegion;
+
+ /**
+ * The region occupied by import declarations and their associated comments prior to the
+ * rewrite, or null if the compilation unit does not contain any import declarations.
+ * <p>
+ * If not null, this region is contained within surroundingRegion.
+ */
+ final IRegion importsRegion;
+
+ /**
+ * True if the compilation unit prior to the rewrite contains any top-level AST nodes (package
+ * declaration and/or comments) preceding the start of surroundingRegion.
+ */
+ final boolean hasPrecedingElements;
+
+ /**
+ * True if the compilation unit prior to the rewrite contains any top-level AST nodes (type
+ * declarations and/or comments) following the end of surroundingRegion.
+ */
+ final boolean hasSucceedingElements;
+
+ RewriteSite(
+ IRegion surroundingRegion,
+ IRegion importsRegion,
+ boolean hasPrecedingElements,
+ boolean hasSucceedingElements) {
+ this.surroundingRegion = surroundingRegion;
+ this.importsRegion = importsRegion;
+ this.hasPrecedingElements = hasPrecedingElements;
+ this.hasSucceedingElements = hasSucceedingElements;
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/StaticConflictingSimpleNameFinder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/StaticConflictingSimpleNameFinder.java
new file mode 100644
index 0000000..53debdb
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/StaticConflictingSimpleNameFinder.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.aspectj.org.eclipse.jdt.core.Flags;
+import org.aspectj.org.eclipse.jdt.core.IField;
+import org.aspectj.org.eclipse.jdt.core.IJavaProject;
+import org.aspectj.org.eclipse.jdt.core.IMethod;
+import org.aspectj.org.eclipse.jdt.core.IType;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Finds conflicts among importable static members declared within the specified on-demand-imported
+ * containers.
+ */
+final class StaticConflictingSimpleNameFinder implements ConflictingSimpleNameFinder {
+ private static boolean isStaticImportableMember(int memberFlags) {
+ return (Flags.isStatic(memberFlags) || Flags.isEnum(memberFlags)) && !Flags.isPrivate(memberFlags);
+ }
+
+ private final IJavaProject project;
+
+ StaticConflictingSimpleNameFinder(IJavaProject project) {
+ this.project = project;
+ }
+
+ @Override
+ public Set<String> findConflictingSimpleNames(
+ Set<String> simpleNames,
+ Set<String> onDemandAndImplicitContainerNames,
+ IProgressMonitor monitor) throws JavaModelException {
+ Set<String> memberNamesFoundInMultipleTypes = new HashSet<String>();
+
+ Set<String> foundMemberNames = new HashSet<String>();
+ for (String containerName : onDemandAndImplicitContainerNames) {
+ IType containingType = this.project.findType(containerName, monitor);
+ if (containingType != null) {
+ for (String memberName : extractStaticMemberNames(containingType)) {
+ if (simpleNames.contains(memberName)) {
+ if (foundMemberNames.contains(memberName)) {
+ memberNamesFoundInMultipleTypes.add(memberName);
+ } else {
+ foundMemberNames.add(memberName);
+ }
+ }
+ }
+ }
+ }
+
+ return memberNamesFoundInMultipleTypes;
+ }
+
+ private Set<String> extractStaticMemberNames(IType type) throws JavaModelException {
+ Set<String> memberNames = new HashSet<String>();
+
+ for (IField field : type.getFields()) {
+ if (isStaticImportableMember(field.getFlags())) {
+ memberNames.add(field.getElementName());
+ }
+ }
+
+ for (IMethod method : type.getMethods()) {
+ if (isStaticImportableMember(method.getFlags())) {
+ memberNames.add(method.getElementName());
+ }
+ }
+
+ return memberNames;
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder.java
new file mode 100644
index 0000000..ab5c479
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/dom/rewrite/imports/TypeConflictingSimpleNameFinder.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Google Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * John Glassmyer <jogl@google.com> - import group sorting is broken - https://bugs.eclipse.org/430303
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.imports;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.aspectj.org.eclipse.jdt.core.IJavaElement;
+import org.aspectj.org.eclipse.jdt.core.IJavaProject;
+import org.aspectj.org.eclipse.jdt.core.JavaModelException;
+import org.aspectj.org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.aspectj.org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.aspectj.org.eclipse.jdt.core.search.SearchEngine;
+import org.aspectj.org.eclipse.jdt.core.search.TypeNameRequestor;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+final class TypeConflictingSimpleNameFinder implements ConflictingSimpleNameFinder {
+ private static class ConflictAccumulatingTypeRequestor extends TypeNameRequestor {
+ private static String buildContainerName(char[] packageName, char[][] enclosingTypeNames) {
+ StringBuffer buf= new StringBuffer();
+ buf.append(packageName);
+ for (char[] enclosingTypeName : enclosingTypeNames) {
+ if (buf.length() > 0)
+ buf.append('.');
+ buf.append(enclosingTypeName);
+ }
+ return buf.toString();
+ }
+
+ private final Set<String> namesFoundInMultipleContainers;
+ private final Map<String, String> lastContainerFoundForType;
+
+ ConflictAccumulatingTypeRequestor() {
+ this.namesFoundInMultipleContainers = new HashSet<String>();
+ this.lastContainerFoundForType = new HashMap<String, String>();
+ }
+
+ @Override
+ public void acceptType(
+ int modifiers,
+ char[] packageName,
+ char[] simpleTypeName,
+ char[][] enclosingTypeNames,
+ String path) {
+ String simpleName = new String(simpleTypeName);
+ String newContainerName = buildContainerName(packageName, enclosingTypeNames);
+ String oldContainerName = this.lastContainerFoundForType.put(simpleName, newContainerName);
+ if (oldContainerName != null && !oldContainerName.equals(newContainerName)) {
+ this.namesFoundInMultipleContainers.add(simpleName);
+ }
+ }
+
+ Set<String> getNamesFoundInMultipleContainers() {
+ return Collections.unmodifiableSet(this.namesFoundInMultipleContainers);
+ }
+ }
+
+ private static char[][] stringsToCharArrays(Collection<String> strings) {
+ char[][] arrayOfArrays = new char[strings.size()][];
+ int i = 0;
+ for (String string : strings) {
+ arrayOfArrays[i] = string.toCharArray();
+ i++;
+ }
+ return arrayOfArrays;
+ }
+
+ private final IJavaProject javaProject;
+ private final SearchEngine searchEngine;
+
+ TypeConflictingSimpleNameFinder(IJavaProject javaProject, SearchEngine searchEngine) {
+ this.javaProject = javaProject;
+ this.searchEngine = searchEngine;
+ }
+
+ @Override
+ public Set<String> findConflictingSimpleNames(
+ Set<String> simpleNames,
+ Set<String> onDemandAndImplicitContainerNames,
+ IProgressMonitor monitor) throws JavaModelException {
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { this.javaProject });
+
+ ConflictAccumulatingTypeRequestor requestor = new ConflictAccumulatingTypeRequestor();
+
+ this.searchEngine.searchAllTypeNames(
+ stringsToCharArrays(onDemandAndImplicitContainerNames),
+ stringsToCharArrays(simpleNames),
+ scope,
+ requestor,
+ IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+ monitor);
+
+ return requestor.getNamesFoundInMultipleContainers();
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
index eb5d260..3943d94 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,8 @@
* IBM Corporation - initial API and implementation
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* bug 407191 - [1.8] Binary access support for type annotations
+ * Stephan Herrmann - Contribution for
+ * Bug 440474 - [null] textual encoding of external null annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.hierarchy;
@@ -22,6 +24,8 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
public class HierarchyBinaryType implements IBinaryType {
@@ -265,4 +269,7 @@
}
return buffer.toString();
}
+public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member, LookupEnvironment environment) {
+ return walker;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.java
index a3dae40..b0cf44f 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/IndexSelector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -301,7 +301,11 @@
* Returns null if the path doesn't correspond to a project.
*/
private static IJavaProject getJavaProject(IPath path, IJavaModel model) {
- IJavaProject project = model.getJavaProject(path.lastSegment());
+ String lastSeg = path.lastSegment();
+ if (lastSeg == null) {
+ lastSeg = path.toOSString();
+ }
+ IJavaProject project = model.getJavaProject(lastSeg);
if (project.exists()) {
return project;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
index fa42075..37ae352 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
import java.net.URI;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
+import java.util.zip.ZipError;
import java.util.zip.ZipFile;
import org.eclipse.core.resources.IFile;
@@ -260,6 +261,13 @@
}
this.manager.removeIndex(this.containerPath);
return false;
+ } catch (ZipError e) { // merge with the code above using '|' when we move to 1.7
+ if (JobManager.VERBOSE) {
+ org.aspectj.org.eclipse.jdt.internal.core.util.Util.verbose("-> failed to index " + this.containerPath + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$
+ e.printStackTrace();
+ }
+ this.manager.removeIndex(this.containerPath);
+ return false;
}
return true;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java
index 2910626..d4a5ce1 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -76,7 +76,7 @@
IJavaProject project = JavaCore.create(container.getProject());
Map secondaryTypePaths = JavaModelManager.getJavaModelManager().secondaryTypes(project, false, null);
if (secondaryTypePaths.size() > 0) {
- Map typesInPackage = (Map) secondaryTypePaths.get(qualifiedPackageName);
+ Map typesInPackage = (Map) secondaryTypePaths.get(qualifiedPackageName.replace('/', '.'));
if (typesInPackage != null && typesInPackage.size() > 0) {
for (Iterator j = typesInPackage.keySet().iterator(); j.hasNext();) {
String secondaryTypeName = (String) j.next();
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java
index d1ad3b0..cba93d2 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/ConstructorLocator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
import org.eclipse.core.runtime.CoreException;
import org.aspectj.org.eclipse.jdt.core.IJavaElement;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.aspectj.org.eclipse.jdt.core.search.SearchMatch;
import org.aspectj.org.eclipse.jdt.core.search.SearchPattern;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.*;
@@ -44,6 +45,7 @@
return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);
}
public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) {
+ if (this.pattern.fineGrain != 0 && !this.pattern.findDeclarations) return IMPOSSIBLE_MATCH;
int referencesLevel = this.pattern.findReferences ? matchLevelForReferences(node) : IMPOSSIBLE_MATCH;
int declarationsLevel = this.pattern.findDeclarations ? matchLevelForDeclarations(node) : IMPOSSIBLE_MATCH;
@@ -100,6 +102,10 @@
public int match(TypeDeclaration node, MatchingNodeSet nodeSet) {
if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH;
+ if (this.pattern.fineGrain != 0 &&
+ (this.pattern.fineGrain & ~IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION) == 0 )
+ return IMPOSSIBLE_MATCH;
+
// need to look for a generated default constructor
return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java
index 5c01c5a..83a6371 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,22 +7,19 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 440477 - [null] Infrastructure for feeding external annotations into compilation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.search.matching;
import java.util.HashMap;
-import java.util.zip.ZipFile;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-//import org.aspectj.org.eclipse.jdt.core.*;
import org.aspectj.org.eclipse.jdt.core.*;
-import org.aspectj.org.eclipse.jdt.core.IJavaProject;
-import org.aspectj.org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.aspectj.org.eclipse.jdt.core.JavaModelException;
-//import org.aspectj.org.eclipse.jdt.core.JavaCore;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment;
@@ -43,7 +40,7 @@
@SuppressWarnings({"rawtypes", "unchecked"})
public class JavaSearchNameEnvironment implements INameEnvironment, SuffixConstants {
- ClasspathLocation[] locations;
+ LinkedHashSet<ClasspathLocation> locationSet;
/*
* A map from the fully qualified slash-separated name of the main type (String) to the working copy
@@ -51,7 +48,7 @@
HashMap workingCopies;
public JavaSearchNameEnvironment(IJavaProject javaProject, org.aspectj.org.eclipse.jdt.core.ICompilationUnit[] copies) {
- computeClasspathLocations(javaProject.getProject().getWorkspace().getRoot(), (JavaProject) javaProject);
+ this.locationSet = computeClasspathLocations((JavaProject) javaProject);
try {
int length = copies == null ? 0 : copies.length;
this.workingCopies = new HashMap(length);
@@ -72,52 +69,51 @@
}
public void cleanup() {
- for (int i = 0, length = this.locations.length; i < length; i++) {
- this.locations[i].cleanup();
- }
+ this.locationSet.clear();
}
-private void computeClasspathLocations(IWorkspaceRoot workspaceRoot, JavaProject javaProject) {
+void addProjectClassPath(JavaProject javaProject) {
+ LinkedHashSet<ClasspathLocation> locations = computeClasspathLocations(javaProject);
+ if (locations != null) this.locationSet.addAll(locations);
+}
+
+private LinkedHashSet<ClasspathLocation> computeClasspathLocations(JavaProject javaProject) {
IPackageFragmentRoot[] roots = null;
try {
roots = javaProject.getAllPackageFragmentRoots();
} catch (JavaModelException e) {
- // project doesn't exist
- this.locations = new ClasspathLocation[0];
- return;
+ return null;// project doesn't exist
}
+ LinkedHashSet<ClasspathLocation> locations = new LinkedHashSet<ClasspathLocation>();
int length = roots.length;
- ClasspathLocation[] cpLocations = new ClasspathLocation[length];
- int index = 0;
JavaModelManager manager = JavaModelManager.getJavaModelManager();
for (int i = 0; i < length; i++) {
- PackageFragmentRoot root = (PackageFragmentRoot) roots[i];
- IPath path = root.getPath();
- try {
- if (root.isArchive()) {
- ZipFile zipFile = manager.getZipFile(path);
- cpLocations[index++] = new ClasspathJar(zipFile, ((ClasspathEntry) root.getRawClasspathEntry()).getAccessRuleSet());
- } else {
- Object target = JavaModel.getTarget(path, true);
- if (target == null) {
- // target doesn't exist any longer
- // just resize cpLocations
- System.arraycopy(cpLocations, 0, cpLocations = new ClasspathLocation[cpLocations.length-1], 0, index);
- } else if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
- cpLocations[index++] = new ClasspathSourceDirectory((IContainer)target, root.fullExclusionPatternChars(), root.fullInclusionPatternChars());
- } else {
- cpLocations[index++] = ClasspathLocation.forBinaryFolder((IContainer) target, false, ((ClasspathEntry) root.getRawClasspathEntry()).getAccessRuleSet());
- }
- }
- } catch (CoreException e1) {
- // problem opening zip file or getting root kind
- // consider root corrupt and ignore
- // just resize cpLocations
- System.arraycopy(cpLocations, 0, cpLocations = new ClasspathLocation[cpLocations.length-1], 0, index);
- }
+ ClasspathLocation cp = mapToClassPathLocation(manager, (PackageFragmentRoot) roots[i]);
+ if (cp != null) locations.add(cp);
}
- this.locations = cpLocations;
+ return locations;
+}
+
+private ClasspathLocation mapToClassPathLocation( JavaModelManager manager, PackageFragmentRoot root) {
+ ClasspathLocation cp = null;
+ IPath path = root.getPath();
+ try {
+ if (root.isArchive()) {
+ ClasspathEntry rawClasspathEntry = (ClasspathEntry) root.getRawClasspathEntry();
+ cp = new ClasspathJar(manager.getZipFile(path), rawClasspathEntry.getAccessRuleSet(), ClasspathEntry.getExternalAnnotationPath(rawClasspathEntry, ((IJavaProject)root.getParent()).getProject(), true));
+ } else {
+ Object target = JavaModel.getTarget(path, true);
+ if (target != null)
+ cp = root.getKind() == IPackageFragmentRoot.K_SOURCE ?
+ new ClasspathSourceDirectory((IContainer)target, root.fullExclusionPatternChars(), root.fullInclusionPatternChars()) :
+ ClasspathLocation.forBinaryFolder((IContainer) target, false, ((ClasspathEntry) root.getRawClasspathEntry()).getAccessRuleSet());
+ }
+ } catch (CoreException e1) {
+ // problem opening zip file or getting root kind
+ // consider root corrupt and ignore
+ }
+ return cp;
}
private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeName) {
@@ -126,8 +122,9 @@
sourceFileName = null, qSourceFileName = null,
qPackageName = null;
NameEnvironmentAnswer suggestedAnswer = null;
- for (int i = 0, length = this.locations.length; i < length; i++) {
- ClasspathLocation location = this.locations[i];
+ Iterator <ClasspathLocation> iter = this.locationSet.iterator();
+ while (iter.hasNext()) {
+ ClasspathLocation location = iter.next();
NameEnvironmentAnswer answer;
if (location instanceof ClasspathSourceDirectory) {
if (sourceFileName == null) {
@@ -202,9 +199,10 @@
}
public boolean isPackage(String qualifiedPackageName) {
- for (int i = 0, length = this.locations.length; i < length; i++)
- if (this.locations[i].isPackage(qualifiedPackageName))
- return true;
+ Iterator<ClasspathLocation> iter = this.locationSet.iterator();
+ while (iter.hasNext()) {
+ if (iter.next().isPackage(qualifiedPackageName)) return true;
+ }
return false;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index c8cc5bd..2acd46d 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -14,9 +14,12 @@
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.zip.ZipFile;
@@ -77,7 +80,6 @@
import org.aspectj.org.eclipse.jdt.internal.core.SourceTypeElementInfo;
import org.aspectj.org.eclipse.jdt.internal.core.index.Index;
import org.aspectj.org.eclipse.jdt.internal.core.search.*;
-import org.aspectj.org.eclipse.jdt.internal.core.search.indexing.IIndexConstants;
import org.aspectj.org.eclipse.jdt.internal.core.util.ASTNodeFinder;
import org.aspectj.org.eclipse.jdt.internal.core.util.HandleFactory;
import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
@@ -926,7 +928,7 @@
// special handling for methods of anonymous/local types. Since these cannot be looked up in the environment the usual way ...
if (methodPattern.focus instanceof SourceMethod) {
char[] typeName = PatternLocator.qualifiedPattern(methodPattern.declaringSimpleName, methodPattern.declaringQualification);
- if (typeName != null && CharOperation.indexOf(IIndexConstants.ONE_STAR, typeName, true) >= 0) { // See org.aspectj.org.eclipse.jdt.core.search.SearchPattern.enclosingTypeNames(IType)
+ if (typeName != null) {
IType type = methodPattern.declaringType;
IType enclosingType = type.getDeclaringType();
while (enclosingType != null) {
@@ -953,6 +955,102 @@
}
return null;
}
+
+private List<String> getInverseFullName(char[] qualifier, char[] simpleName) {
+ List <String> result = new ArrayList<String>();
+ if (qualifier != null && qualifier.length > 0) {
+ result.addAll(Arrays.asList(new String(qualifier).split("\\.")));//$NON-NLS-1$
+ Collections.reverse(result);
+ }
+ if (simpleName != null) result.add(0, new String(simpleName));
+ return result;
+}
+
+/** returns the row index which has the highest column entry.
+ * TODO: rewrite this code with list when (if) we move to 1.8 [with FP constructs].
+ */
+private int getMaxResult(int[][] resultsMap) {
+ int rows = resultsMap.length;
+ int cols = resultsMap[0].length;
+ List <Integer> candidates = new ArrayList<Integer>();
+ candidates.add(0); //default row
+
+ for (int j = 0; j < cols; ++j) {
+ int current = resultsMap[0][j];
+ for (int i = 1; i < rows; ++i) {
+ int tmp = resultsMap[i][j];
+ if (tmp < current) continue;
+ if (tmp > current) {
+ current = tmp;
+ candidates.clear();
+ }
+ candidates.add(i);// there is atleast one element always.
+ }
+ if (candidates.size() <= 1) break; // found
+ }
+ return candidates.get(0);
+}
+
+/** apply the function to map the parameter full name to an index
+ */
+private int mapParameter(List <String> patternParameterFullName, List <String> methodParameterFullName) {
+ int patternLen = patternParameterFullName.size();
+ int methodLen = methodParameterFullName.size();
+ int size = patternLen < methodLen ? patternLen : methodLen;
+ int result = -1;
+ for (int i = 0; i < size; i++) {
+ if (!patternParameterFullName.get(i).equals(methodParameterFullName.get(i))) break;
+ ++result;
+ }
+ return patternLen == methodLen && result + 1 == patternLen ? Integer.MAX_VALUE : result;
+}
+/**
+ * returns an array of integers whose elements are matching indices.
+ * As a special case, full match would have max value as the index.
+ */
+private int[] getResultMap(Map<Integer, List<String>> patternMap, Map<Integer, List<String>> methodMap) {
+ int paramLength = methodMap.size();
+ int[] result = new int[paramLength];
+ for (int p = 0; p < paramLength; p++) {
+ result[p] = mapParameter(patternMap.get(p), methodMap.get(p));
+ }
+ return result;
+}
+
+private Map<Integer, List<String>> getSplitNames(char[][] qualifiedNames, char[][] simpleNames) {
+ int paramLength = simpleNames.length;
+ Map <Integer, List<String>> result = new HashMap<Integer, List<String>>();
+ for (int p = 0; p < paramLength; p++) result.put(p, getInverseFullName(qualifiedNames[p], simpleNames[p]));
+ return result;
+}
+
+private Map<Integer, List<String>> getSplitNames(MethodBinding method) {
+ TypeBinding[] methodParameters = method.parameters;
+ int paramLength = methodParameters == null ? 0 : methodParameters.length;
+ Map <Integer, List<String>> result = new HashMap<Integer, List<String>>();
+ for (int p = 0; p < paramLength; p++) result.put(p, getInverseFullName(methodParameters[p].qualifiedSourceName(), null)); // source is part of qualifiedSourceName here);
+ return result;
+}
+
+/**
+ * Selects the most applicable method (though similar but not to be confused with its namesake in jls)
+ * All this machinery for that elusive uncommon case referred in bug 431357.
+ */
+private MethodBinding getMostApplicableMethod(List<MethodBinding> possibleMethods) {
+ int size = possibleMethods.size();
+ MethodBinding result = size != 0 ? possibleMethods.get(0) : null;
+ if (size > 1) {
+ MethodPattern methodPattern = ((MethodPattern) this.pattern);
+ // can cache but may not be worth since this is not a common case
+ Map<Integer, List<String>> methodPatternReverseNames = getSplitNames(methodPattern.parameterQualifications, methodPattern.parameterSimpleNames);
+ int len = possibleMethods.size();
+ int[][] resultMaps = new int[len][];
+ for (int i = 0; i < len; ++i) resultMaps[i] = getResultMap(methodPatternReverseNames, getSplitNames(possibleMethods.get(i)));
+ result = possibleMethods.get(getMaxResult(resultMaps));
+ }
+ return result;
+}
+
private MethodBinding getMethodBinding0(MethodPattern methodPattern) {
if (this.unitScope == null) return null;
// Try to get binding from cache
@@ -969,6 +1067,7 @@
typeName = methodPattern.declaringType.getFullyQualifiedName().toCharArray();
}
TypeBinding declaringTypeBinding = getType(typeName, typeName);
+ MethodBinding result = null;
if (declaringTypeBinding != null) {
if (declaringTypeBinding.isArrayType()) {
declaringTypeBinding = declaringTypeBinding.leafComponentType();
@@ -982,6 +1081,7 @@
int methodsLength = methods.length;
TypeVariableBinding[] refTypeVariables = referenceBinding.typeVariables();
int typeVarLength = refTypeVariables==null ? 0 : refTypeVariables.length;
+ List <MethodBinding> possibleMethods = new ArrayList<MethodBinding>(methodsLength);
for (int i=0; i<methodsLength; i++) {
TypeBinding[] methodParameters = methods[i].parameters;
int paramLength = methodParameters==null ? 0 : methodParameters.length;
@@ -1019,14 +1119,14 @@
}
}
if (found) {
- this.bindings.put(methodPattern, methods[i]);
- return methods[i];
+ possibleMethods.add(methods[i]);
}
}
+ result = getMostApplicableMethod(possibleMethods);
}
}
- this.bindings.put(methodPattern, new ProblemMethodBinding(methodPattern.selector, null, ProblemReasons.NotFound));
- return null;
+ this.bindings.put(methodPattern, result != null ? result : new ProblemMethodBinding(methodPattern.selector, null, ProblemReasons.NotFound));
+ return result;
}
protected boolean hasAlreadyDefinedType(CompilationUnitDeclaration parsedUnit) {
CompilationResult result = parsedUnit.compilationResult;
@@ -1049,12 +1149,9 @@
SearchableEnvironment searchableEnvironment = project.newSearchableNameEnvironment(this.workingCopies);
- // if only one possible match, a file name environment costs too much,
- // so use the existing searchable environment which will populate the java model
- // only for this possible match and its required types.
- this.nameEnvironment = possibleMatchSize == 1
- ? (INameEnvironment) searchableEnvironment
- : (INameEnvironment) new JavaSearchNameEnvironment(project, this.workingCopies);
+ this.nameEnvironment = new JavaSearchNameEnvironment(project, this.workingCopies);
+ if (this.pattern.focus != null)
+ ((JavaSearchNameEnvironment) this.nameEnvironment).addProjectClassPath((JavaProject) this.pattern.focus.getJavaProject());
// create lookup environment
Map map = project.getOptions(true);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
index cb24cd1..b60c7e3 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -505,13 +505,6 @@
}
}
-protected void consumePrimaryNoNewArray() {
- // pop parenthesis positions (and don't update expression positions
- // (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=23329)
- this.intPtr--;
- this.intPtr--;
-}
-
protected void consumePrimaryNoNewArrayWithName() {
// PrimaryNoNewArray ::= PushLPAREN Expression PushRPAREN
pushOnExpressionStack(getUnspecifiedReferenceOptimized());
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
index 92187ed..e0ef0f9 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.search.matching;
+import java.util.Arrays;
import java.util.HashMap;
import org.eclipse.core.resources.IResource;
@@ -243,6 +244,8 @@
public int match(ReferenceExpression node, MatchingNodeSet nodeSet) {
if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH;
if (!matchesName(this.pattern.selector, node.selector)) return IMPOSSIBLE_MATCH;
+ if (node.selector != null && Arrays.equals(node.selector, org.aspectj.org.eclipse.jdt.internal.compiler.codegen.ConstantPool.Init))
+ return IMPOSSIBLE_MATCH; // :: new
nodeSet.mustResolve = true;
return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);
}
@@ -309,15 +312,25 @@
return INACCURATE_MATCH;
}
boolean foundTypeVariable = false;
+ MethodBinding focusMethodBinding = null;
+ boolean checkedFocus = false;
// verify each parameter
for (int i = 0; i < parameterCount; i++) {
TypeBinding argType = method.parameters[i];
int newLevel = IMPOSSIBLE_MATCH;
- if (argType.isMemberType()) {
- // only compare source name for member type (bug 41018)
- newLevel = CharOperation.match(this.pattern.parameterSimpleNames[i], argType.sourceName(), this.isCaseSensitive)
- ? ACCURATE_MATCH
- : IMPOSSIBLE_MATCH;
+ boolean foundLevel = false;
+ if (argType.isMemberType() || this.pattern.parameterQualifications[i] != null) {
+ if (!checkedFocus) {
+ focusMethodBinding = this.matchLocator.getMethodBinding(this.pattern);
+ checkedFocus = true;
+ }
+ if (focusMethodBinding != null) {// textual comparison insufficient
+ TypeBinding[] parameters = focusMethodBinding.parameters;
+ if (parameters.length >= parameterCount) {
+ newLevel = argType.isEquivalentTo((parameters[i])) ? ACCURATE_MATCH : IMPOSSIBLE_MATCH;
+ foundLevel = true;
+ }
+ }
} else {
// TODO (frederic) use this call to refine accuracy on parameter types
// newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], this.pattern.parametersTypeArguments[i], 0, argType);
@@ -328,7 +341,9 @@
if (skipImpossibleArg) {
// Do not consider match as impossible while finding declarations and source level >= 1.5
// (see bugs https://bugs.eclipse.org/bugs/show_bug.cgi?id=79990, 96761, 96763)
- newLevel = level;
+ if (!foundLevel) {
+ newLevel = level;
+ }
} else if (argType.isTypeVariable()) {
newLevel = level;
foundTypeVariable = true;
@@ -342,7 +357,8 @@
if (foundTypeVariable) {
if (!method.isStatic() && !method.isPrivate()) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=123836, No point in textually comparing type variables, captures etc with concrete types.
- MethodBinding focusMethodBinding = this.matchLocator.getMethodBinding(this.pattern);
+ if (!checkedFocus)
+ focusMethodBinding = this.matchLocator.getMethodBinding(this.pattern);
if (focusMethodBinding != null) {
if (matchOverriddenMethod(focusMethodBinding.declaringClass, focusMethodBinding, method)) {
return ACCURATE_MATCH;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.java
index 622cc1f..9db879c 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2014 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* Bug 425183 - [1.8][inference] make CaptureBinding18 safe
+ * Bug 466308 - [hovering] Javadoc header for parameter is wrong with annotation-based null analysis
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.util;
@@ -515,7 +516,7 @@
// default is to do nothing
}
- public void consumeLocalVar(char[] varName, int occurrenceCount) {
+ public void consumeLocalVar(char[] varName, int occurrenceCount, int argumentPosition) {
// default is to do nothing
}
@@ -823,7 +824,16 @@
char[] occurrence = this.scanner.getTokenSource();
occurrenceCount = Integer.parseInt(new String(occurrence));
}
- consumeLocalVar(varName, occurrenceCount);
+ int position = -1;
+ if (this.scanner.isAtLocalVariableStart()) {
+ if (this.scanner.nextToken() != Scanner.LOCAL_VAR) {
+ malformedKey();
+ return;
+ }
+ char[] posToken = this.scanner.getTokenSource();
+ position = Integer.parseInt(new String(posToken));
+ }
+ consumeLocalVar(varName, occurrenceCount, position);
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java
index c29afaa..866a5f8 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2014 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* Bug 425183 - [1.8][inference] make CaptureBinding18 safe
+ * Bug 466308 - [hovering] Javadoc header for parameter is wrong with annotation-based null analysis
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.util;
@@ -18,6 +19,7 @@
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.aspectj.org.eclipse.jdt.internal.compiler.Compiler;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Assignment;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CastExpression;
@@ -55,6 +57,53 @@
@SuppressWarnings({"rawtypes", "unchecked"})
public class BindingKeyResolver extends BindingKeyParser {
+
+ /** Synthetic bindings for local variables (method arguments) restored from a binding key. */
+ private final class SyntheticLocalVariableBinding extends LocalVariableBinding {
+
+ private final MethodBinding enclosingMethod;
+ private int paramPosition;
+ private char[] key;
+
+ SyntheticLocalVariableBinding(char[] name, TypeBinding type, MethodBinding enclosingMethod, int paramPosition) {
+ super(name, type, 0, true);
+ this.enclosingMethod = enclosingMethod;
+ this.paramPosition = paramPosition;
+ }
+
+ @Override
+ public char[] computeUniqueKey() {
+ if (this.key == null) {
+ // have no scope to find the enclosing method, so use the captured method:
+ StringBuilder buf = new StringBuilder().append(this.enclosingMethod.computeUniqueKey());
+ buf.append('#');
+ buf.append(this.name);
+ buf.append("#0#"); //$NON-NLS-1$
+ buf.append(this.paramPosition);
+ int length = buf.length();
+ this.key = new char[length];
+ buf.getChars(0, length, this.key, 0);
+ }
+ return this.key;
+ }
+
+ @Override
+ public MethodBinding getEnclosingMethod() {
+ return this.enclosingMethod;
+ }
+
+ @Override
+ public int hashCode() {
+ return CharOperation.hashCode(computeUniqueKey());
+ }
+
+ public boolean equals(Object obj) {
+ if (!(obj instanceof SyntheticLocalVariableBinding))
+ return false;
+ return CharOperation.equals(computeUniqueKey(), ((SyntheticLocalVariableBinding) obj).computeUniqueKey());
+ }
+ }
+
Compiler compiler;
Binding compilerBinding;
@@ -184,7 +233,7 @@
case Binding.TYPE_PARAMETER:
if (binding.isCapture()) {
CaptureBinding captureBinding = (CaptureBinding) binding;
- if (captureBinding.position == position && captureBinding.wildcard == wildcardBinding) {
+ if (captureBinding.end == position && captureBinding.wildcard == wildcardBinding) {
if (captureBinding instanceof CaptureBinding18) {
if (((CaptureBinding18)captureBinding).captureID != capture18id)
return false;
@@ -286,19 +335,43 @@
}
}
- public void consumeLocalVar(char[] varName, int occurrenceCount) {
+ public void consumeLocalVar(char[] varName, int occurrenceCount, int argumentPosition) {
if (this.scope == null) {
if (this.methodBinding == null)
return;
- this.scope = this.methodBinding.sourceMethod().scope;
+ AbstractMethodDeclaration sourceMethod = this.methodBinding.sourceMethod();
+ if (sourceMethod != null) {
+ this.scope = sourceMethod.scope;
+ } else {
+ char[][] parameterNames = this.methodBinding.parameterNames;
+ int paramPosition = -1;
+ if (parameterNames.length == 0) {
+ paramPosition = argumentPosition;
+ } else {
+ for (int i = 0; i < parameterNames.length; i++) {
+ if (CharOperation.equals(parameterNames[i], varName)) {
+ paramPosition = i;
+ break;
+ }
+ }
+ }
+ if (paramPosition != -1) {
+ // we don't have a compiler binding for this argument, but we can craft one:
+ this.compilerBinding = new SyntheticLocalVariableBinding(varName, this.methodBinding.parameters[paramPosition], this.methodBinding, paramPosition);
+ this.methodBinding = null;
+ return;
+ }
+ }
}
- for (int i = 0; i < this.scope.localIndex; i++) {
- LocalVariableBinding local = this.scope.locals[i];
- if (CharOperation.equals(local.name, varName)
- && occurrenceCount-- == 0) {
- this.methodBinding = null;
- this.compilerBinding = local;
- return;
+ if (this.scope != null) {
+ for (int i = 0; i < this.scope.localIndex; i++) {
+ LocalVariableBinding local = this.scope.locals[i];
+ if (CharOperation.equals(local.name, varName)
+ && occurrenceCount-- == 0) {
+ this.methodBinding = null;
+ this.compilerBinding = local;
+ return;
+ }
}
}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.java
index cd6eb74..20e080e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/DOMFinder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,12 +7,18 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contributions for
+ * Bug 463330 - [dom] DOMFinder doesn't find the VariableBinding corresponding to a method argument
+ * Bug 464463 - [dom] DOMFinder doesn't find an ITypeParameter
+ * Bug 429813 - [1.8][dom ast] IMethodBinding#getJavaElement() should return IMethod for lambda
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.util;
import org.aspectj.org.eclipse.jdt.core.IInitializer;
+import org.aspectj.org.eclipse.jdt.core.ILocalVariable;
import org.aspectj.org.eclipse.jdt.core.IMember;
import org.aspectj.org.eclipse.jdt.core.ISourceRange;
+import org.aspectj.org.eclipse.jdt.core.ITypeParameter;
import org.aspectj.org.eclipse.jdt.core.JavaModelException;
import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
import org.aspectj.org.eclipse.jdt.core.dom.ASTVisitor;
@@ -26,15 +32,18 @@
import org.aspectj.org.eclipse.jdt.core.dom.IBinding;
import org.aspectj.org.eclipse.jdt.core.dom.ImportDeclaration;
import org.aspectj.org.eclipse.jdt.core.dom.Initializer;
+import org.aspectj.org.eclipse.jdt.core.dom.LambdaExpression;
import org.aspectj.org.eclipse.jdt.core.dom.MarkerAnnotation;
import org.aspectj.org.eclipse.jdt.core.dom.MethodDeclaration;
import org.aspectj.org.eclipse.jdt.core.dom.NormalAnnotation;
import org.aspectj.org.eclipse.jdt.core.dom.PackageDeclaration;
import org.aspectj.org.eclipse.jdt.core.dom.ParameterizedType;
import org.aspectj.org.eclipse.jdt.core.dom.SingleMemberAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.SingleVariableDeclaration;
import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.core.dom.TypeParameter;
import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.aspectj.org.eclipse.jdt.internal.core.LambdaMethod;
import org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement;
public class DOMFinder extends ASTVisitor {
@@ -63,8 +72,11 @@
public ASTNode search() throws JavaModelException {
ISourceRange range = null;
- if (this.element instanceof IMember && !(this.element instanceof IInitializer))
+ if (this.element instanceof IMember && !(this.element instanceof IInitializer)
+ && !(this.element instanceof LambdaMethod) && !(this.element instanceof org.aspectj.org.eclipse.jdt.internal.core.LambdaExpression))
range = ((IMember) this.element).getNameRange();
+ else if (this.element instanceof ITypeParameter || this.element instanceof ILocalVariable)
+ range = this.element.getNameRange();
else
range = this.element.getSourceRange();
this.rangeStart = range.getOffset();
@@ -177,4 +189,16 @@
this.foundBinding = node.resolveBinding();
return true;
}
+
+ public boolean visit(SingleVariableDeclaration node) {
+ if (found(node, node.getName()) && this.resolveBinding)
+ this.foundBinding = node.resolveBinding();
+ return true;
+ }
+
+ public boolean visit(LambdaExpression node) {
+ if (found(node, node) && this.resolveBinding)
+ this.foundBinding = node.resolveMethodBinding();
+ return true;
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.java
index c826479..1562c60 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Disassembler.java
@@ -183,55 +183,13 @@
StringBuffer buffer = new StringBuffer();
for (int i = 0, max = chars.length; i < max; i++) {
char c = chars[i];
- escapeChar(buffer, c);
+ org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.appendEscapedChar(buffer, c, true);
}
return buffer.toString();
}
private static void escapeChar(StringBuffer buffer, char c) {
- switch(c) {
- case '\b' :
- buffer.append("\\b"); //$NON-NLS-1$
- break;
- case '\t' :
- buffer.append("\\t"); //$NON-NLS-1$
- break;
- case '\n' :
- buffer.append("\\n"); //$NON-NLS-1$
- break;
- case '\f' :
- buffer.append("\\f"); //$NON-NLS-1$
- break;
- case '\r' :
- buffer.append("\\r"); //$NON-NLS-1$
- break;
- case '\0' :
- buffer.append("\\0"); //$NON-NLS-1$
- break;
- case '\1' :
- buffer.append("\\1"); //$NON-NLS-1$
- break;
- case '\2' :
- buffer.append("\\2"); //$NON-NLS-1$
- break;
- case '\3' :
- buffer.append("\\3"); //$NON-NLS-1$
- break;
- case '\4' :
- buffer.append("\\4"); //$NON-NLS-1$
- break;
- case '\5' :
- buffer.append("\\5"); //$NON-NLS-1$
- break;
- case '\6' :
- buffer.append("\\6"); //$NON-NLS-1$
- break;
- case '\7' :
- buffer.append("\\7"); //$NON-NLS-1$
- break;
- default:
- buffer.append(c);
- }
+ org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.appendEscapedChar(buffer, c, false);
}
static String decodeStringValue(String s) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.java
index 4c4e307..10e5ccd 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyKind.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 466308 - [hovering] Javadoc header for parameter is wrong with annotation-based null analysis
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.util;
@@ -53,7 +55,7 @@
this.flags |= F_LOCAL;
}
- public void consumeLocalVar(char[] varName, int occurrenceCount) {
+ public void consumeLocalVar(char[] varName, int occurrenceCount, int argumentPosition) {
this.flags |= F_LOCAL_VAR;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.java
index 307ae17..9ac3cba 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/KeyToSignature.java
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for
* Bug 425183 - [1.8][inference] make CaptureBinding18 safe
+ * Bug 462025 - [null][test] create tests for manipulating external null annotations
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.util;
@@ -32,6 +33,7 @@
public StringBuffer signature = new StringBuffer();
private int kind;
+ private boolean asBinarySignature = false; // '.' vs. '/' and '$'
private ArrayList arguments = new ArrayList();
private ArrayList typeArguments = new ArrayList();
private ArrayList typeParameters = new ArrayList();
@@ -42,7 +44,9 @@
public KeyToSignature(BindingKeyParser parser) {
super(parser);
- this.kind = ((KeyToSignature) parser).kind;
+ KeyToSignature keyToSignature = (KeyToSignature) parser;
+ this.kind = keyToSignature.kind;
+ this.asBinarySignature = keyToSignature.asBinarySignature;
}
public KeyToSignature(String key, int kind) {
@@ -50,6 +54,12 @@
this.kind = kind;
}
+ public KeyToSignature(String key, int kind, boolean asBinarySignature) {
+ super(key);
+ this.kind = kind;
+ this.asBinarySignature = asBinarySignature;
+ }
+
public void consumeArrayDimension(char[] brakets) {
this.signature.append(brakets);
}
@@ -74,14 +84,16 @@
this.signature = new StringBuffer();
// remove trailing semi-colon as it is added later in comsumeType()
uniqueKey = CharOperation.subarray(uniqueKey, 0, uniqueKey.length-1);
- CharOperation.replace(uniqueKey, '/', '.');
+ if (!this.asBinarySignature)
+ CharOperation.replace(uniqueKey, '/', '.');
this.signature.append(uniqueKey);
}
public void consumeMethod(char[] selector, char[] methodSignature) {
this.arguments = new ArrayList();
this.typeArguments = new ArrayList();
- CharOperation.replace(methodSignature, '/', '.');
+ if (!this.asBinarySignature)
+ CharOperation.replace(methodSignature, '/', '.');
switch(this.kind) {
case SIGNATURE:
this.signature = new StringBuffer();
@@ -198,7 +210,7 @@
public void consumeParameterizedType(char[] simpleTypeName, boolean isRaw) {
if (simpleTypeName != null) {
// member type
- this.signature.append('.');
+ this.signature.append(this.asBinarySignature ? '$' : '.');
this.signature.append(simpleTypeName);
}
if (!isRaw) {
@@ -237,12 +249,14 @@
public void consumeFullyQualifiedName(char[] fullyQualifiedName) {
this.typeSigStart = this.signature.length();
this.signature.append('L');
- this.signature.append(CharOperation.replaceOnCopy(fullyQualifiedName, '/', '.'));
+ if (!this.asBinarySignature)
+ fullyQualifiedName = CharOperation.replaceOnCopy(fullyQualifiedName, '/', '.');
+ this.signature.append(fullyQualifiedName);
}
public void consumeSecondaryType(char[] simpleTypeName) {
this.signature.append('~');
- this.mainTypeStart = this.signature.lastIndexOf(".") + 1; //$NON-NLS-1$
+ this.mainTypeStart = this.signature.lastIndexOf(this.asBinarySignature ? "/" : ".") + 1; //$NON-NLS-1$ //$NON-NLS-2$
if (this.mainTypeStart == 0) {
this.mainTypeStart = 1; // default package (1 for the 'L')
int i = 0;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.java
index 8d61b77..fdfbc5e 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -192,7 +192,7 @@
public static String cache_invalidLoadFactor;
public static String savedState_jobName;
public static String refreshing_external_folders;
- public static String updating_external_archives_jobName;
+ public static String synchronizing_projects_job;
public static String convention_unit_nullName;
public static String convention_unit_notJavaName;
public static String convention_classFile_nullName;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Util.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Util.java
index 4a78602..c202ba6 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Util.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/Util.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Stephan Herrmann - Contribution for
+ * Bug 458577 - IClassFile.getWorkingCopy() may lead to NPE in BecomeWorkingCopyOperation
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.core.util;
@@ -1516,6 +1518,8 @@
return (JavaElement) declaringMethod.getTypeParameter(typeVariableName);
} else {
IType declaringType = (IType) getUnresolvedJavaElement((TypeBinding) declaringElement, workingCopyOwner, bindingsToNodes);
+ if (declaringType == null)
+ return null;
return (JavaElement) declaringType.getTypeParameter(typeVariableName);
}
} else {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties
index d5908f8..bf3c646 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/core/util/messages.properties
@@ -191,7 +191,7 @@
cache_invalidLoadFactor = Incorrect load factor
savedState_jobName = Processing Java changes since last activation
refreshing_external_folders = Refreshing external folders
-updating_external_archives_jobName = Refreshing external archives
+synchronizing_projects_job = Synchronizing projects
## java model initialization
javamodel_initialization = Initializing Java tooling
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
index 1892bd1..50fa837 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
@@ -24,7 +24,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CastExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.InnerInferenceHelper;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
@@ -158,14 +157,14 @@
// resolve type arguments (for generic constructor call)
if (this.typeArguments != null) {
int length = this.typeArguments.length;
- boolean argHasError = scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5;
+ this.argumentsHaveErrors = scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5;
this.genericTypeArguments = new TypeBinding[length];
for (int i = 0; i < length; i++) {
TypeReference typeReference = this.typeArguments[i];
if ((this.genericTypeArguments[i] = typeReference.resolveType(scope, true /* check bounds*/)) == null) {
- argHasError = true;
+ this.argumentsHaveErrors = true;
}
- if (argHasError && typeReference instanceof Wildcard) {
+ if (this.argumentsHaveErrors && typeReference instanceof Wildcard) {
scope.problemReporter().illegalUsageOfWildcard(typeReference);
}
}
@@ -173,7 +172,7 @@
scope.problemReporter().diamondNotWithExplicitTypeArguments(this.typeArguments);
return null;
}
- if (argHasError) {
+ if (this.argumentsHaveErrors) {
if (this.arguments != null) { // still attempt to resolve arguments
for (int i = 0, max = this.arguments.length; i < max; i++) {
this.arguments[i].resolveType(scope);
@@ -184,29 +183,23 @@
}
// buffering the arguments' types
- boolean argsContainCast = false;
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
+ this.argumentTypes = Binding.NO_PARAMETERS;
if (this.arguments != null) {
- boolean argHasError = false;
+ this.argumentsHaveErrors = false;
int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
- TypeBinding argumentType;
+ this.argumentTypes = new TypeBinding[length];
for (int i = 0; i < length; i++) {
Expression argument = this.arguments[i];
if (argument instanceof CastExpression) {
argument.bits |= DisableUnnecessaryCastCheck; // will check later on
- argsContainCast = true;
+ this.argsContainCast = true;
}
argument.setExpressionContext(INVOCATION_CONTEXT);
- if ((argumentType = argumentTypes[i] = argument.resolveType(scope)) == null) {
- argHasError = true;
- }
- if (argumentType != null && argumentType.kind() == Binding.POLY_TYPE) {
- if (this.innerInferenceHelper == null)
- this.innerInferenceHelper = new InnerInferenceHelper();
+ if ((this.argumentTypes[i] = argument.resolveType(scope)) == null) {
+ this.argumentsHaveErrors = true;
}
}
- if (argHasError) {
+ if (this.argumentsHaveErrors) {
return this.resolvedType;
}
}
@@ -218,7 +211,7 @@
return this.resolvedType;
}
if (isDiamond) {
- TypeBinding [] inferredTypes = inferElidedTypes((ParameterizedTypeBinding) this.resolvedType, null, argumentTypes, scope);
+ TypeBinding [] inferredTypes = inferElidedTypes(scope);
if (inferredTypes == null) {
scope.problemReporter().cannotInferElidedTypes(this);
return this.resolvedType = null;
@@ -227,7 +220,7 @@
}
ReferenceBinding allocatedType = (ReferenceBinding) this.resolvedType;
- this.binding = findConstructorBinding(scope, this, allocatedType, argumentTypes);
+ this.binding = findConstructorBinding(scope, this, allocatedType, this.argumentTypes);
if (!this.binding.isValidBinding()) {
if (this.binding instanceof ProblemMethodBinding
@@ -255,7 +248,7 @@
return this.resolvedType;
}
CodeSnippetScope localScope = new CodeSnippetScope(scope);
- MethodBinding privateBinding = localScope.getConstructor((ReferenceBinding)this.delegateThis.type, argumentTypes, this);
+ MethodBinding privateBinding = localScope.getConstructor((ReferenceBinding)this.delegateThis.type, this.argumentTypes, this);
if (!privateBinding.isValidBinding()) {
if (this.binding.declaringClass == null) {
this.binding.declaringClass = allocatedType;
@@ -285,14 +278,14 @@
if (this.arguments != null) {
for (int i = 0; i < this.arguments.length; i++) {
TypeBinding parameterType = this.binding.parameters[i];
- TypeBinding argumentType = argumentTypes[i];
+ TypeBinding argumentType = this.argumentTypes[i];
this.arguments[i].computeConversion(scope, parameterType, argumentType);
if (argumentType.needsUncheckedConversion(parameterType)) {
scope.problemReporter().unsafeTypeConversion(this.arguments[i], argumentType, parameterType);
}
}
- if (argsContainCast) {
- CastExpression.checkNeedForArgumentCasts(scope, null, allocatedType, this.binding, this.arguments, argumentTypes, this);
+ if (this.argsContainCast) {
+ CastExpression.checkNeedForArgumentCasts(scope, null, allocatedType, this.binding, this.arguments, this.argumentTypes, this);
}
}
if (allocatedType.isRawType() && this.binding.hasSubstitutedParameters()) {
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java
index 26aabe3..b4bac68 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetFieldReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for bug 185682 - Increment/decrement operators mark local variables as read
+ * Stephan Herrmann - Contributions for
+ * Bug 185682 - Increment/decrement operators mark local variables as read
+ * Bug 458396 - NPE in CodeStream.invoke()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.eval;
@@ -330,7 +332,7 @@
scope.problemReporter().deprecatedField(this.binding, this);
}
// check for this.x in static is done in the resolution of the receiver
- this.constant = this.receiver.isImplicitThis() ? this.binding.constant() : Constant.NotAConstant;
+ this.constant = this.receiver.isImplicitThis() ? this.binding.constant(scope) : Constant.NotAConstant;
if (!this.receiver.isThis()) { // TODO need to check if shouldn't be isImplicitThis check (and then removed)
this.constant = Constant.NotAConstant;
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
index 2d16899..9cdea1b 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
@@ -23,7 +23,6 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CastExpression;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.InnerInferenceHelper;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -195,73 +194,68 @@
public TypeBinding resolveType(BlockScope scope) {
// Answer the signature return type
// Base type promotion
-
- this.constant = Constant.NotAConstant;
- boolean receiverCast = false, argsContainCast = false;
- if (this.receiver instanceof CastExpression) {
- this.receiver.bits |= DisableUnnecessaryCastCheck; // will check later on
- receiverCast = true;
- }
- this.actualReceiverType = this.receiver.resolveType(scope);
- if (receiverCast && this.actualReceiverType != null) {
- // due to change of declaring class with receiver type, only identity cast should be notified
- if (TypeBinding.equalsEquals(((CastExpression)this.receiver).expression.resolvedType, this.actualReceiverType)) {
- scope.problemReporter().unnecessaryCast((CastExpression)this.receiver);
+
+ if (this.constant != Constant.NotAConstant) {
+ this.constant = Constant.NotAConstant;
+ boolean receiverCast = false;
+ if (this.receiver instanceof CastExpression) {
+ this.receiver.bits |= DisableUnnecessaryCastCheck; // will check later on
+ receiverCast = true;
}
- }
- // resolve type arguments (for generic constructor call)
- if (this.typeArguments != null) {
- int length = this.typeArguments.length;
- boolean argHasError = false; // typeChecks all arguments
- this.genericTypeArguments = new TypeBinding[length];
- for (int i = 0; i < length; i++) {
- if ((this.genericTypeArguments[i] = this.typeArguments[i].resolveType(scope, true /* check bounds*/)) == null) {
- argHasError = true;
+ this.actualReceiverType = this.receiver.resolveType(scope);
+ if (receiverCast && this.actualReceiverType != null) {
+ // due to change of declaring class with receiver type, only identity cast should be notified
+ if (TypeBinding.equalsEquals(((CastExpression)this.receiver).expression.resolvedType, this.actualReceiverType)) {
+ scope.problemReporter().unnecessaryCast((CastExpression)this.receiver);
}
}
- if (argHasError) {
+ // resolve type arguments (for generic constructor call)
+ if (this.typeArguments != null) {
+ int length = this.typeArguments.length;
+ this.argumentsHaveErrors = false; // typeChecks all arguments
+ this.genericTypeArguments = new TypeBinding[length];
+ for (int i = 0; i < length; i++) {
+ if ((this.genericTypeArguments[i] = this.typeArguments[i].resolveType(scope, true /* check bounds*/)) == null) {
+ this.argumentsHaveErrors = true;
+ }
+ }
+ if (this.argumentsHaveErrors) {
+ return null;
+ }
+ }
+ // will check for null after args are resolved
+ if (this.arguments != null) {
+ this.argumentsHaveErrors = false; // typeChecks all arguments
+ int length = this.arguments.length;
+ this.argumentTypes = new TypeBinding[length];
+ for (int i = 0; i < length; i++) {
+ Expression argument = this.arguments[i];
+ if (argument instanceof CastExpression) {
+ argument.bits |= DisableUnnecessaryCastCheck; // will check later on
+ this.argsContainCast = true;
+ }
+ argument.setExpressionContext(INVOCATION_CONTEXT);
+ if ((this.argumentTypes[i] = this.arguments[i].resolveType(scope)) == null)
+ this.argumentsHaveErrors = true;
+ }
+ if (this.argumentsHaveErrors) {
+ if(this.actualReceiverType instanceof ReferenceBinding) {
+ // record any selector match, for clients who may still need hint about possible method match
+ this.binding = scope.findMethod((ReferenceBinding)this.actualReceiverType, this.selector, new TypeBinding[]{}, this, false);
+ }
+ return null;
+ }
+ }
+ if (this.actualReceiverType == null) {
+ return null;
+ }
+ // base type cannot receive any message
+ if (this.actualReceiverType.isBaseType()) {
+ scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, this.argumentTypes);
return null;
}
}
- // will check for null after args are resolved
- TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
- if (this.arguments != null) {
- boolean argHasError = false; // typeChecks all arguments
- int length = this.arguments.length;
- argumentTypes = new TypeBinding[length];
- TypeBinding argumentType;
- for (int i = 0; i < length; i++) {
- Expression argument = this.arguments[i];
- if (argument instanceof CastExpression) {
- argument.bits |= DisableUnnecessaryCastCheck; // will check later on
- argsContainCast = true;
- }
- argument.setExpressionContext(INVOCATION_CONTEXT);
- if ((argumentType = argumentTypes[i] = this.arguments[i].resolveType(scope)) == null)
- argHasError = true;
- if (argumentType != null && argumentType.kind() == Binding.POLY_TYPE) {
- if (this.innerInferenceHelper == null)
- this.innerInferenceHelper = new InnerInferenceHelper();
- }
- }
- if (argHasError) {
- if(this.actualReceiverType instanceof ReferenceBinding) {
- // record any selector match, for clients who may still need hint about possible method match
- this.binding = scope.findMethod((ReferenceBinding)this.actualReceiverType, this.selector, new TypeBinding[]{}, this, false);
- }
- return null;
- }
- }
- if (this.actualReceiverType == null) {
- return null;
- }
- // base type cannot receive any message
- if (this.actualReceiverType.isBaseType()) {
- scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes);
- return null;
- }
-
- findMethodBinding(scope, argumentTypes);
+ findMethodBinding(scope);
if (!this.binding.isValidBinding()) {
if (this.binding instanceof ProblemMethodBinding
@@ -270,29 +264,29 @@
this.delegateThis = scope.getField(scope.enclosingSourceType(), EvaluationConstants.DELEGATE_THIS, this);
if (this.delegateThis == null){ // if not found then internal error, field should have been found
this.constant = Constant.NotAConstant;
- scope.problemReporter().invalidMethod(this, this.binding);
+ scope.problemReporter().invalidMethod(this, this.binding, scope);
return null;
}
} else {
this.constant = Constant.NotAConstant;
- scope.problemReporter().invalidMethod(this, this.binding);
+ scope.problemReporter().invalidMethod(this, this.binding, scope);
return null;
}
CodeSnippetScope localScope = new CodeSnippetScope(scope);
MethodBinding privateBinding =
this.receiver instanceof CodeSnippetThisReference && ((CodeSnippetThisReference) this.receiver).isImplicit
- ? localScope.getImplicitMethod((ReferenceBinding)this.delegateThis.type, this.selector, argumentTypes, this)
- : localScope.getMethod(this.delegateThis.type, this.selector, argumentTypes, this);
+ ? localScope.getImplicitMethod((ReferenceBinding)this.delegateThis.type, this.selector, this.argumentTypes, this)
+ : localScope.getMethod(this.delegateThis.type, this.selector, this.argumentTypes, this);
if (!privateBinding.isValidBinding()) {
if (this.binding.declaringClass == null) {
if (this.actualReceiverType instanceof ReferenceBinding) {
this.binding.declaringClass = (ReferenceBinding) this.actualReceiverType;
} else { // really bad error ....
- scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes);
+ scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, this.argumentTypes);
return null;
}
}
- scope.problemReporter().invalidMethod(this, this.binding);
+ scope.problemReporter().invalidMethod(this, this.binding, scope);
return null;
} else {
this.binding = privateBinding;
@@ -302,11 +296,11 @@
if (this.actualReceiverType instanceof ReferenceBinding) {
this.binding.declaringClass = (ReferenceBinding) this.actualReceiverType;
} else { // really bad error ....
- scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes);
+ scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, this.argumentTypes);
return null;
}
}
- scope.problemReporter().invalidMethod(this, this.binding);
+ scope.problemReporter().invalidMethod(this, this.binding, scope);
return null;
}
}
@@ -326,7 +320,7 @@
}
}
}
- if (checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this)) {
+ if (checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, this.argumentTypes, this.argsContainCast, this)) {
this.bits |= ASTNode.Unchecked;
}
@@ -353,10 +347,11 @@
if ((this.bits & ASTNode.Unchecked) != 0 && this.genericTypeArguments == null) {
returnType = scope.environment().convertToRawType(returnType.erasure(), true);
}
- returnType = returnType.capture(scope, this.sourceEnd);
+ returnType = returnType.capture(scope, this.sourceStart, this.sourceEnd);
}
this.resolvedType = returnType;
}
return this.resolvedType;
}
}
+
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
index 4ca6fc0..53aee11 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetQualifiedNameReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for bug 185682 - Increment/decrement operators mark local variables as read
+ * Stephan Herrmann - Contributions for
+ * Bug 185682 - Increment/decrement operators mark local variables as read
+ * Bug 458396 - NPE in CodeStream.invoke()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.eval;
@@ -473,7 +475,7 @@
TypeBinding type = ((VariableBinding) this.binding).type;
int index = this.indexOfFirstFieldBinding;
if (index == length) { // restrictiveFlag == FIELD
- this.constant = ((FieldBinding) this.binding).constant();
+ this.constant = ((FieldBinding) this.binding).constant(scope);
return type;
}
@@ -482,7 +484,7 @@
this.otherBindings = new FieldBinding[otherBindingsLength];
// fill the first constant (the one of the binding)
- this.constant =((VariableBinding) this.binding).constant();
+ this.constant =((VariableBinding) this.binding).constant(scope);
// iteration on each field
while (index < length) {
@@ -517,7 +519,7 @@
}
// constant propagation can only be performed as long as the previous one is a constant too.
if (this.constant != Constant.NotAConstant){
- this.constant = field.constant();
+ this.constant = field.constant(scope);
}
type = field.type;
index++;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
index a28b3c0..ff8dd31 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -396,7 +396,7 @@
if (methodBinding == null)
return new ProblemMethodBinding(selector, argumentTypes, ProblemReasons.NotFound);
if (methodBinding.isValidBinding()) {
- MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite, Scope.FULL_INFERENCE);
+ MethodBinding compatibleMethod = computeCompatibleMethod(methodBinding, argumentTypes, invocationSite);
if (compatibleMethod == null)
return new ProblemMethodBinding(methodBinding, selector, argumentTypes, ProblemReasons.NotFound);
methodBinding = compatibleMethod;
@@ -542,7 +542,7 @@
MethodBinding[] compatible = new MethodBinding[methods.length];
int compatibleIndex = 0;
for (int i = 0, length = methods.length; i < length; i++) {
- MethodBinding compatibleMethod = computeCompatibleMethod(methods[i], argumentTypes, invocationSite, Scope.APPLICABILITY);
+ MethodBinding compatibleMethod = computeCompatibleMethod(methods[i], argumentTypes, invocationSite);
if (compatibleMethod != null)
compatible[compatibleIndex++] = compatibleMethod;
}
@@ -558,8 +558,7 @@
}
}
if (visibleIndex == 1) {
- // 1.8: Give inference a chance to perform outstanding tasks (18.5.2):
- return inferInvocationType(invocationSite, visible[0], argumentTypes);
+ return visible[0];
}
if (visibleIndex == 0) {
return new ProblemMethodBinding(compatible[0], TypeConstants.INIT, compatible[0].parameters, ProblemReasons.NotVisible);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
index 6ece92a..64e7e78 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for bug 185682 - Increment/decrement operators mark local variables as read
+ * Stephan Herrmann - Contributions for
+ * Bug 185682 - Increment/decrement operators mark local variables as read
+ * Bug 458396 - NPE in CodeStream.invoke()
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.eval;
@@ -101,7 +103,7 @@
return null;
}
}
- this.constant = fieldBinding.constant();
+ this.constant = fieldBinding.constant(scope);
if (isFieldUseDeprecated(fieldBinding, scope, this.bits)) {
scope.problemReporter().deprecatedField(fieldBinding, this);
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
index 120bf1d..cd4b7fa 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann - Contribution for bug 186342 - [compiler][null] Using annotations for null checking
+ * Stephan Herrmann - Contribution for
+ * Bug 186342 - [compiler][null] Using annotations for null checking
+ * Bug 440474 - [null] textual encoding of external null annotations
* Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
* Bug 407191 - [1.8] Binary access support for type annotations
*******************************************************************************/
@@ -23,6 +25,8 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
/**
@@ -190,4 +194,7 @@
public char[] sourceFileName() {
return null;
}
+public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member, LookupEnvironment environment) {
+ return walker;
+}
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/AbortFormatting.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/AbortFormatting.java
deleted file mode 100644
index 1539577..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/AbortFormatting.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-/**
- * Unchecked exception wrapping invalid input checked exception which may occur
- * when scanning original formatted source.
- *
- * @since 2.1
- */
-public class AbortFormatting extends RuntimeException {
-
- Throwable nestedException;
- private static final long serialVersionUID = -5796507276311428526L; // backward compatible
-
- public AbortFormatting(String message) {
- super(message);
- }
- public AbortFormatting(Throwable nestedException) {
- super(nestedException.getMessage());
- this.nestedException = nestedException;
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/BinaryExpressionFragmentBuilder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/BinaryExpressionFragmentBuilder.java
deleted file mode 100644
index 5e3c2b2..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/BinaryExpressionFragmentBuilder.java
+++ /dev/null
@@ -1,480 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import java.util.ArrayList;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AND_AND_Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Assignment;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.BinaryExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CastExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CharLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompoundAssignment;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.DoubleLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.EqualExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FalseLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FloatLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.IntLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LongLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteralConcatenation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.OperatorIds;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.PostfixExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.PrefixExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SuperReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ThisReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.UnaryExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
-
-@SuppressWarnings({ "rawtypes", "unchecked" })
-class BinaryExpressionFragmentBuilder
- extends ASTVisitor {
-
- ArrayList fragmentsList;
- ArrayList operatorsList;
- private int realFragmentsSize;
-
- BinaryExpressionFragmentBuilder() {
- this.fragmentsList = new ArrayList();
- this.operatorsList = new ArrayList();
- this.realFragmentsSize = 0;
- }
-
- private final void addRealFragment(ASTNode node) {
- this.fragmentsList.add(node);
- this.realFragmentsSize++;
- }
-
- private final void addSmallFragment(ASTNode node) {
- this.fragmentsList.add(node);
- }
-
- private boolean buildFragments(Expression expression) {
- if (((expression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT) != 0) {
- addRealFragment(expression);
- return false;
- }
- return true;
- }
-
- public ASTNode[] fragments() {
- ASTNode[] fragments = new ASTNode[this.fragmentsList.size()];
- this.fragmentsList.toArray(fragments);
- return fragments;
- }
-
- public int[] operators() {
- int length = this.operatorsList.size();
- int[] tab = new int[length];
- for (int i = 0; i < length; i++) {
- tab[i] = ((Integer)this.operatorsList.get(i)).intValue();
- }
- return tab;
- }
-
- public int realFragmentsSize() {
- return this.realFragmentsSize;
- }
-
- public boolean visit(
- AllocationExpression allocationExpression,
- BlockScope scope) {
- addRealFragment(allocationExpression);
- return false;
- }
-
- public boolean visit(
- AND_AND_Expression and_and_Expression,
- BlockScope scope) {
-
- if (((and_and_Expression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT) != 0) {
- addRealFragment(and_and_Expression);
- } else {
- and_and_Expression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameAND_AND));
- and_and_Expression.right.traverse(this, scope);
- }
- return false;
- }
-
- public boolean visit(
- ArrayAllocationExpression arrayAllocationExpression,
- BlockScope scope) {
- addRealFragment(arrayAllocationExpression);
- return false;
- }
-
- public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
- addRealFragment(arrayInitializer);
- return false;
- }
-
- public boolean visit(
- ArrayQualifiedTypeReference arrayQualifiedTypeReference,
- BlockScope scope) {
- addRealFragment(arrayQualifiedTypeReference);
- return false;
- }
-
- public boolean visit(
- ArrayQualifiedTypeReference arrayQualifiedTypeReference,
- ClassScope scope) {
- addRealFragment(arrayQualifiedTypeReference);
- return false;
- }
-
- public boolean visit(ArrayReference arrayReference, BlockScope scope) {
- addRealFragment(arrayReference);
- return false;
- }
-
- public boolean visit(
- ArrayTypeReference arrayTypeReference,
- BlockScope scope) {
- addRealFragment(arrayTypeReference);
- return false;
- }
-
- public boolean visit(
- ArrayTypeReference arrayTypeReference,
- ClassScope scope) {
- addRealFragment(arrayTypeReference);
- return false;
- }
-
- public boolean visit(Assignment assignment, BlockScope scope) {
- addRealFragment(assignment);
- return false;
- }
-
- public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
- if (binaryExpression instanceof CombinedBinaryExpression) {
- CombinedBinaryExpression expression = (CombinedBinaryExpression) binaryExpression;
- if (expression.referencesTable != null) {
- return this.visit(expression, scope);
- }
- }
- final int numberOfParens = (binaryExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- addRealFragment(binaryExpression);
- } else {
- switch((binaryExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT) {
- case OperatorIds.PLUS :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- case OperatorIds.MINUS :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameMINUS));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- case OperatorIds.MULTIPLY :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameMULTIPLY));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- case OperatorIds.REMAINDER :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameREMAINDER));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- case OperatorIds.XOR :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameXOR));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- case OperatorIds.DIVIDE :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameDIVIDE));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- case OperatorIds.OR :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameOR));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- case OperatorIds.AND :
- if (buildFragments(binaryExpression)) {
- binaryExpression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameAND));
- binaryExpression.right.traverse(this, scope);
- }
- return false;
- default:
- addRealFragment(binaryExpression);
- }
- }
- return false;
- }
-
- public boolean visit(CombinedBinaryExpression combinedBinaryExpression, BlockScope scope) {
- // keep implementation in sync with BinaryExpression#resolveType
- if (combinedBinaryExpression.referencesTable == null) {
- addRealFragment(combinedBinaryExpression.left);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
- addRealFragment(combinedBinaryExpression.right);
- return false;
- }
- BinaryExpression cursor = combinedBinaryExpression.referencesTable[0];
- if (cursor.left instanceof CombinedBinaryExpression) {
- this.visit((CombinedBinaryExpression) cursor.left, scope);
- } else {
- addRealFragment(cursor.left);
- }
- for (int i = 0, end = combinedBinaryExpression.arity; i < end; i ++) {
- this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
- addRealFragment(combinedBinaryExpression.referencesTable[i].right);
- }
- this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
- addRealFragment(combinedBinaryExpression.right);
- return false;
- }
-
- public boolean visit(CastExpression castExpression, BlockScope scope) {
- addRealFragment(castExpression);
- return false;
- }
-
- public boolean visit(CharLiteral charLiteral, BlockScope scope) {
- addSmallFragment(charLiteral);
- return false;
- }
-
- public boolean visit(
- ClassLiteralAccess classLiteralAccess,
- BlockScope scope) {
- addRealFragment(classLiteralAccess);
- return false;
- }
-
- public boolean visit(
- CompoundAssignment compoundAssignment,
- BlockScope scope) {
- addRealFragment(compoundAssignment);
- return false;
- }
-
- public boolean visit(
- ConditionalExpression conditionalExpression,
- BlockScope scope) {
- addRealFragment(conditionalExpression);
- return false;
- }
-
- public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) {
- addSmallFragment(doubleLiteral);
- return false;
- }
-
- public boolean visit(EqualExpression equalExpression, BlockScope scope) {
- addRealFragment(equalExpression);
- return false;
- }
-
- public boolean visit(
- ExtendedStringLiteral extendedStringLiteral,
- BlockScope scope) {
- addRealFragment(extendedStringLiteral);
- return false;
- }
-
- public boolean visit(FalseLiteral falseLiteral, BlockScope scope) {
- addSmallFragment(falseLiteral);
- return false;
- }
-
- public boolean visit(FieldReference fieldReference, BlockScope scope) {
- addRealFragment(fieldReference);
- return false;
- }
-
- public boolean visit(FloatLiteral floatLiteral, BlockScope scope) {
- addSmallFragment(floatLiteral);
- return false;
- }
-
- public boolean visit(
- InstanceOfExpression instanceOfExpression,
- BlockScope scope) {
- addRealFragment(instanceOfExpression);
- return false;
- }
-
- public boolean visit(IntLiteral intLiteral, BlockScope scope) {
- addSmallFragment(intLiteral);
- return false;
- }
-
- public boolean visit(LongLiteral longLiteral, BlockScope scope) {
- addSmallFragment(longLiteral);
- return false;
- }
-
- public boolean visit(MessageSend messageSend, BlockScope scope) {
- addRealFragment(messageSend);
- return false;
- }
-
- public boolean visit(StringLiteralConcatenation stringLiteral, BlockScope scope) {
- if (((stringLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT) != 0) {
- addRealFragment(stringLiteral);
- } else {
- for (int i = 0, max = stringLiteral.counter; i < max; i++) {
- addRealFragment(stringLiteral.literals[i]);
- if (i < max - 1) {
- this.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
- }
- }
- }
- return false;
- }
-
- public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
- addRealFragment(nullLiteral);
- return false;
- }
-
- public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) {
- if (((or_or_Expression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT) != 0) {
- addRealFragment(or_or_Expression);
- } else {
- or_or_Expression.left.traverse(this, scope);
- this.operatorsList.add(new Integer(TerminalTokens.TokenNameOR_OR));
- or_or_Expression.right.traverse(this, scope);
- }
- return false;
- }
-
- public boolean visit(
- PostfixExpression postfixExpression,
- BlockScope scope) {
- addRealFragment(postfixExpression);
- return false;
- }
-
- public boolean visit(PrefixExpression prefixExpression, BlockScope scope) {
- addRealFragment(prefixExpression);
- return false;
- }
-
- public boolean visit(
- QualifiedAllocationExpression qualifiedAllocationExpression,
- BlockScope scope) {
- addRealFragment(qualifiedAllocationExpression);
- return false;
- }
- public boolean visit(
- QualifiedNameReference qualifiedNameReference,
- BlockScope scope) {
- addRealFragment(qualifiedNameReference);
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- QualifiedSuperReference qualifiedSuperReference,
- BlockScope scope) {
- addRealFragment(qualifiedSuperReference);
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- QualifiedThisReference qualifiedThisReference,
- BlockScope scope) {
- addRealFragment(qualifiedThisReference);
- return false;
- }
-
- public boolean visit(
- SingleNameReference singleNameReference,
- BlockScope scope) {
- addRealFragment(singleNameReference);
- return false;
- }
-
- public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
- addRealFragment(stringLiteral);
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SuperReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(SuperReference superReference, BlockScope scope) {
- addRealFragment(superReference);
- return false;
- }
-
- public boolean visit(ThisReference thisReference, BlockScope scope) {
- addRealFragment(thisReference);
- return false;
- }
-
- public boolean visit(TrueLiteral trueLiteral, BlockScope scope) {
- addSmallFragment(trueLiteral);
- return false;
- }
-
- public boolean visit(UnaryExpression unaryExpression, BlockScope scope) {
- addRealFragment(unaryExpression);
- return false;
- }
-
- public int size() {
- return this.fragmentsList.size();
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CascadingMethodInvocationFragmentBuilder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CascadingMethodInvocationFragmentBuilder.java
deleted file mode 100644
index b06eda6..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CascadingMethodInvocationFragmentBuilder.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import java.util.ArrayList;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
-
-@SuppressWarnings({"rawtypes", "unchecked"})
-class CascadingMethodInvocationFragmentBuilder
- extends ASTVisitor {
-
- ArrayList fragmentsList;
-
- CascadingMethodInvocationFragmentBuilder() {
- this.fragmentsList = new ArrayList();
- }
-
- public MessageSend[] fragments() {
- MessageSend[] fragments = new MessageSend[this.fragmentsList.size()];
- this.fragmentsList.toArray(fragments);
- return fragments;
- }
-
- public int size() {
- return this.fragmentsList.size();
- }
- /* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(MessageSend messageSend, BlockScope scope) {
- if ((messageSend.receiver.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT == 0) {
- if (messageSend.receiver instanceof MessageSend) {
- this.fragmentsList.add(0, messageSend);
- messageSend.receiver.traverse(this, scope);
- return false;
- }
- this.fragmentsList.add(0, messageSend);
- this.fragmentsList.add(1, messageSend);
- } else {
- this.fragmentsList.add(0, messageSend);
- this.fragmentsList.add(1, messageSend);
- }
- return false;
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
deleted file mode 100644
index eb84a7a..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java
+++ /dev/null
@@ -1,6072 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2014 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Brock Janiczak - Contribution for bug 150741
- * Nanda Firdausi - Contribution for bug 298844
- * Jesper S Moller - Contribution for bug 402173
- * Contribution for bug 402174
- * Contribution for bug 402819
- * Contribution for bug 402892
- * Contribution for bug 403881
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import java.util.ArrayList;
-import java.util.Map;
-
-import org.aspectj.org.eclipse.jdt.core.JavaCore;
-import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
-import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
-import org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter;
-import org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AND_AND_Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AssertStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Assignment;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.BinaryExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Block;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.BreakStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CaseStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CastExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CharLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Clinit;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompoundAssignment;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ContinueStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.DoStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.DoubleLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.EmptyStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.EqualExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FalseLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FloatLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ForStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ForeachStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.IfStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ImportReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Initializer;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.IntLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.IntersectionCastTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LabeledStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.LongLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NameReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.OperatorIds;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.PostfixExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.PrefixExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Receiver;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReturnStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteralConcatenation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SuperReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SwitchStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ThisReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ThrowStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TryStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.UnaryExpression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.UnionTypeReference;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.WhileStatement;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Wildcard;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
-import org.aspectj.org.eclipse.jdt.internal.core.util.CodeSnippetParsingUtil;
-import org.aspectj.org.eclipse.jdt.internal.formatter.align.Alignment;
-import org.aspectj.org.eclipse.jdt.internal.formatter.align.AlignmentException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * This class is responsible for formatting a valid java source code.
- * @since 2.1
- */
-/*
- <extension
- id="org.aspectj.org.eclipse.jdt.core.newformatter.codeformatter"
- name="org.aspectj.org.eclipse.jdt.core.newformatter.codeformatter"
- point="org.aspectj.org.eclipse.jdt.core.codeFormatter">
- <codeFormatter
- class="org.aspectj.org.eclipse.jdt.internal.formatter.CodeFormatterVisitor">
- </codeFormatter>
- </extension>
-*/
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public class CodeFormatterVisitor extends ASTVisitor {
-
- public static class MultiFieldDeclaration extends FieldDeclaration {
-
- FieldDeclaration[] declarations;
-
- MultiFieldDeclaration(FieldDeclaration[] declarations){
- this.declarations = declarations;
- this.modifiers = declarations[0].modifiers;
- }
- }
-
- public final static boolean DEBUG = false;
- private static final int NO_MODIFIERS = 0;
- /*
- * Set of expected tokens type for a single type reference.
- * This array needs to be SORTED.
- */
- private static final int[] SINGLETYPEREFERENCE_EXPECTEDTOKENS = new int[] {
- TerminalTokens.TokenNameIdentifier,
- TerminalTokens.TokenNameboolean,
- TerminalTokens.TokenNamebyte,
- TerminalTokens.TokenNamechar,
- TerminalTokens.TokenNamedouble,
- TerminalTokens.TokenNamefloat,
- TerminalTokens.TokenNameint,
- TerminalTokens.TokenNamelong,
- TerminalTokens.TokenNameshort,
- TerminalTokens.TokenNamevoid
- };
- private static final int[] CLOSING_GENERICS_EXPECTEDTOKENS = new int[] {
- TerminalTokens.TokenNameRIGHT_SHIFT,
- TerminalTokens.TokenNameGREATER,
- TerminalTokens.TokenNameUNSIGNED_RIGHT_SHIFT,
- };
- public int lastLocalDeclarationSourceStart;
- int lastBinaryExpressionAlignmentBreakIndentation;
- private Scanner localScanner;
- public DefaultCodeFormatterOptions preferences;
- public Scribe scribe;
-
- // Binary expression positions storage
- final static long EXPRESSIONS_POS_ENTER_EQUALITY = 1;
- final static long EXPRESSIONS_POS_ENTER_TWO = 2;
- final static long EXPRESSIONS_POS_BETWEEN_TWO = 3;
- final static long EXPRESSIONS_POS_MASK = EXPRESSIONS_POS_BETWEEN_TWO;
- long expressionsPos;
- int expressionsDepth = -1;
-
- // Array initializers information
- int arrayInitializersDepth = -1;
-
- public CodeFormatterVisitor(DefaultCodeFormatterOptions preferences, Map settings, IRegion[] regions, CodeSnippetParsingUtil codeSnippetParsingUtil, boolean includeComments) {
- long sourceLevel = settings == null
- ? ClassFileConstants.JDK1_3
- : CompilerOptions.versionToJdkLevel(settings.get(JavaCore.COMPILER_SOURCE));
- this.localScanner = new Scanner(true, false, false/*nls*/, sourceLevel/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
-
- this.preferences = preferences;
- this.scribe = new Scribe(this, sourceLevel, regions, codeSnippetParsingUtil, includeComments);
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#acceptProblem(org.aspectj.org.eclipse.jdt.core.compiler.IProblem)
- */
- public void acceptProblem(IProblem problem) {
- super.acceptProblem(problem);
- }
-
- private BinaryExpressionFragmentBuilder buildFragments(BinaryExpression binaryExpression, BlockScope scope) {
- BinaryExpressionFragmentBuilder builder = new BinaryExpressionFragmentBuilder();
-
- if (binaryExpression instanceof CombinedBinaryExpression) {
- binaryExpression.traverse(builder, scope);
- return builder;
- }
- switch((binaryExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT) {
- case OperatorIds.MULTIPLY :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameMULTIPLY));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.PLUS :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNamePLUS));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.DIVIDE :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameDIVIDE));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.REMAINDER :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameREMAINDER));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.XOR :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameXOR));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.MINUS :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameMINUS));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.OR :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameOR));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.AND :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameAND));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.AND_AND :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameAND_AND));
- binaryExpression.right.traverse(builder, scope);
- break;
- case OperatorIds.OR_OR :
- binaryExpression.left.traverse(builder, scope);
- builder.operatorsList.add(new Integer(TerminalTokens.TokenNameOR_OR));
- binaryExpression.right.traverse(builder, scope);
- break;
- }
-
- return builder;
- }
-
- private CascadingMethodInvocationFragmentBuilder buildFragments(MessageSend messageSend, BlockScope scope) {
- CascadingMethodInvocationFragmentBuilder builder = new CascadingMethodInvocationFragmentBuilder();
-
- messageSend.traverse(builder, scope);
- return builder;
- }
-
- private boolean commentStartsBlock(int start, int end) {
- this.localScanner.resetTo(start, end);
- try {
- if (this.localScanner.getNextToken() == TerminalTokens.TokenNameLBRACE) {
- switch(this.localScanner.getNextToken()) {
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- return true;
- }
- }
- } catch(InvalidInputException e) {
- // ignore
- }
- return false;
- }
-
- private ASTNode[] computeMergedMemberDeclarations(ASTNode[] nodes){
- ArrayList mergedNodes = new ArrayList();
- for (int i = 0, max = nodes.length; i < max; i++) {
- ASTNode currentNode = nodes[i];
- if (currentNode instanceof FieldDeclaration) {
- FieldDeclaration currentField = (FieldDeclaration) currentNode;
- if (mergedNodes.size() == 0) {
- // first node
- mergedNodes.add(currentNode);
- } else {
- // we need to check if the previous merged node is a field declaration
- ASTNode previousMergedNode = (ASTNode) mergedNodes.get(mergedNodes.size() - 1);
- if (previousMergedNode instanceof MultiFieldDeclaration) {
- // we merge the current node
- MultiFieldDeclaration multiFieldDeclaration = (MultiFieldDeclaration) previousMergedNode;
- int length = multiFieldDeclaration.declarations.length;
- System.arraycopy(multiFieldDeclaration.declarations, 0, multiFieldDeclaration.declarations= new FieldDeclaration[length+1], 0, length);
- multiFieldDeclaration.declarations[length] = currentField;
- } else if (previousMergedNode instanceof FieldDeclaration) {
- // need to check we need to create a multiple field declaration
- final FieldDeclaration previousFieldDeclaration = (FieldDeclaration)previousMergedNode;
- if (currentField.declarationSourceStart == previousFieldDeclaration.declarationSourceStart) {
- // we create a multi field declaration
- final MultiFieldDeclaration multiFieldDeclaration = new MultiFieldDeclaration(new FieldDeclaration[]{ previousFieldDeclaration, currentField});
- multiFieldDeclaration.annotations = previousFieldDeclaration.annotations;
- mergedNodes.set(mergedNodes.size() - 1, multiFieldDeclaration);
- } else {
- mergedNodes.add(currentNode);
- }
- } else {
- mergedNodes.add(currentNode);
- }
- }
- } else {
- mergedNodes.add(currentNode);
- }
- }
- if (mergedNodes.size() != nodes.length) {
- ASTNode[] result = new ASTNode[mergedNodes.size()];
- mergedNodes.toArray(result);
- return result;
- } else {
- return nodes;
- }
- }
-
- private ASTNode[] computeMergedMemberDeclarations(TypeDeclaration typeDeclaration){
-
- int fieldIndex = 0, fieldCount = (typeDeclaration.fields == null) ? 0 : typeDeclaration.fields.length;
- FieldDeclaration field = fieldCount == 0 ? null : typeDeclaration.fields[fieldIndex];
- int fieldStart = field == null ? Integer.MAX_VALUE : field.declarationSourceStart;
-
- int methodIndex = 0, methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
- AbstractMethodDeclaration method = methodCount == 0 ? null : typeDeclaration.methods[methodIndex];
- int methodStart = method == null ? Integer.MAX_VALUE : method.declarationSourceStart;
-
- int typeIndex = 0, typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;
- TypeDeclaration type = typeCount == 0 ? null : typeDeclaration.memberTypes[typeIndex];
- int typeStart = type == null ? Integer.MAX_VALUE : type.declarationSourceStart;
-
- final int memberLength = fieldCount+methodCount+typeCount;
- ASTNode[] members = new ASTNode[memberLength];
- if (memberLength != 0) {
- int index = 0;
- int previousFieldStart = -1;
- do {
- if (fieldStart < methodStart && fieldStart < typeStart) {
- if (field.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
- // filter out enum constants
- previousFieldStart = fieldStart;
- if (++fieldIndex < fieldCount) { // find next field if any
- fieldStart = (field = typeDeclaration.fields[fieldIndex]).declarationSourceStart;
- } else {
- fieldStart = Integer.MAX_VALUE;
- }
- continue;
- }
- // next member is a field
- if (fieldStart == previousFieldStart){
- ASTNode previousMember = members[index - 1];
- if (previousMember instanceof MultiFieldDeclaration) {
- MultiFieldDeclaration multiField = (MultiFieldDeclaration) previousMember;
- int length = multiField.declarations.length;
- System.arraycopy(multiField.declarations, 0, multiField.declarations=new FieldDeclaration[length+1], 0, length);
- multiField.declarations[length] = field;
- } else {
- FieldDeclaration fieldDeclaration = (FieldDeclaration)previousMember;
- final MultiFieldDeclaration multiFieldDeclaration = new MultiFieldDeclaration(new FieldDeclaration[]{ fieldDeclaration, field});
- multiFieldDeclaration.annotations = fieldDeclaration.annotations;
- members[index - 1] = multiFieldDeclaration;
- }
- } else {
- members[index++] = field;
- }
- previousFieldStart = fieldStart;
- if (++fieldIndex < fieldCount) { // find next field if any
- fieldStart = (field = typeDeclaration.fields[fieldIndex]).declarationSourceStart;
- } else {
- fieldStart = Integer.MAX_VALUE;
- }
- } else if (methodStart < fieldStart && methodStart < typeStart) {
- // next member is a method
- if (!method.isDefaultConstructor() && !method.isClinit()) {
- members[index++] = method;
- }
- if (++methodIndex < methodCount) { // find next method if any
- methodStart = (method = typeDeclaration.methods[methodIndex]).declarationSourceStart;
- } else {
- methodStart = Integer.MAX_VALUE;
- }
- } else {
- // next member is a type
- members[index++] = type;
- if (++typeIndex < typeCount) { // find next type if any
- typeStart = (type = typeDeclaration.memberTypes[typeIndex]).declarationSourceStart;
- } else {
- typeStart = Integer.MAX_VALUE;
- }
- }
- } while ((fieldIndex < fieldCount) || (typeIndex < typeCount) || (methodIndex < methodCount));
-
- if (members.length != index) {
- System.arraycopy(members, 0, members=new ASTNode[index], 0, index);
- }
- }
- return members;
- }
-
- private boolean dumpBinaryExpression(
- BinaryExpression binaryExpression,
- int operator,
- BlockScope scope) {
-
- final int numberOfParens = (binaryExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
-
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(binaryExpression, numberOfParens);
- }
- BinaryExpressionFragmentBuilder builder = buildFragments(binaryExpression, scope);
- final int fragmentsSize = builder.size();
-
- if (this.expressionsDepth < 0) {
- this.expressionsDepth = 0;
- } else {
- this.expressionsDepth++;
- this.expressionsPos <<= 2;
- }
- try {
- this.lastBinaryExpressionAlignmentBreakIndentation = 0;
- if ((builder.realFragmentsSize() > 1 || fragmentsSize > 4) && numberOfParens == 0) {
- int scribeLine = this.scribe.line;
- this.scribe.printComment();
- Alignment binaryExpressionAlignment = this.scribe.createAlignment(
- Alignment.BINARY_EXPRESSION,
- this.preferences.alignment_for_binary_expression,
- Alignment.R_OUTERMOST,
- fragmentsSize,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(binaryExpressionAlignment);
- boolean ok = false;
- ASTNode[] fragments = builder.fragments();
- int[] operators = builder.operators();
- do {
- try {
- final int max = fragmentsSize - 1;
- for (int i = 0; i < max; i++) {
- ASTNode fragment = fragments[i];
- fragment.traverse(this, scope);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (this.scribe.lastNumberOfNewLines == 1) {
- // a new line has been inserted while printing the comment
- // hence we need to use the break indentation level before printing next token...
- this.scribe.indentationLevel = binaryExpressionAlignment.breakIndentationLevel;
- }
- if (this.preferences.wrap_before_binary_operator) {
- this.scribe.alignFragment(binaryExpressionAlignment, i);
- this.scribe.printNextToken(operators[i], this.preferences.insert_space_before_binary_operator);
- } else {
- this.scribe.printNextToken(operators[i], this.preferences.insert_space_before_binary_operator);
- this.scribe.alignFragment(binaryExpressionAlignment, i);
- }
- switch(operators[i]) {
- case TerminalTokens.TokenNameMINUS :
- if (isNextToken(TerminalTokens.TokenNameMINUS)
- || isNextToken(TerminalTokens.TokenNameMINUS_MINUS)) {
- // the next character is a '-' or '--' (unary operator)
- this.scribe.space();
- }
- break;
- case TerminalTokens.TokenNamePLUS :
- if (isNextToken(TerminalTokens.TokenNamePLUS)
- || isNextToken(TerminalTokens.TokenNamePLUS_PLUS)) {
- // the next character is a + or ++ (unary operator)
- this.scribe.space();
- }
- }
- if (this.preferences.insert_space_after_binary_operator) {
- this.scribe.space();
- }
- }
- fragments[max].traverse(this, scope);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- ok = true;
- } catch(AlignmentException e){
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(binaryExpressionAlignment, true);
- if (this.scribe.line == scribeLine) {
- // The expression was not broken => reset last break indentation
- this.lastBinaryExpressionAlignmentBreakIndentation = 0;
- } else {
- this.lastBinaryExpressionAlignmentBreakIndentation = binaryExpressionAlignment.breakIndentationLevel;
- }
- } else {
- this.expressionsPos |= EXPRESSIONS_POS_ENTER_TWO;
- binaryExpression.left.traverse(this, scope);
- this.expressionsPos &= ~EXPRESSIONS_POS_MASK;
- this.expressionsPos |= EXPRESSIONS_POS_BETWEEN_TWO;
- this.scribe.printNextToken(operator, this.preferences.insert_space_before_binary_operator, Scribe.PRESERVE_EMPTY_LINES_IN_BINARY_EXPRESSION);
- if (operator == TerminalTokens.TokenNameMINUS && isNextToken(TerminalTokens.TokenNameMINUS)) {
- // the next character is a minus (unary operator)
- this.scribe.space();
- }
- if (this.preferences.insert_space_after_binary_operator) {
- this.scribe.space();
- }
- binaryExpression.right.traverse(this, scope);
- }
- }
- finally {
- this.expressionsDepth--;
- this.expressionsPos >>= 2;
- if (this.expressionsDepth < 0) {
- this.lastBinaryExpressionAlignmentBreakIndentation = 0;
- }
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(binaryExpression, numberOfParens);
- }
- return false;
- }
-
- private boolean dumpEqualityExpression(
- BinaryExpression binaryExpression,
- int operator,
- BlockScope scope) {
-
- final int numberOfParens = (binaryExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
-
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(binaryExpression, numberOfParens);
- }
- if (this.expressionsDepth < 0) {
- this.expressionsDepth = 0;
- } else {
- this.expressionsDepth++;
- this.expressionsPos <<= 2;
- }
- try {
- this.expressionsPos |= EXPRESSIONS_POS_ENTER_EQUALITY;
- binaryExpression.left.traverse(this, scope);
- this.scribe.printNextToken(operator, this.preferences.insert_space_before_binary_operator, Scribe.PRESERVE_EMPTY_LINES_IN_EQUALITY_EXPRESSION);
- if (this.preferences.insert_space_after_binary_operator) {
- this.scribe.space();
- }
- binaryExpression.right.traverse(this, scope);
- }
- finally {
- this.expressionsDepth--;
- this.expressionsPos >>= 2;
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(binaryExpression, numberOfParens);
- }
- return false;
- }
-
- private final TextEdit failedToFormat() {
- if (DEBUG) {
- System.out.println("COULD NOT FORMAT \n" + this.scribe.scanner); //$NON-NLS-1$
- System.out.println(this.scribe);
- }
- return null;
- }
-
- private void format(
- AbstractMethodDeclaration methodDeclaration,
- ClassScope scope,
- boolean isChunkStart,
- boolean isFirstClassBodyDeclaration) {
-
- if (isFirstClassBodyDeclaration) {
- int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
- if (newLinesBeforeFirstClassBodyDeclaration > 0) {
- this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
- }
- } else {
- final int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0;
- if (newLineBeforeChunk > 0) {
- this.scribe.printEmptyLines(newLineBeforeChunk);
- }
- }
- final int newLinesBeforeMethod = this.preferences.blank_lines_before_method;
- if (newLinesBeforeMethod > 0 && !isFirstClassBodyDeclaration) {
- this.scribe.printEmptyLines(newLinesBeforeMethod);
- } else if (this.scribe.line != 0 || this.scribe.column != 1) {
- this.scribe.printNewLine();
- }
- methodDeclaration.traverse(this, scope);
- }
-
- private void format(FieldDeclaration fieldDeclaration, ASTVisitor visitor, MethodScope scope, boolean isChunkStart, boolean isFirstClassBodyDeclaration) {
-
- if (isFirstClassBodyDeclaration) {
- int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
- if (newLinesBeforeFirstClassBodyDeclaration > 0) {
- this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
- }
- } else {
- int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0;
- if (newLineBeforeChunk > 0) {
- this.scribe.printEmptyLines(newLineBeforeChunk);
- }
- final int newLinesBeforeField = this.preferences.blank_lines_before_field;
- if (newLinesBeforeField > 0) {
- this.scribe.printEmptyLines(newLinesBeforeField);
- }
- }
- Alignment memberAlignment = this.scribe.getMemberAlignment();
-
- this.scribe.printComment();
- this.scribe.printModifiers(fieldDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_FIELD);
- this.scribe.space();
- /*
- * Field type
- */
- fieldDeclaration.type.traverse(this, scope);
-
- /*
- * Field name
- */
- this.scribe.alignFragment(memberAlignment, 0);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
-
- formatExtraDimensions(fieldDeclaration.type);
-
- /*
- * Field initialization
- */
- final Expression initialization = fieldDeclaration.initialization;
- if (initialization != null) {
- this.scribe.alignFragment(memberAlignment, 1);
- this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator);
- if (this.preferences.insert_space_after_assignment_operator) {
- this.scribe.space();
- }
- Alignment assignmentAlignment = this.scribe.createAlignment(
- Alignment.FIELD_DECLARATION_ASSIGNMENT,
- this.preferences.alignment_for_assignment,
- Alignment.R_INNERMOST,
- 1,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(assignmentAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(assignmentAlignment, 0);
- initialization.traverse(this, scope);
- ok = true;
- } catch(AlignmentException e){
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(assignmentAlignment, true);
- }
-
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
-
- if (memberAlignment != null) {
- this.scribe.alignFragment(memberAlignment, 2);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- } else {
- this.scribe.space();
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- }
-
- private void formatExtraDimensions(TypeReference typeReference) {
- /*
- * Check for extra dimensions
- */
- int extraDimensions = getDimensions();
- if (extraDimensions != 0) {
- int anchor = typeReference != null ? (typeReference.dimensions() - extraDimensions) : 0;
- formatDimensions(typeReference, anchor, extraDimensions);
- }
- }
-
- private void formatLeadingDimensions(TypeReference typeReference) {
- int leadingDimensions = Math.min(getDimensions(), typeReference != null ? typeReference.dimensions() : 0);
- if (leadingDimensions != 0) formatDimensions(typeReference, 0, leadingDimensions);
- }
-
- private void formatDimensions(TypeReference typeReference, int anchor, int count) {
- if (count != 0) {
- if (this.preferences.insert_space_before_opening_bracket_in_array_type_reference) {
- this.scribe.space();
- }
- Annotation[][] annotationsOnDimensions = typeReference != null ? typeReference.getAnnotationsOnDimensions(true) : null;
- for (int i = 0; i < count; i++) {
- int dimensionIndex = anchor + i;
- if (annotationsOnDimensions != null && annotationsOnDimensions.length > dimensionIndex) {
- boolean hadAnnotations = formatInlineAnnotations(annotationsOnDimensions[dimensionIndex], true);
- if (hadAnnotations && this.preferences.insert_space_before_opening_bracket_in_array_type_reference) this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameLBRACKET);
- if (this.preferences.insert_space_between_brackets_in_array_type_reference) {
- this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET);
- }
- }
- }
-
- private void format(ImportReference importRef, boolean isLast) {
- this.scribe.printNextToken(TerminalTokens.TokenNameimport);
- if (!isLast) this.scribe.blank_lines_between_import_groups = this.preferences.blank_lines_between_import_groups;
- this.scribe.space();
- if (importRef.isStatic()) {
- this.scribe.printNextToken(TerminalTokens.TokenNamestatic);
- this.scribe.space();
- }
- if ((importRef.bits & ASTNode.OnDemand) != 0) {
- this.scribe.printQualifiedReference(importRef.sourceEnd, false/*do not expect parenthesis*/);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- this.scribe.printNextToken(TerminalTokens.TokenNameMULTIPLY);
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- } else {
- this.scribe.printQualifiedReference(importRef.sourceEnd, false/*do not expect parenthesis*/);
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- }
- if (isLast) {
- this.scribe.blank_lines_between_import_groups = -1;
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.IMPORT_TRAILING_COMMENT);
- } else {
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.NO_TRAILING_COMMENT);
- this.scribe.blank_lines_between_import_groups = -1;
- }
- this.scribe.printNewLine();
- }
-
-
- private void format(MultiFieldDeclaration multiFieldDeclaration, ASTVisitor visitor, MethodScope scope, boolean isChunkStart, boolean isFirstClassBodyDeclaration) {
-
- if (isFirstClassBodyDeclaration) {
- int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
- if (newLinesBeforeFirstClassBodyDeclaration > 0) {
- this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
- }
- } else {
- int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0;
- if (newLineBeforeChunk > 0) {
- this.scribe.printEmptyLines(newLineBeforeChunk);
- }
- final int newLinesBeforeField = this.preferences.blank_lines_before_field;
- if (newLinesBeforeField > 0) {
- this.scribe.printEmptyLines(newLinesBeforeField);
- }
- }
- Alignment fieldAlignment = this.scribe.getMemberAlignment();
-
- this.scribe.printComment();
- this.scribe.printModifiers(multiFieldDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_FIELD);
- this.scribe.space();
-
- multiFieldDeclaration.declarations[0].type.traverse(this, scope);
-
- final int multipleFieldDeclarationsLength = multiFieldDeclaration.declarations.length;
-
- Alignment multiFieldDeclarationsAlignment =this.scribe.createAlignment(
- Alignment.MULTIPLE_FIELD,
- this.preferences.alignment_for_multiple_fields,
- multipleFieldDeclarationsLength - 1,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(multiFieldDeclarationsAlignment);
-
- boolean ok = false;
- do {
- try {
- for (int i = 0, length = multipleFieldDeclarationsLength; i < length; i++) {
- FieldDeclaration fieldDeclaration = multiFieldDeclaration.declarations[i];
- /*
- * Field name
- */
- if (i == 0) {
- this.scribe.alignFragment(fieldAlignment, 0);
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
- }
-
- formatExtraDimensions(fieldDeclaration.type);
-
- /*
- * Field initialization
- */
- final Expression initialization = fieldDeclaration.initialization;
- if (initialization != null) {
- if (i == 0) {
- this.scribe.alignFragment(fieldAlignment, 1);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator);
- if (this.preferences.insert_space_after_assignment_operator) {
- this.scribe.space();
- }
- initialization.traverse(this, scope);
- }
-
- if (i != length - 1) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_multiple_field_declarations);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.alignFragment(multiFieldDeclarationsAlignment, i);
-
- if (this.preferences.insert_space_after_comma_in_multiple_field_declarations) {
- this.scribe.space();
- }
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.alignFragment(fieldAlignment, 2);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(multiFieldDeclarationsAlignment, true);
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String)
- */
- public TextEdit format(String string, ASTNode[] nodes) {
- // reset the scribe
- this.scribe.reset();
-
- long startTime = 0;
- if (DEBUG) {
- startTime = System.currentTimeMillis();
- }
-
- final char[] compilationUnitSource = string.toCharArray();
-
- this.localScanner.setSource(compilationUnitSource);
- this.scribe.resetScanner(compilationUnitSource);
-
- if (nodes == null) {
- return null;
- }
-
- this.lastLocalDeclarationSourceStart = -1;
- try {
- formatClassBodyDeclarations(nodes);
- } catch(AbortFormatting e){
- return failedToFormat();
- }
- if (DEBUG){
- System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$
- }
- return this.scribe.getRootEdit();
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String)
- */
- public TextEdit format(String string, CompilationUnitDeclaration compilationUnitDeclaration) {
- // reset the scribe
- this.scribe.reset();
-
- if (compilationUnitDeclaration == null || compilationUnitDeclaration.ignoreFurtherInvestigation) {
- return failedToFormat();
- }
-
- long startTime = 0;
- if (DEBUG) {
- startTime = System.currentTimeMillis();
- }
-
- final char[] compilationUnitSource = string.toCharArray();
-
- this.localScanner.setSource(compilationUnitSource);
- this.scribe.resetScanner(compilationUnitSource);
-
- this.lastLocalDeclarationSourceStart = -1;
- try {
- compilationUnitDeclaration.traverse(this, compilationUnitDeclaration.scope);
- } catch(AbortFormatting e){
- return failedToFormat();
- }
- if (DEBUG){
- System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$
- }
- return this.scribe.getRootEdit();
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String)
- */
- public TextEdit format(String string, ConstructorDeclaration constructorDeclaration) {
- // reset the scribe
- this.scribe.reset();
-
- long startTime = 0;
- if (DEBUG) {
- startTime = System.currentTimeMillis();
- }
-
- final char[] compilationUnitSource = string.toCharArray();
-
- this.localScanner.setSource(compilationUnitSource);
- this.scribe.resetScanner(compilationUnitSource);
-
- if (constructorDeclaration == null) {
- return null;
- }
-
- this.lastLocalDeclarationSourceStart = -1;
- try {
- ExplicitConstructorCall explicitConstructorCall = constructorDeclaration.constructorCall;
- if (explicitConstructorCall != null && !explicitConstructorCall.isImplicitSuper()) {
- explicitConstructorCall.traverse(this, null);
- }
- Statement[] statements = constructorDeclaration.statements;
- if (statements != null) {
- formatStatements(null, statements, false);
- }
- if (hasComments()) {
- this.scribe.printNewLine();
- }
- this.scribe.printComment();
- } catch(AbortFormatting e){
- return failedToFormat();
- }
- if (DEBUG){
- System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$
- }
- return this.scribe.getRootEdit();
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter#format(int, String, int, int, int, String)
- */
- public TextEdit format(String string, Expression expression) {
- // reset the scribe
- this.scribe.reset();
-
- long startTime = 0;
- if (DEBUG) {
- startTime = System.currentTimeMillis();
- }
-
- final char[] compilationUnitSource = string.toCharArray();
-
- this.localScanner.setSource(compilationUnitSource);
- this.scribe.resetScanner(compilationUnitSource);
-
- if (expression == null) {
- return null;
- }
-
- this.lastLocalDeclarationSourceStart = -1;
- try {
- expression.traverse(this, (BlockScope) null);
- this.scribe.printComment();
- } catch(AbortFormatting e){
- return failedToFormat();
- }
- if (DEBUG){
- System.out.println("Formatting time: " + (System.currentTimeMillis() - startTime)); //$NON-NLS-1$
- }
- return this.scribe.getRootEdit();
- }
-
- /**
- * @param source the source of the comment to format
- */
- public void formatComment(int kind, String source, int start, int end, int indentationLevel) {
- if (source == null) return;
- this.scribe.printComment(kind, source, start, end, indentationLevel);
- }
-
- private void format(TypeDeclaration typeDeclaration){
- /*
- * Print comments to get proper line number
- */
- this.scribe.printComment();
- int line = this.scribe.line;
-
- this.scribe.printModifiers(typeDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_TYPE);
-
- if (this.scribe.line > line) {
- // annotations introduced new line, but this is not a line wrapping
- // see 158267
- line = this.scribe.line;
- }
-
- /*
- * Type name
- */
- switch(TypeDeclaration.kind(typeDeclaration.modifiers)) {
- case TypeDeclaration.CLASS_DECL :
- this.scribe.printNextToken(TerminalTokens.TokenNameclass, true);
- break;
- case TypeDeclaration.INTERFACE_DECL :
- this.scribe.printNextToken(TerminalTokens.TokenNameinterface, true);
- break;
- case TypeDeclaration.ENUM_DECL :
- this.scribe.printNextToken(TerminalTokens.TokenNameenum, true);
- break;
- case TypeDeclaration.ANNOTATION_TYPE_DECL :
- this.scribe.printNextToken(TerminalTokens.TokenNameAT, this.preferences.insert_space_before_at_in_annotation_type_declaration);
- this.scribe.printNextToken(TerminalTokens.TokenNameinterface, this.preferences.insert_space_after_at_in_annotation_type_declaration);
- break;
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
-
- TypeParameter[] typeParameters = typeDeclaration.typeParameters;
- if (typeParameters != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_parameters);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_parameters) {
- this.scribe.space();
- }
- int length = typeParameters.length;
- for (int i = 0; i < length - 1; i++) {
- typeParameters[i].traverse(this, typeDeclaration.scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_parameters);
- if (this.preferences.insert_space_after_comma_in_type_parameters) {
- this.scribe.space();
- }
- }
- typeParameters[length - 1].traverse(this, typeDeclaration.scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_parameters);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_parameters) {
- this.scribe.space();
- }
- }
- /*
- * Superclass
- */
- final TypeReference superclass = typeDeclaration.superclass;
- if (superclass != null) {
- Alignment superclassAlignment =this.scribe.createAlignment(
- Alignment.SUPER_CLASS,
- this.preferences.alignment_for_superclass_in_type_declaration,
- 2,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(superclassAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(superclassAlignment, 0);
- this.scribe.printNextToken(TerminalTokens.TokenNameextends, true);
- this.scribe.alignFragment(superclassAlignment, 1);
- this.scribe.space();
- superclass.traverse(this, typeDeclaration.scope);
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(superclassAlignment, true);
- }
-
- /*
- * Super Interfaces
- */
- final TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
- if (superInterfaces != null) {
- int alignment_for_superinterfaces;
- int kind = TypeDeclaration.kind(typeDeclaration.modifiers);
- switch(kind) {
- case TypeDeclaration.ENUM_DECL :
- alignment_for_superinterfaces = this.preferences.alignment_for_superinterfaces_in_enum_declaration;
- break;
- default:
- alignment_for_superinterfaces = this.preferences.alignment_for_superinterfaces_in_type_declaration;
- break;
- }
- int superInterfaceLength = superInterfaces.length;
- Alignment interfaceAlignment =this.scribe.createAlignment(
- Alignment.SUPER_INTERFACES,
- alignment_for_superinterfaces,
- superInterfaceLength+1, // implements token is first fragment
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(interfaceAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(interfaceAlignment, 0);
- if (kind == TypeDeclaration.INTERFACE_DECL) {
- this.scribe.printNextToken(TerminalTokens.TokenNameextends, true);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameimplements, true);
- }
- for (int i = 0; i < superInterfaceLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_superinterfaces);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.alignFragment(interfaceAlignment, i+1);
- if (this.preferences.insert_space_after_comma_in_superinterfaces) {
- this.scribe.space();
- }
- superInterfaces[i].traverse(this, typeDeclaration.scope);
- } else {
- this.scribe.alignFragment(interfaceAlignment, i+1);
- this.scribe.space();
- superInterfaces[i].traverse(this, typeDeclaration.scope);
- }
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(interfaceAlignment, true);
- }
-
- /*
- * Type body
- */
- String class_declaration_brace;
- boolean space_before_opening_brace;
- int kind = TypeDeclaration.kind(typeDeclaration.modifiers);
- switch(kind) {
- case TypeDeclaration.ENUM_DECL :
- class_declaration_brace = this.preferences.brace_position_for_enum_declaration;
- space_before_opening_brace = this.preferences.insert_space_before_opening_brace_in_enum_declaration;
- break;
- case TypeDeclaration.ANNOTATION_TYPE_DECL :
- class_declaration_brace = this.preferences.brace_position_for_annotation_type_declaration;
- space_before_opening_brace = this.preferences.insert_space_before_opening_brace_in_annotation_type_declaration;
- break;
- default:
- class_declaration_brace = this.preferences.brace_position_for_type_declaration;
- space_before_opening_brace = this.preferences.insert_space_before_opening_brace_in_type_declaration;
- break;
- }
- formatLeftCurlyBrace(line, class_declaration_brace);
- formatTypeOpeningBrace(class_declaration_brace, space_before_opening_brace, typeDeclaration);
-
- boolean indent_body_declarations_compare_to_header;
- switch(kind) {
- case TypeDeclaration.ENUM_DECL :
- indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_enum_declaration_header;
- break;
- case TypeDeclaration.ANNOTATION_TYPE_DECL :
- indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_annotation_declaration_header;
- break;
- default:
- indent_body_declarations_compare_to_header = this.preferences.indent_body_declarations_compare_to_type_header;
- break;
- }
- if (indent_body_declarations_compare_to_header) {
- this.scribe.indent();
- }
-
- if (kind == TypeDeclaration.ENUM_DECL) {
- FieldDeclaration[] fieldDeclarations = typeDeclaration.fields;
- boolean hasConstants = false;
- int length = fieldDeclarations != null ? fieldDeclarations.length : 0;
- int enumConstantsLength = 0;
- if (fieldDeclarations != null) {
- for (int i = 0; i < length; i++) {
- FieldDeclaration fieldDeclaration = fieldDeclarations[i];
- if (fieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
- enumConstantsLength++;
- } else {
- break;
- }
- }
- hasConstants = enumConstantsLength != 0;
- if (enumConstantsLength > 1) {
- Alignment enumConstantsAlignment = this.scribe.createAlignment(
- Alignment.ENUM_CONSTANTS,
- this.preferences.alignment_for_enum_constants,
- enumConstantsLength,
- this.scribe.scanner.currentPosition,
- 0, // we don't want to indent enum constants when splitting to a new line
- false);
- this.scribe.enterAlignment(enumConstantsAlignment);
- boolean ok = false;
- do {
- try {
- for (int i = 0; i < enumConstantsLength; i++) {
- this.scribe.alignFragment(enumConstantsAlignment, i);
- FieldDeclaration fieldDeclaration = fieldDeclarations[i];
- fieldDeclaration.traverse(this, typeDeclaration.initializerScope);
- if (isNextToken(TerminalTokens.TokenNameCOMMA)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_enum_declarations);
- if (this.preferences.insert_space_after_comma_in_enum_declarations) {
- this.scribe.space();
- }
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (fieldDeclaration.initialization instanceof QualifiedAllocationExpression) {
- this.scribe.printNewLine();
- }
- }
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(enumConstantsAlignment, true);
- } else if (hasConstants) {
- // only one enum constant
- FieldDeclaration fieldDeclaration = fieldDeclarations[0];
- fieldDeclaration.traverse(this, typeDeclaration.initializerScope);
- if (isNextToken(TerminalTokens.TokenNameCOMMA)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_enum_declarations);
- if (this.preferences.insert_space_after_comma_in_enum_declarations) {
- this.scribe.space();
- }
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (fieldDeclaration.initialization instanceof QualifiedAllocationExpression) {
- this.scribe.printNewLine();
- }
- }
- }
- }
- if (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (hasConstants
- || ((enumConstantsLength - length) != 0)
- || typeDeclaration.methods != null
- || typeDeclaration.memberTypes != null) {
- // make sure that empty enums don't get a new line
- this.scribe.printNewLine();
- }
- } else if (hasConstants) {
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- // only had a new line if there is at least one enum constant
- this.scribe.printNewLine();
- }
- }
-
- formatTypeMembers(typeDeclaration);
-
- if (indent_body_declarations_compare_to_header) {
- this.scribe.unIndent();
- }
-
- switch(kind) {
- case TypeDeclaration.ENUM_DECL :
- if (this.preferences.insert_new_line_in_empty_enum_declaration) {
- this.scribe.printNewLine();
- }
- break;
- case TypeDeclaration.ANNOTATION_TYPE_DECL :
- if (this.preferences.insert_new_line_in_empty_annotation_declaration) {
- this.scribe.printNewLine();
- }
- break;
- default :
- if (this.preferences.insert_new_line_in_empty_type_declaration) {
- this.scribe.printNewLine();
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (class_declaration_brace.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- if (hasComments()) {
- this.scribe.printNewLine();
- }
- }
-
- private void format(
- TypeDeclaration memberTypeDeclaration,
- ClassScope scope,
- boolean isChunkStart,
- boolean isFirstClassBodyDeclaration) {
-
- if (isFirstClassBodyDeclaration) {
- int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
- if (newLinesBeforeFirstClassBodyDeclaration > 0) {
- this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
- }
- } else {
- int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0;
- if (newLineBeforeChunk > 0) {
- this.scribe.printEmptyLines(newLineBeforeChunk);
- }
- final int newLinesBeforeMember = this.preferences.blank_lines_before_member_type;
- if (newLinesBeforeMember > 0) {
- this.scribe.printEmptyLines(newLinesBeforeMember);
- }
- }
- memberTypeDeclaration.traverse(this, scope);
- }
-
- private void formatAnonymousTypeDeclaration(TypeDeclaration typeDeclaration) {
- /*
- * Type body
- */
- String anonymous_type_declaration_brace_position = this.preferences.brace_position_for_anonymous_type_declaration;
-
- formatTypeOpeningBrace(anonymous_type_declaration_brace_position, this.preferences.insert_space_before_opening_brace_in_anonymous_type_declaration, typeDeclaration);
-
- this.scribe.indent();
-
- formatTypeMembers(typeDeclaration);
-
- this.scribe.unIndent();
- if (this.preferences.insert_new_line_in_empty_anonymous_type_declaration) {
- this.scribe.printNewLine();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
- if (anonymous_type_declaration_brace_position.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- }
-
- /**
- * @param block
- * @param scope
- * @param block_brace_position
- */
- private void formatBlock(Block block, BlockScope scope, String block_brace_position, boolean insertSpaceBeforeOpeningBrace) {
- formatOpeningBrace(block_brace_position, insertSpaceBeforeOpeningBrace);
- final Statement[] statements = block.statements;
- if (statements != null) {
- this.scribe.printNewLine();
- if (this.preferences.indent_statements_compare_to_block) {
- this.scribe.indent();
- }
- formatStatements(scope, statements, true);
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK);
-
- if (this.preferences.indent_statements_compare_to_block) {
- this.scribe.unIndent();
- }
- } else if (this.preferences.insert_new_line_in_empty_block) {
- this.scribe.printNewLine();
- if (this.preferences.indent_statements_compare_to_block) {
- this.scribe.indent();
- }
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK);
-
- if (this.preferences.indent_statements_compare_to_block) {
- this.scribe.unIndent();
- }
- } else {
- if (this.preferences.indent_statements_compare_to_block) {
- this.scribe.indent();
- }
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK);
-
- if (this.preferences.indent_statements_compare_to_block) {
- this.scribe.unIndent();
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(block_brace_position)) {
- this.scribe.unIndent();
- }
- }
-
- private void formatCascadingMessageSends(CascadingMethodInvocationFragmentBuilder builder, BlockScope scope) {
- int size = builder.size();
- MessageSend[] fragments = builder.fragments();
- Expression fragment = fragments[0].receiver;
- int startingPositionInCascade = 1;
- if (!fragment.isImplicitThis()) {
- fragment.traverse(this, scope);
- } else {
- MessageSend currentMessageSend = fragments[1];
- final int numberOfParens = (currentMessageSend.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(currentMessageSend, numberOfParens);
- }
- ASTNode[] arguments = currentMessageSend.arguments;
- TypeReference[] typeArguments = currentMessageSend.typeArguments;
- if (typeArguments != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_arguments);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- int length = typeArguments.length;
- for (int i = 0; i < length - 1; i++) {
- typeArguments[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_arguments);
- if (this.preferences.insert_space_after_comma_in_type_arguments) {
- this.scribe.space();
- }
- }
- typeArguments[length - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_arguments);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); // selector
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_method_invocation);
- if (arguments != null) {
- if (this.preferences.insert_space_after_opening_paren_in_method_invocation) {
- this.scribe.space();
- }
- int argumentLength = arguments.length;
- Alignment argumentsAlignment = this.scribe.createAlignment(
- Alignment.MESSAGE_ARGUMENTS,
- this.preferences.alignment_for_arguments_in_method_invocation,
- Alignment.R_OUTERMOST,
- argumentLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean okForArguments = false;
- do {
- try {
- for (int j = 0; j < argumentLength; j++) {
- if (j > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_method_invocation_arguments);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.alignFragment(argumentsAlignment, j);
- if (j > 0 && this.preferences.insert_space_after_comma_in_method_invocation_arguments) {
- this.scribe.space();
- }
- arguments[j].traverse(this, scope);
- }
- okForArguments = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!okForArguments);
- this.scribe.exitAlignment(argumentsAlignment, true);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_method_invocation);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_between_empty_parens_in_method_invocation);
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(currentMessageSend, numberOfParens);
- }
- startingPositionInCascade = 2;
- }
- int tieBreakRule = this.preferences.wrap_outer_expressions_when_nested && size-startingPositionInCascade > 2
- ? Alignment.R_OUTERMOST
- : Alignment.R_INNERMOST;
- Alignment cascadingMessageSendAlignment =
- this.scribe.createAlignment(
- Alignment.CASCADING_MESSAGE_SEND,
- this.preferences.alignment_for_selector_in_method_invocation,
- tieBreakRule,
- size,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(cascadingMessageSendAlignment);
- boolean ok = false;
- boolean setStartingColumn = true;
- switch (this.preferences.alignment_for_arguments_in_method_invocation & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_FIRST_BREAK_SPLIT:
- case Alignment.M_NEXT_SHIFTED_SPLIT:
- case Alignment.M_ONE_PER_LINE_SPLIT:
- setStartingColumn = false;
- break;
- }
- do {
- if (setStartingColumn) {
- cascadingMessageSendAlignment.startingColumn = this.scribe.column;
- }
- try {
- this.scribe.alignFragment(cascadingMessageSendAlignment, 0);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- for (int i = startingPositionInCascade; i < size; i++) {
- MessageSend currentMessageSend = fragments[i];
- final int numberOfParens = (currentMessageSend.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(currentMessageSend, numberOfParens);
- }
- TypeReference[] typeArguments = currentMessageSend.typeArguments;
- if (typeArguments != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_arguments);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- int length = typeArguments.length;
- for (int j = 0; j < length - 1; j++) {
- typeArguments[j].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_arguments);
- if (this.preferences.insert_space_after_comma_in_type_arguments) {
- this.scribe.space();
- }
- }
- typeArguments[length - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_arguments);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- }
- ASTNode[] arguments = currentMessageSend.arguments;
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); // selector
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_method_invocation);
- if (arguments != null) {
- if (this.preferences.insert_space_after_opening_paren_in_method_invocation) {
- this.scribe.space();
- }
- int argumentLength = arguments.length;
- int alignmentMode = this.preferences.alignment_for_arguments_in_method_invocation;
- Alignment argumentsAlignment = this.scribe.createAlignment(
- Alignment.MESSAGE_ARGUMENTS,
- alignmentMode,
- Alignment.R_OUTERMOST,
- argumentLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean okForArguments = false;
- do {
- switch (alignmentMode & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT:
- case Alignment.M_NEXT_PER_LINE_SPLIT:
- argumentsAlignment.startingColumn = this.scribe.column;
- break;
- }
- try {
- for (int j = 0; j < argumentLength; j++) {
- if (j > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_method_invocation_arguments);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.alignFragment(argumentsAlignment, j);
- if (j == 0) {
- int fragmentIndentation = argumentsAlignment.fragmentIndentations[j];
- if ((argumentsAlignment.mode & Alignment.M_INDENT_ON_COLUMN) != 0 && fragmentIndentation > 0) {
- this.scribe.indentationLevel = fragmentIndentation;
- }
- } else if (this.preferences.insert_space_after_comma_in_method_invocation_arguments) {
- this.scribe.space();
- }
- arguments[j].traverse(this, scope);
- argumentsAlignment.startingColumn = -1;
- }
- okForArguments = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!okForArguments);
- this.scribe.exitAlignment(argumentsAlignment, true);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_method_invocation);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_between_empty_parens_in_method_invocation);
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(currentMessageSend, numberOfParens);
- }
- cascadingMessageSendAlignment.startingColumn = -1;
- if (i < size - 1) {
- this.scribe.alignFragment(cascadingMessageSendAlignment, i);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- }
- }
- ok = true;
- } catch(AlignmentException e){
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(cascadingMessageSendAlignment, true);
- }
-
- /*
- * Merged traversal of member (types, fields, methods)
- */
- private void formatClassBodyDeclarations(ASTNode[] nodes) {
- final int FIELD = 1, METHOD = 2, TYPE = 3;
- this.scribe.lastNumberOfNewLines = 1;
- ASTNode[] mergedNodes = computeMergedMemberDeclarations(nodes);
- Alignment memberAlignment = this.scribe.createMemberAlignment(
- Alignment.TYPE_MEMBERS,
- this.preferences.align_type_members_on_columns ? Alignment.M_MULTICOLUMN : Alignment.M_NO_ALIGNMENT,
- 4,
- this.scribe.scanner.currentPosition);
- this.scribe.enterMemberAlignment(memberAlignment);
- boolean isChunkStart = false;
- boolean ok = false;
- int startIndex = 0;
- do {
- try {
- for (int i = startIndex, max = mergedNodes.length; i < max; i++) {
- ASTNode member = mergedNodes[i];
- if (member instanceof FieldDeclaration) {
- isChunkStart = memberAlignment.checkChunkStart(FIELD, i, this.scribe.scanner.currentPosition);
- if (member instanceof MultiFieldDeclaration){
- MultiFieldDeclaration multiField = (MultiFieldDeclaration) member;
- format(multiField, this, null, isChunkStart, i == 0);
- } else if (member instanceof Initializer) {
- int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0;
- if (newLineBeforeChunk > 0 && i != 0) {
- this.scribe.printEmptyLines(newLineBeforeChunk);
- } else if (i == 0) {
- int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
- if (newLinesBeforeFirstClassBodyDeclaration > 0) {
- this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
- }
- }
- Initializer initializer = (Initializer) member;
- initializer.traverse(this, null);
- } else {
- FieldDeclaration field = (FieldDeclaration) member;
- format(field, this, null, isChunkStart, i == 0);
- }
- } else if (member instanceof AbstractMethodDeclaration) {
- isChunkStart = memberAlignment.checkChunkStart(METHOD, i, this.scribe.scanner.currentPosition);
- format((AbstractMethodDeclaration) member, null, isChunkStart, i == 0);
- } else {
- isChunkStart = memberAlignment.checkChunkStart(TYPE, i, this.scribe.scanner.currentPosition);
- format((TypeDeclaration)member, null, isChunkStart, i == 0);
- }
- while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- if (i != max - 1) {
- this.scribe.printNewLine();
- }
- }
- ok = true;
- } catch(AlignmentException e){
- startIndex = memberAlignment.chunkStartIndex;
- this.scribe.redoMemberAlignment(e);
- }
- } while (!ok);
- this.scribe.exitMemberAlignment(memberAlignment);
- if (hasComments()) {
- this.scribe.printNewLine();
- }
- this.scribe.printComment();
- }
-
- private void formatEmptyTypeDeclaration(boolean isFirst) {
- boolean hasSemiColon = isNextToken(TerminalTokens.TokenNameSEMICOLON);
- while(isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
- this.scribe.printComment();
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- if (hasSemiColon && isFirst) {
- this.scribe.printNewLine();
- }
- }
-
- private void formatGuardClauseBlock(Block block, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, this.preferences.insert_space_before_opening_brace_in_block);
- this.scribe.space();
-
- final Statement[] statements = block.statements;
- statements[0].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, true);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
-
- private void formatLeftCurlyBrace(final int line, final String bracePosition) {
- /*
- * deal with (quite unexpected) comments right before lcurly
- */
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_IN_FORMAT_LEFT_CURLY_BRACE);
- if (DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP.equals(bracePosition)
- && (this.scribe.line > line || this.scribe.column >= this.preferences.page_width))
- {
- this.scribe.printNewLine();
- }
- }
-
- private void formatLocalDeclaration(LocalDeclaration localDeclaration, BlockScope scope, boolean insertSpaceBeforeComma, boolean insertSpaceAfterComma) {
-
- if (!isMultipleLocalDeclaration(localDeclaration)) {
- if (localDeclaration.modifiers != NO_MODIFIERS || localDeclaration.annotations != null) {
- this.scribe.printComment();
- this.scribe.printModifiers(localDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_LOCAL_VARIABLE);
- this.scribe.space();
- }
-
- /*
- * Argument type
- */
- if (localDeclaration.type != null) {
- localDeclaration.type.traverse(this, scope);
- }
- /*
- * Print the argument name
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
- } else {
- /*
- * Print the argument name
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
- }
- formatExtraDimensions(localDeclaration.type);
-
- final Expression initialization = localDeclaration.initialization;
- if (initialization != null) {
- /*
- * Print the method name
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator);
- if (this.preferences.insert_space_after_assignment_operator) {
- this.scribe.space();
- }
- Alignment assignmentAlignment = this.scribe.createAlignment(
- Alignment.LOCAL_DECLARATION_ASSIGNMENT,
- this.preferences.alignment_for_assignment,
- Alignment.R_OUTERMOST,
- 1,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(assignmentAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(assignmentAlignment, 0);
- initialization.traverse(this, scope);
- ok = true;
- } catch(AlignmentException e){
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(assignmentAlignment, true);
- }
-
- if (isPartOfMultipleLocalDeclaration()) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, insertSpaceBeforeComma);
- if (insertSpaceAfterComma) {
- this.scribe.space();
- }
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- }
-
- private void formatMessageSend(
- MessageSend messageSend,
- BlockScope scope,
- Alignment messageAlignment) {
-
- if (messageAlignment != null) {
- if (!this.preferences.wrap_outer_expressions_when_nested || messageAlignment.canAlign()) {
- this.scribe.alignFragment(messageAlignment, 0);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- }
- TypeReference[] typeArguments = messageSend.typeArguments;
- if (typeArguments != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_arguments);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- int length = typeArguments.length;
- for (int i = 0; i < length - 1; i++) {
- typeArguments[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_arguments);
- if (this.preferences.insert_space_after_comma_in_type_arguments) {
- this.scribe.space();
- }
- }
- typeArguments[length - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_arguments);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); // selector
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_method_invocation);
-
- final Expression[] arguments = messageSend.arguments;
- if (arguments != null) {
- if (this.preferences.insert_space_after_opening_paren_in_method_invocation) {
- this.scribe.space();
- }
- int argumentsLength = arguments.length;
- if (argumentsLength > 1) {
- int alignmentMode = this.preferences.alignment_for_arguments_in_method_invocation;
- Alignment argumentsAlignment = this.scribe.createAlignment(
- Alignment.MESSAGE_ARGUMENTS,
- alignmentMode,
- argumentsLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean ok = false;
- do {
- switch (alignmentMode & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT:
- case Alignment.M_NEXT_PER_LINE_SPLIT:
- argumentsAlignment.startingColumn = this.scribe.column;
- break;
- }
- try {
- for (int i = 0; i < argumentsLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_method_invocation_arguments);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (this.scribe.lastNumberOfNewLines == 1) {
- // a new line has been inserted while printing the comment
- // hence we need to use the break indentation level before printing next token...
- this.scribe.indentationLevel = argumentsAlignment.breakIndentationLevel;
- }
- }
- this.scribe.alignFragment(argumentsAlignment, i);
- if (i > 0 && this.preferences.insert_space_after_comma_in_method_invocation_arguments) {
- this.scribe.space();
- }
- int fragmentIndentation = 0;
- if (i == 0) {
- int wrappedIndex = argumentsAlignment.wrappedIndex();
- if (wrappedIndex >= 0) {
- fragmentIndentation = argumentsAlignment.fragmentIndentations[wrappedIndex];
- if ((argumentsAlignment.mode & Alignment.M_INDENT_ON_COLUMN) != 0 && fragmentIndentation > 0) {
- this.scribe.indentationLevel = fragmentIndentation;
- }
- }
- }
- arguments[i].traverse(this, scope);
- argumentsAlignment.startingColumn = -1;
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(argumentsAlignment, true);
- } else {
- arguments[0].traverse(this, scope);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_method_invocation);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_between_empty_parens_in_method_invocation);
- }
- }
-
- private void formatTryResources(
- TryStatement tryStatement,
- boolean spaceBeforeOpenParen,
- boolean spaceBeforeClosingParen,
- boolean spaceBeforeFirstResource,
- boolean spaceBeforeSemicolon,
- boolean spaceAfterSemicolon,
- int tryResourcesAligment) {
-
- LocalDeclaration[] resources = tryStatement.resources;
- int length = resources != null ? resources.length : 0;
- if (length > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, spaceBeforeOpenParen);
- if (spaceBeforeFirstResource) {
- this.scribe.space();
- }
- Alignment resourcesAlignment = this.scribe.createAlignment(
- Alignment.TRY_RESOURCES,
- tryResourcesAligment,
- // make sure alignment options for try with resources takes precedence
- Alignment.R_OUTERMOST,
- length,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(resourcesAlignment);
- boolean ok = false;
- do {
- switch (tryResourcesAligment & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT:
- case Alignment.M_NEXT_PER_LINE_SPLIT:
- resourcesAlignment.startingColumn = this.scribe.column;
- break;
- }
- try {
- for (int i = 0; i < length; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, spaceBeforeSemicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (this.scribe.lastNumberOfNewLines == 1) {
- // a new line has been inserted while printing the comment
- // hence we need to use the break indentation level before printing next token...
- this.scribe.indentationLevel = resourcesAlignment.breakIndentationLevel;
- }
- }
- this.scribe.alignFragment(resourcesAlignment, i);
- if (i == 0) {
- int fragmentIndentation = resourcesAlignment.fragmentIndentations[0];
- if ((resourcesAlignment.mode & Alignment.M_INDENT_ON_COLUMN) != 0 && fragmentIndentation > 0) {
- this.scribe.indentationLevel = fragmentIndentation;
- }
- } else if (spaceAfterSemicolon) {
- this.scribe.space();
- }
- resources[i].traverse(this, null);
- resourcesAlignment.startingColumn = -1;
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
-
- this.scribe.exitAlignment(resourcesAlignment, true);
- if (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
- // take care of trailing semicolon
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, spaceBeforeSemicolon);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, spaceBeforeClosingParen);
- }
- }
- private void formatMethodArguments(
- AbstractMethodDeclaration methodDeclaration,
- boolean spaceBeforeOpenParen,
- boolean spaceBetweenEmptyParameters,
- boolean spaceBeforeClosingParen,
- boolean spaceBeforeFirstParameter,
- boolean spaceBeforeComma,
- boolean spaceAfterComma,
- int methodDeclarationParametersAlignment) {
- formatMethodArguments(
- methodDeclaration.receiver,
- methodDeclaration.arguments,
- methodDeclaration.scope,
- spaceBeforeOpenParen,
- spaceBetweenEmptyParameters,
- spaceBeforeClosingParen,
- spaceBeforeFirstParameter,
- spaceBeforeComma,
- spaceAfterComma,
- methodDeclarationParametersAlignment);
- }
- private void formatMethodArguments(
- Receiver receiver,
- final Argument[] arguments,
- MethodScope scope,
- boolean spaceBeforeOpenParen,
- boolean spaceBetweenEmptyParameters,
- boolean spaceBeforeClosingParen,
- boolean spaceBeforeFirstParameter,
- boolean spaceBeforeComma,
- boolean spaceAfterComma,
- int methodDeclarationParametersAlignment) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, spaceBeforeOpenParen);
-
- if (arguments != null || receiver != null) {
- if (spaceBeforeFirstParameter) {
- this.scribe.space();
- }
- int receiverCount = receiver != null ? 1 : 0;
- int realArgumentLength = arguments != null ? arguments.length : 0;
- int argumentLength = realArgumentLength + receiverCount;
- Alignment argumentsAlignment = this.scribe.createAlignment(
- Alignment.METHOD_ARGUMENTS,
- methodDeclarationParametersAlignment,
- argumentLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean ok = false;
- do {
- switch (methodDeclarationParametersAlignment & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT:
- case Alignment.M_NEXT_PER_LINE_SPLIT:
- argumentsAlignment.startingColumn = this.scribe.column;
- break;
- }
- try {
- for (int i = 0; i < argumentLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, spaceBeforeComma);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (this.scribe.lastNumberOfNewLines == 1) {
- // a new line has been inserted while printing the comment
- // hence we need to use the break indentation level before printing next token...
- this.scribe.indentationLevel = argumentsAlignment.breakIndentationLevel;
- }
- }
- this.scribe.alignFragment(argumentsAlignment, i);
- if (i == 0) {
- int fragmentIndentation = argumentsAlignment.fragmentIndentations[0];
- if ((argumentsAlignment.mode & Alignment.M_INDENT_ON_COLUMN) != 0 && fragmentIndentation > 0) {
- this.scribe.indentationLevel = fragmentIndentation;
- }
- } else if (spaceAfterComma) {
- this.scribe.space();
- }
- if (i < receiverCount) {
- receiver.traverse(this, scope);
- } else {
- arguments[i - receiverCount].traverse(this, scope);
- }
- argumentsAlignment.startingColumn = -1;
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(argumentsAlignment, true);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, spaceBeforeClosingParen);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, spaceBetweenEmptyParameters);
- }
- }
-
- private void formatEnumConstantArguments(
- FieldDeclaration enumConstant,
- boolean spaceBeforeOpenParen,
- boolean spaceBetweenEmptyParameters,
- boolean spaceBeforeClosingParen,
- boolean spaceBeforeFirstParameter,
- boolean spaceBeforeComma,
- boolean spaceAfterComma,
- int methodDeclarationParametersAlignment) {
-
- if (!isNextToken(TerminalTokens.TokenNameLPAREN)) {
- return;
- }
-
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, spaceBeforeOpenParen);
- final Expression[] arguments = ((AllocationExpression) enumConstant.initialization).arguments;
- if (arguments != null) {
- int argumentLength = arguments.length;
- Alignment argumentsAlignment = this.scribe.createAlignment(
- Alignment.ENUM_CONSTANTS_ARGUMENTS,
- methodDeclarationParametersAlignment,
- argumentLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean ok = false;
- do {
- try {
- if (spaceBeforeFirstParameter) {
- this.scribe.space();
- }
- for (int i = 0; i < argumentLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, spaceBeforeComma);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.alignFragment(argumentsAlignment, i);
- if (i > 0 && spaceAfterComma) {
- this.scribe.space();
- }
- arguments[i].traverse(this, (BlockScope) null);
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(argumentsAlignment, true);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, spaceBeforeClosingParen);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, spaceBetweenEmptyParameters);
- }
- }
-
- private void formatNecessaryEmptyStatement() {
- if (this.preferences.put_empty_statement_on_new_line) {
- this.scribe.printNewLine();
- this.scribe.indent();
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.unIndent();
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- }
-
- private void formatOpeningBrace(String bracePosition, boolean insertSpaceBeforeBrace) {
-
- if (DefaultCodeFormatterConstants.NEXT_LINE.equals(bracePosition)) {
- this.scribe.printNewLine();
- } else if (DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED.equals(bracePosition)) {
- this.scribe.printNewLine();
- this.scribe.indent();
- } else if (DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP.equals(bracePosition)
- && this.scribe.column >= this.preferences.page_width) {
- this.scribe.printNewLine();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, insertSpaceBeforeBrace, Scribe.PRESERVE_EMPTY_LINES_IN_FORMAT_OPENING_BRACE);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.UNMODIFIABLE_TRAILING_COMMENT);
- }
- private void formatStatements(BlockScope scope, final Statement[] statements, boolean insertNewLineAfterLastStatement) {
- int statementsLength = statements.length;
- for (int i = 0; i < statementsLength; i++) {
- final Statement statement = statements[i];
- if (i > 0 && (statements[i - 1] instanceof EmptyStatement) && !(statement instanceof EmptyStatement)) {
- this.scribe.printNewLine();
- }
- statement.traverse(this, scope);
- if (statement instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (i != statementsLength - 1) {
- if (!(statement instanceof EmptyStatement) && !(statements[i + 1] instanceof EmptyStatement)) {
- this.scribe.printNewLine();
- }
- } else if (i == statementsLength - 1 && insertNewLineAfterLastStatement) {
- this.scribe.printNewLine();
- }
- } else if (statement instanceof LocalDeclaration) {
- LocalDeclaration currentLocal = (LocalDeclaration) statement;
- if (i < (statementsLength - 1)) {
- /*
- * We need to check that the next statement is a local declaration
- */
- if (statements[i + 1] instanceof LocalDeclaration) {
- LocalDeclaration nextLocal = (LocalDeclaration) statements[i + 1];
- if (currentLocal.declarationSourceStart != nextLocal.declarationSourceStart) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (i != statementsLength - 1) {
- if (!(statement instanceof EmptyStatement) && !(statements[i + 1] instanceof EmptyStatement)) {
- this.scribe.printNewLine();
- }
- } else if (i == statementsLength - 1 && insertNewLineAfterLastStatement) {
- this.scribe.printNewLine();
- }
- }
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (i != statementsLength - 1) {
- if (!(statement instanceof EmptyStatement) && !(statements[i + 1] instanceof EmptyStatement)) {
- this.scribe.printNewLine();
- }
- } else if (i == statementsLength - 1 && insertNewLineAfterLastStatement) {
- this.scribe.printNewLine();
- }
- }
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (i != statementsLength - 1) {
- if (!(statement instanceof EmptyStatement) && !(statements[i + 1] instanceof EmptyStatement)) {
- this.scribe.printNewLine();
- }
- } else if (i == statementsLength - 1 && insertNewLineAfterLastStatement) {
- this.scribe.printNewLine();
- }
- }
- } else if (i != statementsLength - 1) {
- if (!(statement instanceof EmptyStatement) && !(statements[i + 1] instanceof EmptyStatement)) {
- this.scribe.printNewLine();
- }
- } else if (i == statementsLength - 1 && insertNewLineAfterLastStatement) {
- this.scribe.printNewLine();
- }
- }
- }
-
- private void formatThrowsClause(
- AbstractMethodDeclaration methodDeclaration,
- boolean spaceBeforeComma,
- boolean spaceAfterComma,
- int alignmentForThrowsClause) {
-
- final TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions;
- if (thrownExceptions != null) {
- int thrownExceptionsLength = thrownExceptions.length;
- Alignment throwsAlignment = this.scribe.createAlignment(
- Alignment.THROWS,
- alignmentForThrowsClause,
- thrownExceptionsLength, // throws is the first token
- this.scribe.scanner.currentPosition);
-
- this.scribe.enterAlignment(throwsAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(throwsAlignment, 0);
- this.scribe.printNextToken(TerminalTokens.TokenNamethrows, true);
-
- for (int i = 0; i < thrownExceptionsLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, spaceBeforeComma);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.alignFragment(throwsAlignment, i);
- if (spaceAfterComma) {
- this.scribe.space();
- }
- } else {
- this.scribe.space();
- }
- thrownExceptions[i].traverse(this, methodDeclaration.scope);
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(throwsAlignment, true);
- }
- }
-
- /*
- * Merged traversal of member (types, fields, methods)
- */
- private void formatTypeMembers(TypeDeclaration typeDeclaration) {
- Alignment memberAlignment = this.scribe.createMemberAlignment(
- Alignment.TYPE_MEMBERS,
- this.preferences.align_type_members_on_columns ? Alignment.M_MULTICOLUMN : Alignment.M_NO_ALIGNMENT,
- 3,
- this.scribe.scanner.currentPosition);
- this.scribe.enterMemberAlignment(memberAlignment);
- ASTNode[] members = computeMergedMemberDeclarations(typeDeclaration);
- boolean isChunkStart = false;
- boolean ok = false;
- int membersLength = members.length;
- if (membersLength > 0) {
- int startIndex = 0;
- do {
- try {
- for (int i = startIndex, max = members.length; i < max; i++) {
- while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.printNewLine();
- ASTNode member = members[i];
- if (member instanceof FieldDeclaration) {
- isChunkStart = memberAlignment.checkChunkStart(Alignment.CHUNK_FIELD, i, this.scribe.scanner.currentPosition);
- if (member instanceof MultiFieldDeclaration) {
- MultiFieldDeclaration multiField = (MultiFieldDeclaration) member;
-
- if (multiField.isStatic()) {
- format(multiField, this, typeDeclaration.staticInitializerScope, isChunkStart, i == 0);
- } else {
- format(multiField, this, typeDeclaration.initializerScope, isChunkStart, i == 0);
- }
- } else if (member instanceof Initializer) {
- int newLineBeforeChunk = isChunkStart ? this.preferences.blank_lines_before_new_chunk : 0;
- if (newLineBeforeChunk > 0 && i != 0) {
- this.scribe.printEmptyLines(newLineBeforeChunk);
- } else if (i == 0) {
- int newLinesBeforeFirstClassBodyDeclaration = this.preferences.blank_lines_before_first_class_body_declaration;
- if (newLinesBeforeFirstClassBodyDeclaration > 0) {
- this.scribe.printEmptyLines(newLinesBeforeFirstClassBodyDeclaration);
- }
- }
- Initializer initializer = (Initializer) member;
- if (initializer.isStatic()) {
- initializer.traverse(this, typeDeclaration.staticInitializerScope);
- } else {
- initializer.traverse(this, typeDeclaration.initializerScope);
- }
- } else {
- FieldDeclaration field = (FieldDeclaration) member;
- if (field.isStatic()) {
- format(field, this, typeDeclaration.staticInitializerScope, isChunkStart, i == 0);
- } else {
- format(field, this, typeDeclaration.initializerScope, isChunkStart, i == 0);
- }
- }
- } else if (member instanceof AbstractMethodDeclaration) {
- isChunkStart = memberAlignment.checkChunkStart(Alignment.CHUNK_METHOD, i, this.scribe.scanner.currentPosition);
- format((AbstractMethodDeclaration) member, typeDeclaration.scope, isChunkStart, i == 0);
- } else if (member instanceof TypeDeclaration) {
- isChunkStart = memberAlignment.checkChunkStart(Alignment.CHUNK_TYPE, i, this.scribe.scanner.currentPosition);
- format((TypeDeclaration)member, typeDeclaration.scope, isChunkStart, i == 0);
- }
- while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.printNewLine();
- // realign to the proper value
- if (this.scribe.memberAlignment != null) {
- // select the last alignment
- this.scribe.indentationLevel = this.scribe.memberAlignment.originalIndentationLevel;
- }
- }
- ok = true;
- } catch(AlignmentException e){
- startIndex = memberAlignment.chunkStartIndex;
- this.scribe.redoMemberAlignment(e);
- }
- } while (!ok);
- } else if (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
- // the only body declaration is an empty declaration (';')
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.printComment(Scribe.DO_NOT_PRESERVE_EMPTY_LINES);
- this.scribe.exitMemberAlignment(memberAlignment);
- }
-
- private void formatTypeOpeningBraceForEnumConstant(String bracePosition, boolean insertSpaceBeforeBrace, TypeDeclaration typeDeclaration) {
- int fieldCount = (typeDeclaration.fields == null) ? 0 : typeDeclaration.fields.length;
- int methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
- int typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;
-
- if (methodCount <= 2) {
- for (int i = 0, max = methodCount; i < max; i++) {
- final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration.methods[i];
- if (abstractMethodDeclaration.isDefaultConstructor()) {
- methodCount--;
- } else if (abstractMethodDeclaration.isClinit()) {
- methodCount--;
- }
- }
- }
- final int memberLength = fieldCount + methodCount+typeCount;
-
- boolean insertNewLine = memberLength > 0;
-
- if (!insertNewLine) {
- if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
- insertNewLine = this.preferences.insert_new_line_in_empty_enum_constant;
- }
- }
-
- formatOpeningBrace(bracePosition, insertSpaceBeforeBrace);
-
- if (insertNewLine) {
- this.scribe.printNewLine();
- }
- }
- private void formatTypeOpeningBrace(String bracePosition, boolean insertSpaceBeforeBrace, TypeDeclaration typeDeclaration) {
- int fieldCount = (typeDeclaration.fields == null) ? 0 : typeDeclaration.fields.length;
- int methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
- int typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;
-
- if (methodCount <= 2) {
- for (int i = 0, max = methodCount; i < max; i++) {
- final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration.methods[i];
- if (abstractMethodDeclaration.isDefaultConstructor()) {
- methodCount--;
- } else if (abstractMethodDeclaration.isClinit()) {
- methodCount--;
- }
- }
- }
- final int memberLength = fieldCount + methodCount + typeCount;
-
- boolean insertNewLine = memberLength > 0;
-
- if (!insertNewLine) {
- if (TypeDeclaration.kind(typeDeclaration.modifiers) == TypeDeclaration.ENUM_DECL) {
- insertNewLine = this.preferences.insert_new_line_in_empty_enum_declaration;
- } else if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
- insertNewLine = this.preferences.insert_new_line_in_empty_anonymous_type_declaration;
- } else if (TypeDeclaration.kind(typeDeclaration.modifiers) == TypeDeclaration.ANNOTATION_TYPE_DECL) {
- insertNewLine = this.preferences.insert_new_line_in_empty_annotation_declaration;
- } else {
- insertNewLine = this.preferences.insert_new_line_in_empty_type_declaration;
- }
- }
-
- formatOpeningBrace(bracePosition, insertSpaceBeforeBrace);
-
- if (insertNewLine) {
- this.scribe.printNewLine();
- }
- }
- private int getDimensions() {
-
- this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
- int dimensions = 0;
- int balance = 0;
- try {
- int token;
- loop: while ((token = this.localScanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- switch(token) {
- case TerminalTokens.TokenNameRBRACKET:
- dimensions++;
- balance--;
- break;
- case TerminalTokens.TokenNameAT :
- skipPastTypeAnnotations();
- break;
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- break;
- case TerminalTokens.TokenNameLBRACKET :
- balance++;
- break;
- default:
- break loop;
- }
- }
- } catch(InvalidInputException e) {
- // ignore
- }
- if (balance == 0) {
- return dimensions;
- }
- return 0;
- }
-
- private void skipPastTypeAnnotations() { // we get here having seen @
- int balance = 0;
- int currentTokenStartPosition = this.localScanner.currentPosition;
- try {
- loop: while (true) {
- currentTokenStartPosition = this.localScanner.currentPosition;
- int token = this.localScanner.getNextToken();
- switch(token) {
- case TerminalTokens.TokenNameEOF:
- break loop;
- case TerminalTokens.TokenNameIdentifier :
- case TerminalTokens.TokenNameDOT :
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- break;
- case TerminalTokens.TokenNameLPAREN:
- balance++;
- break;
- case TerminalTokens.TokenNameRPAREN:
- --balance;
- break;
- default:
- if (balance <= 0)
- break loop;
- }
- }
- } catch(InvalidInputException e) {
- // ignore
- } finally {
- this.localScanner.resetTo(currentTokenStartPosition, this.scribe.scannerEndPosition - 1);
- }
- }
-
- private boolean hasComments() {
-
- this.localScanner.resetTo(this.scribe.scanner.startPosition, this.scribe.scannerEndPosition - 1);
- try {
- switch(this.localScanner.getNextToken()) {
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- return true;
- }
- } catch(InvalidInputException e) {
- // ignore
- }
- return false;
- }
-
- private boolean hasNonAnnotationModifiers() {
- this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
- try {
- int token;
- while ((token = this.localScanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- switch(token) {
- case TerminalTokens.TokenNamedefault :
- case TerminalTokens.TokenNamepublic :
- case TerminalTokens.TokenNameprotected :
- case TerminalTokens.TokenNameprivate :
- case TerminalTokens.TokenNamestatic :
- case TerminalTokens.TokenNameabstract :
- case TerminalTokens.TokenNamefinal :
- case TerminalTokens.TokenNamenative :
- case TerminalTokens.TokenNamesynchronized :
- case TerminalTokens.TokenNametransient :
- case TerminalTokens.TokenNamevolatile :
- case TerminalTokens.TokenNamestrictfp :
- return true;
- case TerminalTokens.TokenNameAT :
- skipPastTypeAnnotations();
- break;
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- break;
- default:
- return false;
- }
- }
- } catch(InvalidInputException e) {
- // ignore
- }
- return false;
- }
-
- private boolean isNextToken(int tokenName) {
- this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
- try {
- int token = this.localScanner.getNextToken();
- loop: while(true) {
- switch(token) {
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- token = this.localScanner.getNextToken();
- continue loop;
- default:
- break loop;
- }
- }
- return token == tokenName;
- } catch(InvalidInputException e) {
- // ignore
- }
- return false;
- }
-
- private boolean isNextTokenPunctuation() {
- this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
- try {
- int token = this.localScanner.getNextToken();
- return !(Scanner.isLiteral(token) || Scanner.isKeyword(token) || Scanner.isIdentifier(token));
- } catch(InvalidInputException e) {
- // ignore
- }
- return false;
- }
-
- private boolean isClosingGenericToken() {
- this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
- try {
- int token = this.localScanner.getNextToken();
- loop: while(true) {
- switch(token) {
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- token = this.localScanner.getNextToken();
- continue loop;
- default:
- break loop;
- }
- }
- switch(token) {
- case TerminalTokens.TokenNameGREATER :
- case TerminalTokens.TokenNameRIGHT_SHIFT :
- case TerminalTokens.TokenNameUNSIGNED_RIGHT_SHIFT :
- return true;
- }
- } catch(InvalidInputException e) {
- // ignore
- }
- return false;
- }
-
- private boolean isGuardClause(Block block) {
- return !commentStartsBlock(block.sourceStart, block.sourceEnd)
- && block.statements != null
- && block.statements.length == 1
- && (block.statements[0] instanceof ReturnStatement || block.statements[0] instanceof ThrowStatement);
- }
-
- private boolean isMultipleLocalDeclaration(LocalDeclaration localDeclaration) {
-
- if (localDeclaration.declarationSourceStart == this.lastLocalDeclarationSourceStart) return true;
- this.lastLocalDeclarationSourceStart = localDeclaration.declarationSourceStart;
- return false;
- }
-
- private boolean isPartOfMultipleLocalDeclaration() {
- this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1);
- try {
- int token;
- while ((token = this.localScanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- switch(token) {
- case TerminalTokens.TokenNameCOMMA ://90
- return true;
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- break;
- default:
- return false;
- }
- }
- } catch(InvalidInputException e) {
- // ignore
- }
- return false;
- }
-
- private void manageClosingParenthesizedExpression(Expression expression, int numberOfParens) {
- for (int i = 0; i < numberOfParens; i++) {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_parenthesized_expression);
- }
- }
-
- private void manageOpeningParenthesizedExpression(Expression expression, int numberOfParens) {
- for (int i = 0; i < numberOfParens; i++) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_parenthesized_expression);
- if (this.preferences.insert_space_after_opening_paren_in_parenthesized_expression) {
- this.scribe.space();
- }
- }
- }
-
- private void printComment() {
- this.localScanner.resetTo(this.scribe.scanner.startPosition, this.scribe.scannerEndPosition - 1);
- try {
- int token = this.localScanner.getNextToken();
- switch(token) {
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_LINE :
- this.scribe.printComment(token, Scribe.NO_TRAILING_COMMENT);
- break;
- }
- } catch(InvalidInputException e) {
- // ignore
- }
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.AllocationExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- AllocationExpression allocationExpression,
- BlockScope scope) {
- // 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt
-
- final int numberOfParens = (allocationExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(allocationExpression, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamenew);
- TypeReference[] typeArguments = allocationExpression.typeArguments;
- if (typeArguments != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_arguments);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- int length = typeArguments.length;
- for (int i = 0; i < length - 1; i++) {
- typeArguments[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_arguments);
- if (this.preferences.insert_space_after_comma_in_type_arguments) {
- this.scribe.space();
- }
- }
- typeArguments[length - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_arguments);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- } else {
- this.scribe.space();
- }
-
- allocationExpression.type.traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_method_invocation);
-
- final Expression[] arguments = allocationExpression.arguments;
- if (arguments != null) {
- if (this.preferences.insert_space_after_opening_paren_in_method_invocation) {
- this.scribe.space();
- }
- int argumentLength = arguments.length;
- Alignment argumentsAlignment =this.scribe.createAlignment(
- Alignment.ALLOCATION,
- this.preferences.alignment_for_arguments_in_allocation_expression,
- argumentLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean ok = false;
- do {
- try {
- for (int i = 0; i < argumentLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_allocation_expression);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.alignFragment(argumentsAlignment, i);
- if (i > 0 && this.preferences.insert_space_after_comma_in_allocation_expression) {
- this.scribe.space();
- }
- arguments[i].traverse(this, scope);
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(argumentsAlignment, true);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_method_invocation);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_between_empty_parens_in_method_invocation);
- }
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(allocationExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.AND_AND_Expression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- AND_AND_Expression and_and_Expression,
- BlockScope scope) {
-
- return dumpBinaryExpression(and_and_Expression, TerminalTokens.TokenNameAND_AND, scope);
- }
- public boolean visit(
- AnnotationMethodDeclaration annotationTypeMemberDeclaration,
- ClassScope scope) {
- /*
- * Print comments to get proper line number
- */
- this.scribe.printComment();
- this.scribe.printModifiers(annotationTypeMemberDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_METHOD);
- this.scribe.space();
- /*
- * Print the method return type
- */
- final TypeReference returnType = annotationTypeMemberDeclaration.returnType;
- final MethodScope annotationTypeMemberDeclarationScope = annotationTypeMemberDeclaration.scope;
-
- if (returnType != null) {
- returnType.traverse(this, annotationTypeMemberDeclarationScope);
- }
- /*
- * Print the method name
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_annotation_type_member_declaration);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_between_empty_parens_in_annotation_type_member_declaration);
-
- /*
- * Check for extra dimensions
- */
- int extraDimensions = annotationTypeMemberDeclaration.extendedDimensions;
- if (extraDimensions != 0) {
- if (this.preferences.insert_space_before_opening_bracket_in_array_type_reference) {
- this.scribe.space();
- }
- for (int i = 0; i < extraDimensions; i++) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLBRACKET);
- if (this.preferences.insert_space_between_brackets_in_array_type_reference) {
- this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET);
- }
- }
-
- Expression defaultValue = annotationTypeMemberDeclaration.defaultValue;
- if (defaultValue != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNamedefault, true);
- this.scribe.space();
- defaultValue.traverse(this, (BlockScope) null);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(Argument argument, BlockScope scope) {
-
- if (argument.modifiers != NO_MODIFIERS || argument.annotations != null) {
- this.scribe.printComment();
- this.scribe.printModifiers(argument.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_PARAMETER, !hasNonAnnotationModifiers());
- this.scribe.space();
- }
-
- /*
- * Argument type
- */
- TypeReference argumentType = argument.type;
- if (argumentType != null) {
- if (argumentType instanceof UnionTypeReference) {
- formatMultiCatchArguments(
- argument,
- this.preferences.insert_space_before_binary_operator,
- this.preferences.insert_space_after_binary_operator,
- this.preferences.alignment_for_union_type_in_multicatch,
- scope);
- } else {
- argumentType.traverse(this, scope);
- }
- }
-
- if (argument.isVarArgs()) {
- Annotation [][] annotationsOnDimensions = argumentType.getAnnotationsOnDimensions(true);
- if (annotationsOnDimensions != null) {
- Annotation [] varargAnnotations = annotationsOnDimensions[annotationsOnDimensions.length - 1];
- if (varargAnnotations != null) {
- formatInlineAnnotations(varargAnnotations, true);
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameELLIPSIS, this.preferences.insert_space_before_ellipsis);
- if (this.preferences.insert_space_after_ellipsis) {
- this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
- } else {
- if (argument.isReceiver()) {
- this.scribe.space();
- NameReference qualifyingName = ((Receiver) argument).qualifyingName;
- if (qualifyingName != null) {
- qualifyingName.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT, false);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamethis, false);
- } else {
- /*
- * Print the argument name
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, argument.type != null);
- }
- }
-
- formatExtraDimensions(argumentType);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- ArrayAllocationExpression arrayAllocationExpression,
- BlockScope scope) {
-
- final int numberOfParens = (arrayAllocationExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(arrayAllocationExpression, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamenew);
- this.scribe.space();
- arrayAllocationExpression.type.traverse(this, scope);
-
- final Expression[] dimensions = arrayAllocationExpression.dimensions;
- int dimensionsLength = dimensions.length;
- for (int i = 0; i < dimensionsLength; i++) {
- if (arrayAllocationExpression.annotationsOnDimensions != null) {
- formatInlineAnnotations(arrayAllocationExpression.annotationsOnDimensions[i], true);
- }
- if (this.preferences.insert_space_before_opening_bracket_in_array_allocation_expression) {
- this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameLBRACKET, false);
- if (dimensions[i] != null) {
- if (this.preferences.insert_space_after_opening_bracket_in_array_allocation_expression) {
- this.scribe.space();
- }
- dimensions[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET, this.preferences.insert_space_before_closing_bracket_in_array_allocation_expression);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET, this.preferences.insert_space_between_empty_brackets_in_array_allocation_expression);
- }
- }
- final ArrayInitializer initializer = arrayAllocationExpression.initializer;
- if (initializer != null) {
- initializer.traverse(this, scope);
- }
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(arrayAllocationExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayInitializer, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
- final int numberOfParens = (arrayInitializer.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(arrayInitializer, numberOfParens);
- }
-
- if (this.arrayInitializersDepth < 0) {
- this.arrayInitializersDepth = 0;
- } else {
- this.arrayInitializersDepth++;
- }
- int arrayInitializerIndentationLevel = this.scribe.indentationLevel;
- try {
- final Expression[] expressions = arrayInitializer.expressions;
- if (expressions != null) {
- String array_initializer_brace_position = this.preferences.brace_position_for_array_initializer;
- formatOpeningBrace(array_initializer_brace_position, this.preferences.insert_space_before_opening_brace_in_array_initializer);
-
- int expressionsLength = expressions.length;
- final boolean insert_new_line_after_opening_brace = this.preferences.insert_new_line_after_opening_brace_in_array_initializer;
- boolean ok = false;
- Alignment arrayInitializerAlignment = null;
- if (expressionsLength > 1) {
- if (insert_new_line_after_opening_brace) {
- this.scribe.printNewLine();
- }
- arrayInitializerAlignment = this.scribe.createAlignment(
- Alignment.ARRAY_INITIALIZER,
- this.preferences.alignment_for_expressions_in_array_initializer,
- Alignment.R_OUTERMOST,
- expressionsLength,
- this.scribe.scanner.currentPosition,
- this.preferences.continuation_indentation_for_array_initializer,
- true);
-
- if (insert_new_line_after_opening_brace) {
- arrayInitializerAlignment.fragmentIndentations[0] = arrayInitializerAlignment.breakIndentationLevel;
- }
-
- this.scribe.enterAlignment(arrayInitializerAlignment);
- do {
- try {
- this.scribe.alignFragment(arrayInitializerAlignment, 0);
- if (this.preferences.insert_space_after_opening_brace_in_array_initializer) {
- this.scribe.space();
- }
- expressions[0].traverse(this, scope);
- for (int i = 1; i < expressionsLength; i++) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_array_initializer);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.alignFragment(arrayInitializerAlignment, i);
- if (this.preferences.insert_space_after_comma_in_array_initializer) {
- this.scribe.space();
- }
- expressions[i].traverse(this, scope);
- if (i == expressionsLength - 1) {
- if (isNextToken(TerminalTokens.TokenNameCOMMA)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_array_initializer);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- }
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(arrayInitializerAlignment, true);
- } else {
- // Use an alignment with no break in case when the array initializer
- // is not inside method arguments alignments
- if (this.scribe.currentAlignment == null || this.scribe.currentAlignment.kind != Alignment.MESSAGE_ARGUMENTS) {
- arrayInitializerAlignment = this.scribe.createAlignment(
- Alignment.ARRAY_INITIALIZER,
- this.preferences.alignment_for_expressions_in_array_initializer,
- Alignment.R_OUTERMOST,
- 0,
- this.scribe.scanner.currentPosition,
- this.preferences.continuation_indentation_for_array_initializer,
- true);
- this.scribe.enterAlignment(arrayInitializerAlignment);
- }
- do {
- try {
- if (insert_new_line_after_opening_brace) {
- this.scribe.printNewLine();
- this.scribe.indent();
- }
- // we don't need to use an alignment
- if (this.preferences.insert_space_after_opening_brace_in_array_initializer) {
- this.scribe.space();
- } else {
- this.scribe.needSpace = false;
- }
- expressions[0].traverse(this, scope);
- if (isNextToken(TerminalTokens.TokenNameCOMMA)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_array_initializer);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- if (insert_new_line_after_opening_brace) {
- this.scribe.unIndent();
- }
- ok = true;
- } catch (AlignmentException e) {
- if (arrayInitializerAlignment == null) throw e;
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- if (arrayInitializerAlignment != null) {
- this.scribe.exitAlignment(arrayInitializerAlignment, true);
- }
- }
- if (this.preferences.insert_new_line_before_closing_brace_in_array_initializer) {
- this.scribe.printNewLine();
- } else if (this.preferences.insert_space_before_closing_brace_in_array_initializer) {
- this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, false, Scribe.PRESERVE_EMPTY_LINES_IN_CLOSING_ARRAY_INITIALIZER + (arrayInitializerIndentationLevel << 16));
- if (array_initializer_brace_position.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- } else {
- boolean keepEmptyArrayInitializerOnTheSameLine = this.preferences.keep_empty_array_initializer_on_one_line;
- String array_initializer_brace_position = this.preferences.brace_position_for_array_initializer;
- if (keepEmptyArrayInitializerOnTheSameLine) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLBRACE, this.preferences.insert_space_before_opening_brace_in_array_initializer);
- if (isNextToken(TerminalTokens.TokenNameCOMMA)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_array_initializer);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, this.preferences.insert_space_between_empty_braces_in_array_initializer);
- } else {
- formatOpeningBrace(array_initializer_brace_position, this.preferences.insert_space_before_opening_brace_in_array_initializer);
- if (isNextToken(TerminalTokens.TokenNameCOMMA)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_array_initializer);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE, this.preferences.insert_space_between_empty_braces_in_array_initializer);
- if (array_initializer_brace_position.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- }
- }
- } finally {
- this.arrayInitializersDepth--;
- }
-
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(arrayInitializer, numberOfParens);
- }
- return false;
- }
-
- private void formatArrayQualifiedTypeReference(ArrayQualifiedTypeReference arrayQualifiedTypeReference) {
- final int numberOfParens = (arrayQualifiedTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(arrayQualifiedTypeReference, numberOfParens);
- }
- formatQualifiedTypeReference(arrayQualifiedTypeReference);
- formatLeadingDimensions(arrayQualifiedTypeReference);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(arrayQualifiedTypeReference, numberOfParens);
- }
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- ArrayQualifiedTypeReference arrayQualifiedTypeReference,
- BlockScope scope) {
-
- formatArrayQualifiedTypeReference(arrayQualifiedTypeReference);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(
- ArrayQualifiedTypeReference arrayQualifiedTypeReference,
- ClassScope scope) {
-
- formatArrayQualifiedTypeReference(arrayQualifiedTypeReference);
- return false;
- }
-
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ArrayReference arrayReference, BlockScope scope) {
-
- final int numberOfParens = (arrayReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(arrayReference, numberOfParens);
- }
- arrayReference.receiver.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameLBRACKET, this.preferences.insert_space_before_opening_bracket_in_array_reference);
- if (this.preferences.insert_space_after_opening_bracket_in_array_reference) {
- this.scribe.space();
- }
- arrayReference.position.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACKET, this.preferences.insert_space_before_closing_bracket_in_array_reference);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(arrayReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- ArrayTypeReference arrayTypeReference,
- BlockScope scope) {
-
- final int numberOfParens = (arrayTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(arrayTypeReference, numberOfParens);
- }
- if (arrayTypeReference.annotations != null) {
- formatInlineAnnotations(arrayTypeReference.annotations[0], false);
- }
- this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS);
-
- int dimensions = getDimensions();
- if (dimensions != 0) {
- formatDimensions(arrayTypeReference, 0, dimensions);
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(arrayTypeReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(
- ArrayTypeReference arrayTypeReference,
- ClassScope scope) {
-
- final int numberOfParens = (arrayTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(arrayTypeReference, numberOfParens);
- }
- if (arrayTypeReference.annotations != null) {
- formatInlineAnnotations(arrayTypeReference.annotations[0], false);
- }
- this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS);
- int dimensions = getDimensions();
- if (dimensions != 0) {
- formatDimensions(arrayTypeReference, 0, dimensions);
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(arrayTypeReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.AssertStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(AssertStatement assertStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNameassert);
- this.scribe.space();
- assertStatement.assertExpression.traverse(this, scope);
-
- if (assertStatement.exceptionArgument != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_assert);
- if (this.preferences.insert_space_after_colon_in_assert) {
- this.scribe.space();
- }
- assertStatement.exceptionArgument.traverse(this, scope);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.Assignment, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(Assignment assignment, BlockScope scope) {
-
- final int numberOfParens = (assignment.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(assignment, numberOfParens);
- }
- assignment.lhs.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator);
- if (this.preferences.insert_space_after_assignment_operator) {
- this.scribe.space();
- }
-
- Alignment assignmentAlignment = this.scribe.createAlignment(
- Alignment.ASSIGNMENT,
- this.preferences.alignment_for_assignment,
- Alignment.R_OUTERMOST,
- 1,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(assignmentAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(assignmentAlignment, 0);
- assignment.expression.traverse(this, scope);
- ok = true;
- } catch(AlignmentException e){
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(assignmentAlignment, true);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(assignment, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.BinaryExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
-
- switch((binaryExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT) {
- case OperatorIds.AND :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameAND, scope);
- case OperatorIds.DIVIDE :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameDIVIDE, scope);
- case OperatorIds.GREATER :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameGREATER, scope);
- case OperatorIds.GREATER_EQUAL :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameGREATER_EQUAL, scope);
- case OperatorIds.LEFT_SHIFT :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameLEFT_SHIFT, scope);
- case OperatorIds.LESS :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameLESS, scope);
- case OperatorIds.LESS_EQUAL :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameLESS_EQUAL, scope);
- case OperatorIds.MINUS :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameMINUS, scope);
- case OperatorIds.MULTIPLY :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameMULTIPLY, scope);
- case OperatorIds.OR :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameOR, scope);
- case OperatorIds.PLUS :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNamePLUS, scope);
- case OperatorIds.REMAINDER :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameREMAINDER, scope);
- case OperatorIds.RIGHT_SHIFT :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameRIGHT_SHIFT, scope);
- case OperatorIds.UNSIGNED_RIGHT_SHIFT :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameUNSIGNED_RIGHT_SHIFT, scope);
- case OperatorIds.XOR :
- return dumpBinaryExpression(binaryExpression, TerminalTokens.TokenNameXOR, scope);
- default:
- throw new IllegalStateException();
- }
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.Block, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(Block block, BlockScope scope) {
- formatBlock(block, scope, this.preferences.brace_position_for_block, this.preferences.insert_space_before_opening_brace_in_block);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.BreakStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(BreakStatement breakStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamebreak);
- if (breakStatement.label != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.CaseStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(CaseStatement caseStatement, BlockScope scope) {
- if (caseStatement.constantExpression == null) {
- this.scribe.printNextToken(TerminalTokens.TokenNamedefault);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_default);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNamecase);
- this.scribe.space();
- caseStatement.constantExpression.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_case);
- }
- return false;
- }
-
-
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.CastExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(CastExpression castExpression, BlockScope scope) {
-
- final int numberOfParens = (castExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(castExpression, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN);
- if (this.preferences.insert_space_after_opening_paren_in_cast) {
- this.scribe.space();
- }
- castExpression.type.traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_cast);
- if (this.preferences.insert_space_after_closing_paren_in_cast) {
- this.scribe.space();
- }
- castExpression.expression.traverse(this, scope);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(castExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.CharLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(CharLiteral charLiteral, BlockScope scope) {
-
- final int numberOfParens = (charLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(charLiteral, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameCharacterLiteral);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(charLiteral, numberOfParens);
- }
- return false;
- }
-
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ClassLiteralAccess classLiteral, BlockScope scope) {
-
- final int numberOfParens = (classLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(classLiteral, numberOfParens);
- }
- classLiteral.type.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- this.scribe.printNextToken(TerminalTokens.TokenNameclass);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(classLiteral, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.Clinit, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(Clinit clinit, ClassScope scope) {
-
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope)
- */
- public boolean visit(
- CompilationUnitDeclaration compilationUnitDeclaration,
- CompilationUnitScope scope) {
-
- // fake new line to handle empty lines before package declaration or import declarations
- this.scribe.lastNumberOfNewLines = 1;
-
- // Set header end position
- final TypeDeclaration[] types = compilationUnitDeclaration.types;
- int headerEndPosition = types == null ? compilationUnitDeclaration.sourceEnd : types[0].declarationSourceStart;
- this.scribe.setHeaderComment(headerEndPosition);
-
- /*
- * Package declaration
- */
- ImportReference currentPackage = compilationUnitDeclaration.currentPackage;
- final boolean hasPackage = currentPackage != null;
- if (hasPackage) {
- printComment();
- int blankLinesBeforePackage = this.preferences.blank_lines_before_package;
- if (blankLinesBeforePackage > 0) {
- this.scribe.printEmptyLines(blankLinesBeforePackage);
- }
-
- this.scribe.printModifiers(currentPackage.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_PACKAGE);
- this.scribe.space();
- // dump the package keyword
- this.scribe.printNextToken(TerminalTokens.TokenNamepackage);
- this.scribe.space();
- this.scribe.printQualifiedReference(compilationUnitDeclaration.currentPackage.sourceEnd, false/*do not expect parenthesis*/);
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- int blankLinesAfterPackage = this.preferences.blank_lines_after_package;
- if (blankLinesAfterPackage > 0) {
- this.scribe.printEmptyLines(blankLinesAfterPackage);
- } else {
- this.scribe.printNewLine();
- }
- } else {
- this.scribe.printComment();
- }
-
- /*
- * Import statements
- */
- final ImportReference[] imports = compilationUnitDeclaration.imports;
- if (imports != null) {
- if (hasPackage) {
- int blankLinesBeforeImports = this.preferences.blank_lines_before_imports;
- if (blankLinesBeforeImports > 0) {
- this.scribe.printEmptyLines(blankLinesBeforeImports);
- }
- }
- int importLength = imports.length;
- if (importLength != 1) {
- format(imports[0], false);
- for (int i = 1; i < importLength - 1; i++) {
- format(imports[i], false);
- }
- format(imports[importLength - 1], true);
- } else {
- format(imports[0], true);
- }
-
- int blankLinesAfterImports = this.preferences.blank_lines_after_imports;
- if (blankLinesAfterImports > 0) {
- this.scribe.printEmptyLines(blankLinesAfterImports);
- }
- }
-
- formatEmptyTypeDeclaration(true);
-
- int blankLineBetweenTypeDeclarations = this.preferences.blank_lines_between_type_declarations;
- /*
- * Type declarations
- */
- if (types != null) {
- int typesLength = types.length;
- for (int i = 0; i < typesLength - 1; i++) {
- types[i].traverse(this, scope);
- formatEmptyTypeDeclaration(false);
- if (blankLineBetweenTypeDeclarations != 0) {
- this.scribe.printEmptyLines(blankLineBetweenTypeDeclarations);
- } else {
- this.scribe.printNewLine();
- }
- }
- types[typesLength - 1].traverse(this, scope);
- }
- this.scribe.printEndOfCompilationUnit();
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompoundAssignment, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- CompoundAssignment compoundAssignment,
- BlockScope scope) {
-
- final int numberOfParens = (compoundAssignment.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(compoundAssignment, numberOfParens);
- }
- compoundAssignment.lhs.traverse(this, scope);
-
- /*
- * Print the operator
- */
- int operator;
- switch(compoundAssignment.operator) {
- case OperatorIds.PLUS :
- operator = TerminalTokens.TokenNamePLUS_EQUAL;
- break;
- case OperatorIds.MINUS :
- operator = TerminalTokens.TokenNameMINUS_EQUAL;
- break;
- case OperatorIds.MULTIPLY :
- operator = TerminalTokens.TokenNameMULTIPLY_EQUAL;
- break;
- case OperatorIds.DIVIDE :
- operator = TerminalTokens.TokenNameDIVIDE_EQUAL;
- break;
- case OperatorIds.AND :
- operator = TerminalTokens.TokenNameAND_EQUAL;
- break;
- case OperatorIds.OR :
- operator = TerminalTokens.TokenNameOR_EQUAL;
- break;
- case OperatorIds.XOR :
- operator = TerminalTokens.TokenNameXOR_EQUAL;
- break;
- case OperatorIds.REMAINDER :
- operator = TerminalTokens.TokenNameREMAINDER_EQUAL;
- break;
- case OperatorIds.LEFT_SHIFT :
- operator = TerminalTokens.TokenNameLEFT_SHIFT_EQUAL;
- break;
- case OperatorIds.RIGHT_SHIFT :
- operator = TerminalTokens.TokenNameRIGHT_SHIFT_EQUAL;
- break;
- default: // OperatorIds.UNSIGNED_RIGHT_SHIFT :
- operator = TerminalTokens.TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL;
- }
-
- this.scribe.printNextToken(operator, this.preferences.insert_space_before_assignment_operator);
- if (this.preferences.insert_space_after_assignment_operator) {
- this.scribe.space();
- }
- Alignment assignmentAlignment = this.scribe.createAlignment(
- Alignment.COMPOUND_ASSIGNMENT,
- this.preferences.alignment_for_assignment,
- Alignment.R_OUTERMOST,
- 1,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(assignmentAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(assignmentAlignment, 0);
- compoundAssignment.expression.traverse(this, scope);
- ok = true;
- } catch(AlignmentException e){
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(assignmentAlignment, true);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(compoundAssignment, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConditionalExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- ConditionalExpression conditionalExpression,
- BlockScope scope) {
-
- final int numberOfParens = (conditionalExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(conditionalExpression, numberOfParens);
- }
- conditionalExpression.condition.traverse(this, scope);
-
- Alignment conditionalExpressionAlignment =this.scribe.createAlignment(
- Alignment.CONDITIONAL_EXPRESSION,
- this.preferences.alignment_for_conditional_expression,
- 2,
- this.scribe.scanner.currentPosition);
-
- this.scribe.enterAlignment(conditionalExpressionAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(conditionalExpressionAlignment, 0);
- this.scribe.printNextToken(TerminalTokens.TokenNameQUESTION, this.preferences.insert_space_before_question_in_conditional);
-
- if (this.preferences.insert_space_after_question_in_conditional) {
- this.scribe.space();
- }
- conditionalExpression.valueIfTrue.traverse(this, scope);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.alignFragment(conditionalExpressionAlignment, 1);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_conditional);
-
- if (this.preferences.insert_space_after_colon_in_conditional) {
- this.scribe.space();
- }
- conditionalExpression.valueIfFalse.traverse(this, scope);
-
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(conditionalExpressionAlignment, true);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(conditionalExpression, numberOfParens);
- }
- return false;
- }
-
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(
- ConstructorDeclaration constructorDeclaration,
- ClassScope scope) {
-
- if (constructorDeclaration.ignoreFurtherInvestigation) {
- this.scribe.printComment();
- if (this.scribe.indentationLevel != 0) {
- this.scribe.printIndentationIfNecessary();
- }
- this.scribe.scanner.resetTo(constructorDeclaration.declarationSourceEnd + 1, this.scribe.scannerEndPosition - 1);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- switch(this.scribe.scanner.source[this.scribe.scanner.currentPosition]) {
- case '\n' :
- this.scribe.scanner.currentPosition++;
- this.scribe.lastNumberOfNewLines = 1;
- break;
- case '\r' :
- this.scribe.scanner.currentPosition++;
- if (this.scribe.scanner.source[this.scribe.scanner.currentPosition] == '\n') {
- this.scribe.scanner.currentPosition++;
- }
- this.scribe.lastNumberOfNewLines = 1;
- }
- return false;
- }
- /*
- * Print comments to get proper line number
- */
- this.scribe.printComment();
- int line = this.scribe.line;
- this.scribe.printModifiers(constructorDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_METHOD);
- if (this.scribe.line > line) {
- // annotations introduced new line, but this is not a line wrapping
- // see 158267
- line = this.scribe.line;
- }
- this.scribe.space();
-
- TypeParameter[] typeParameters = constructorDeclaration.typeParameters;
- if (typeParameters != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_parameters);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_parameters) {
- this.scribe.space();
- }
- int length = typeParameters.length;
- for (int i = 0; i < length - 1; i++) {
- typeParameters[i].traverse(this, constructorDeclaration.scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_parameters);
- if (this.preferences.insert_space_after_comma_in_type_parameters) {
- this.scribe.space();
- }
- }
- typeParameters[length - 1].traverse(this, constructorDeclaration.scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_parameters);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_parameters) {
- this.scribe.space();
- }
- }
-
- /*
- * Print the method name
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
-
- formatMethodArguments(
- constructorDeclaration,
- this.preferences.insert_space_before_opening_paren_in_constructor_declaration,
- this.preferences.insert_space_between_empty_parens_in_constructor_declaration,
- this.preferences.insert_space_before_closing_paren_in_constructor_declaration,
- this.preferences.insert_space_after_opening_paren_in_constructor_declaration,
- this.preferences.insert_space_before_comma_in_constructor_declaration_parameters,
- this.preferences.insert_space_after_comma_in_constructor_declaration_parameters,
- this.preferences.alignment_for_parameters_in_constructor_declaration);
-
- formatThrowsClause(
- constructorDeclaration,
- this.preferences.insert_space_before_comma_in_constructor_declaration_throws,
- this.preferences.insert_space_after_comma_in_constructor_declaration_throws,
- this.preferences.alignment_for_throws_clause_in_constructor_declaration);
-
- if (!constructorDeclaration.isNative() && !constructorDeclaration.isAbstract()) {
- /*
- * Method body
- */
- String constructor_declaration_brace = this.preferences.brace_position_for_constructor_declaration;
- formatLeftCurlyBrace(line, constructor_declaration_brace);
- formatOpeningBrace(constructor_declaration_brace, this.preferences.insert_space_before_opening_brace_in_constructor_declaration);
- final int numberOfBlankLinesAtBeginningOfMethodBody = this.preferences.blank_lines_at_beginning_of_method_body;
- if (numberOfBlankLinesAtBeginningOfMethodBody > 0) {
- this.scribe.printEmptyLines(numberOfBlankLinesAtBeginningOfMethodBody);
- }
- if (constructorDeclaration.constructorCall != null && !constructorDeclaration.constructorCall.isImplicitSuper()) {
- this.scribe.printNewLine();
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.indent();
- }
- constructorDeclaration.constructorCall.traverse(this, constructorDeclaration.scope);
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.unIndent();
- }
- }
- final Statement[] statements = constructorDeclaration.statements;
- if (statements != null) {
- this.scribe.printNewLine();
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.indent();
- }
- formatStatements(constructorDeclaration.scope, statements, true);
- this.scribe.printComment();
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.unIndent();
- }
- } else {
- if (this.preferences.insert_new_line_in_empty_method_body) {
- this.scribe.printNewLine();
- }
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.indent();
- }
- this.scribe.printComment();
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.unIndent();
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (constructor_declaration_brace.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- } else {
- // no method body
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ContinueStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ContinueStatement continueStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamecontinue);
- if (continueStatement.label != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.DoStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(DoStatement doStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamedo);
- final int line = this.scribe.line;
-
- final Statement action = doStatement.action;
- if (action != null) {
- if (action instanceof Block) {
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
- action.traverse(this, scope);
- } else if (action instanceof EmptyStatement) {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- } else {
- this.scribe.printNewLine();
- this.scribe.indent();
- action.traverse(this, scope);
- if (action instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.printNewLine();
- this.scribe.unIndent();
- }
- } else {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- }
-
- if (this.preferences.insert_new_line_before_while_in_do_statement) {
- this.scribe.printNewLine();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamewhile, this.preferences.insert_space_after_closing_brace_in_block);
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_while);
-
- if (this.preferences.insert_space_after_opening_paren_in_while) {
- this.scribe.space();
- }
-
- doStatement.condition.traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_while);
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.DoubleLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) {
-
- final int numberOfParens = (doubleLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(doubleLiteral, numberOfParens);
- }
- if (isNextToken(TerminalTokens.TokenNameMINUS)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameDoubleLiteral);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(doubleLiteral, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.EmptyStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(EmptyStatement statement, BlockScope scope) {
- if (this.preferences.put_empty_statement_on_new_line) {
- this.scribe.printNewLine();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
- // field is an enum constant
- public boolean visit(FieldDeclaration enumConstant, MethodScope scope) {
- /*
- * Print comments to get proper line number
- */
- this.scribe.printComment();
- final int line = this.scribe.line;
- this.scribe.printModifiers(enumConstant.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_FIELD);
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
- formatEnumConstantArguments(
- enumConstant,
- this.preferences.insert_space_before_opening_paren_in_enum_constant,
- this.preferences.insert_space_between_empty_parens_in_enum_constant,
- this.preferences.insert_space_before_closing_paren_in_enum_constant,
- this.preferences.insert_space_after_opening_paren_in_enum_constant,
- this.preferences.insert_space_before_comma_in_enum_constant_arguments,
- this.preferences.insert_space_after_comma_in_enum_constant_arguments,
- this.preferences.alignment_for_arguments_in_enum_constant);
-
- Expression initialization = enumConstant.initialization;
- if (initialization instanceof QualifiedAllocationExpression) {
- TypeDeclaration typeDeclaration = ((QualifiedAllocationExpression) initialization).anonymousType;
- int fieldsCount = typeDeclaration.fields == null ? 0 : typeDeclaration.fields.length;
- int methodsCount = typeDeclaration.methods == null ? 0 : typeDeclaration.methods.length;
- int membersCount = typeDeclaration.memberTypes == null ? 0 : typeDeclaration.memberTypes.length;
-
- /*
- * Type body
- */
- String enum_constant_brace = this.preferences.brace_position_for_enum_constant;
-
- formatLeftCurlyBrace(line, enum_constant_brace);
- formatTypeOpeningBraceForEnumConstant(enum_constant_brace, this.preferences.insert_space_before_opening_brace_in_enum_constant, typeDeclaration);
-
- if (this.preferences.indent_body_declarations_compare_to_enum_constant_header) {
- this.scribe.indent();
- }
-
- if (fieldsCount != 0 || methodsCount != 0 || membersCount != 0) {
- formatTypeMembers(typeDeclaration);
- }
-
- if (this.preferences.indent_body_declarations_compare_to_enum_constant_header) {
- this.scribe.unIndent();
- }
-
- if (this.preferences.insert_new_line_in_empty_enum_constant) {
- this.scribe.printNewLine();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (enum_constant_brace.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- if (hasComments()) {
- this.scribe.printNewLine();
- }
- }
- return false;
- }
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.EqualExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(EqualExpression equalExpression, BlockScope scope) {
-
- if ((equalExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT == OperatorIds.EQUAL_EQUAL) {
- return dumpEqualityExpression(equalExpression, TerminalTokens.TokenNameEQUAL_EQUAL, scope);
- } else {
- return dumpEqualityExpression(equalExpression, TerminalTokens.TokenNameNOT_EQUAL, scope);
- }
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- ExplicitConstructorCall explicitConstructor,
- BlockScope scope) {
-
- if (explicitConstructor.isImplicitSuper()) {
- return false;
- }
- final Expression qualification = explicitConstructor.qualification;
- if (qualification != null) {
- qualification.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- }
-
- TypeReference[] typeArguments = explicitConstructor.typeArguments;
- if (typeArguments != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_arguments);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- int length = typeArguments.length;
- for (int i = 0; i < length - 1; i++) {
- typeArguments[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_arguments);
- if (this.preferences.insert_space_after_comma_in_type_arguments) {
- this.scribe.space();
- }
- }
- typeArguments[length - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_arguments);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- }
-
- if (explicitConstructor.isSuperAccess()) {
- this.scribe.printNextToken(TerminalTokens.TokenNamesuper);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNamethis);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_method_invocation);
-
- final Expression[] arguments = explicitConstructor.arguments;
- if (arguments != null) {
- if (this.preferences.insert_space_after_opening_paren_in_method_invocation) {
- this.scribe.space();
- }
- int argumentLength = arguments.length;
- Alignment argumentsAlignment =this.scribe.createAlignment(
- Alignment.EXPLICIT_CONSTRUCTOR_CALL,
- this.preferences.alignment_for_arguments_in_explicit_constructor_call,
- argumentLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean ok = false;
- do {
- try {
- for (int i = 0; i < argumentLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_explicit_constructor_call_arguments);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.alignFragment(argumentsAlignment, i);
- if (i > 0 && this.preferences.insert_space_after_comma_in_explicit_constructor_call_arguments) {
- this.scribe.space();
- }
- arguments[i].traverse(this, scope);
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(argumentsAlignment, true);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_method_invocation);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_between_empty_parens_in_method_invocation);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.FalseLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(FalseLiteral falseLiteral, BlockScope scope) {
-
- final int numberOfParens = (falseLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(falseLiteral, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamefalse);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(falseLiteral, numberOfParens);
- }
- return false;
- }
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(FieldReference fieldReference, BlockScope scope) {
-
- final int numberOfParens = (fieldReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(fieldReference, numberOfParens);
- }
- fieldReference.receiver.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(fieldReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.FloatLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(FloatLiteral floatLiteral, BlockScope scope) {
-
- final int numberOfParens = (floatLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(floatLiteral, numberOfParens);
- }
- if (isNextToken(TerminalTokens.TokenNameMINUS)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameFloatingPointLiteral);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(floatLiteral, numberOfParens);
- }
- return false;
- }
- public boolean visit(ForeachStatement forStatement, BlockScope scope) {
- this.scribe.printNextToken(TerminalTokens.TokenNamefor);
- final int line = this.scribe.line;
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_for);
-
- if (this.preferences.insert_space_after_opening_paren_in_for) {
- this.scribe.space();
- }
- formatLocalDeclaration(forStatement.elementVariable, scope, false, false);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_for);
- if (this.preferences.insert_space_after_colon_in_for) {
- this.scribe.space();
- }
- forStatement.collection.traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_for);
-
- final Statement action = forStatement.action;
- if (action != null) {
- if (action instanceof Block) {
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
- action.traverse(this, scope);
- } else if (action instanceof EmptyStatement) {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- } else {
- this.scribe.indent();
- this.scribe.printNewLine();
- action.traverse(this, scope);
- this.scribe.unIndent();
- }
- if (action instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- } else {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ForStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ForStatement forStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamefor);
- final int line = this.scribe.line;
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_for);
-
- if (this.preferences.insert_space_after_opening_paren_in_for) {
- this.scribe.space();
- }
- final Statement[] initializations = forStatement.initializations;
- if (initializations != null) {
- int length = initializations.length;
- for (int i = 0; i < length; i++) {
- if (initializations[i] instanceof LocalDeclaration) {
- formatLocalDeclaration((LocalDeclaration) initializations[i], scope, this.preferences.insert_space_before_comma_in_for_inits, this.preferences.insert_space_after_comma_in_for_inits);
- } else {
- initializations[i].traverse(this, scope);
- if (i >= 0 && (i < length - 1)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_for_inits);
- if (this.preferences.insert_space_after_comma_in_for_inits) {
- this.scribe.space();
- }
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- }
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon_in_for);
- final Expression condition = forStatement.condition;
- if (condition != null) {
- if (this.preferences.insert_space_after_semicolon_in_for) {
- this.scribe.space();
- }
- condition.traverse(this, scope);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon_in_for);
- final Statement[] increments = forStatement.increments;
- if (increments != null) {
- if (this.preferences.insert_space_after_semicolon_in_for) {
- this.scribe.space();
- }
- for (int i = 0, length = increments.length; i < length; i++) {
- increments[i].traverse(this, scope);
- if (i != length - 1) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_for_increments);
- if (this.preferences.insert_space_after_comma_in_for_increments) {
- this.scribe.space();
- }
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_for);
-
- final Statement action = forStatement.action;
- if (action != null) {
- if (action instanceof Block) {
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
- action.traverse(this, scope);
- } else if (action instanceof EmptyStatement) {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- } else {
- this.scribe.indent();
- this.scribe.printNewLine();
- action.traverse(this, scope);
- this.scribe.unIndent();
- }
- if (action instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- } else {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- }
- return false;
- }
-
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.IfStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(IfStatement ifStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNameif);
- final int line = this.scribe.line;
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_if);
- if (this.preferences.insert_space_after_opening_paren_in_if) {
- this.scribe.space();
- }
- ifStatement.condition.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_if);
-
- final Statement thenStatement = ifStatement.thenStatement;
- final Statement elseStatement = ifStatement.elseStatement;
-
- boolean thenStatementIsBlock = false;
- if (thenStatement != null) {
- if (thenStatement instanceof Block) {
- thenStatementIsBlock = true;
- if (isGuardClause((Block)thenStatement) && elseStatement == null && this.preferences.keep_guardian_clause_on_one_line) {
- /*
- * Need a specific formatting for guard clauses
- * guard clauses are block with a single return or throw
- * statement
- */
- formatGuardClauseBlock((Block) thenStatement, scope);
- } else {
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
- thenStatement.traverse(this, scope);
- if (elseStatement != null && (this.preferences.insert_new_line_before_else_in_if_statement)) {
- this.scribe.printNewLine();
- }
- }
- } else if (elseStatement == null && this.preferences.keep_simple_if_on_one_line) {
- Alignment compactIfAlignment = this.scribe.createAlignment(
- Alignment.COMPACT_IF,
- this.preferences.alignment_for_compact_if,
- Alignment.R_OUTERMOST,
- 1,
- this.scribe.scanner.currentPosition,
- 1,
- false);
- this.scribe.enterAlignment(compactIfAlignment);
- boolean ok = false;
- do {
- try {
- this.scribe.alignFragment(compactIfAlignment, 0);
- this.scribe.space();
- thenStatement.traverse(this, scope);
- if (thenStatement instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(compactIfAlignment, true);
- } else if (this.preferences.keep_then_statement_on_same_line) {
- this.scribe.space();
- thenStatement.traverse(this, scope);
- if (thenStatement instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- if (elseStatement != null) {
- this.scribe.printNewLine();
- }
- } else {
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.printNewLine();
- this.scribe.indent();
- thenStatement.traverse(this, scope);
- if (thenStatement instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- if (elseStatement != null) {
- this.scribe.printNewLine();
- }
- this.scribe.unIndent();
- }
- }
-
- if (elseStatement != null) {
- if (thenStatementIsBlock) {
- this.scribe.printNextToken(TerminalTokens.TokenNameelse, this.preferences.insert_space_after_closing_brace_in_block, Scribe.PRESERVE_EMPTY_LINES_BEFORE_ELSE);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameelse, true, Scribe.PRESERVE_EMPTY_LINES_BEFORE_ELSE);
- }
- if (elseStatement instanceof Block) {
- elseStatement.traverse(this, scope);
- } else if (elseStatement instanceof IfStatement) {
- if (!this.preferences.compact_else_if) {
- this.scribe.printNewLine();
- this.scribe.indent();
- }
- this.scribe.space();
- elseStatement.traverse(this, scope);
- if (!this.preferences.compact_else_if) {
- this.scribe.unIndent();
- }
- } else if (this.preferences.keep_else_statement_on_same_line) {
- this.scribe.space();
- elseStatement.traverse(this, scope);
- if (elseStatement instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- } else {
- this.scribe.printNewLine();
- this.scribe.indent();
- elseStatement.traverse(this, scope);
- if (elseStatement instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.unIndent();
- }
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.IntersectionCastTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(IntersectionCastTypeReference intersectionCastTypeReference, BlockScope scope) {
- int length = intersectionCastTypeReference.typeReferences == null ? 0 : intersectionCastTypeReference.typeReferences.length;
- for (int i = 0; i < length; i++) {
- intersectionCastTypeReference.typeReferences[i].traverse(this, scope);
- if (i != length - 1) {
- // Borrowing the formatting option from binary operators
- this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_binary_operator);
- if (this.preferences.insert_space_after_binary_operator) {
- this.scribe.space();
- }
- }
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.Initializer, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope)
- */
- public boolean visit(Initializer initializer, MethodScope scope) {
-
- if (initializer.isStatic()) {
- this.scribe.printNextToken(TerminalTokens.TokenNamestatic);
- }
- initializer.block.traverse(this, scope);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- InstanceOfExpression instanceOfExpression,
- BlockScope scope) {
-
- final int numberOfParens = (instanceOfExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(instanceOfExpression, numberOfParens);
- }
- instanceOfExpression.expression.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameinstanceof, true);
- this.scribe.space();
- instanceOfExpression.type.traverse(this, scope);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(instanceOfExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.IntLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(IntLiteral intLiteral, BlockScope scope) {
-
- final int numberOfParens = (intLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(intLiteral, numberOfParens);
- }
- if (isNextToken(TerminalTokens.TokenNameMINUS)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIntegerLiteral);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(intLiteral, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.LabeledStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_labeled_statement);
- if (this.preferences.insert_space_after_colon_in_labeled_statement) {
- this.scribe.space();
- }
- if (this.preferences.insert_new_line_after_label) {
- this.scribe.printNewLine();
- }
- final Statement statement = labeledStatement.statement;
- statement.traverse(this, scope);
- if (statement instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.LambdaExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(LambdaExpression lambdaExpression, BlockScope scope) {
-
- final int numberOfParens = (lambdaExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(lambdaExpression, numberOfParens);
- }
- if (isNextToken(TerminalTokens.TokenNameLPAREN)) {
- // Format arguments
- formatMethodArguments(
- null,
- lambdaExpression.arguments(),
- lambdaExpression.getScope(),
- this.preferences.insert_space_before_opening_paren_in_method_declaration,
- this.preferences.insert_space_between_empty_parens_in_method_declaration,
- this.preferences.insert_space_before_closing_paren_in_method_declaration,
- this.preferences.insert_space_after_opening_paren_in_method_declaration,
- this.preferences.insert_space_before_comma_in_method_declaration_parameters,
- this.preferences.insert_space_after_comma_in_method_declaration_parameters,
- this.preferences.alignment_for_parameters_in_method_declaration);
- } else {
- // This MUST be a single, untyped parameter
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
- }
- if (this.preferences.insert_space_before_lambda_arrow) this.scribe.space();
- this.scribe.printNextToken(TerminalTokens.TokenNameARROW);
- if (this.preferences.insert_space_after_lambda_arrow) this.scribe.space();
- final Statement body = lambdaExpression.body();
- if (body instanceof Block) {
- formatBlock((Block) body, scope, this.preferences.brace_position_for_lambda_body, this.preferences.insert_space_before_opening_brace_in_block);
- } else {
- body.traverse(this, scope);
- }
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(lambdaExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.LocalDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
- formatLocalDeclaration(localDeclaration, scope, this.preferences.insert_space_before_comma_in_multiple_local_declarations, this.preferences.insert_space_after_comma_in_multiple_local_declarations);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.LongLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(LongLiteral longLiteral, BlockScope scope) {
-
- final int numberOfParens = (longLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(longLiteral, numberOfParens);
- }
- if (isNextToken(TerminalTokens.TokenNameMINUS)) {
- this.scribe.printNextToken(TerminalTokens.TokenNameMINUS);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameLongLiteral);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(longLiteral, numberOfParens);
- }
- return false;
- }
- public boolean visit(MarkerAnnotation annotation, BlockScope scope) {
- this.scribe.printNextToken(TerminalTokens.TokenNameAT);
- if (this.preferences.insert_space_after_at_in_annotation) {
- this.scribe.space();
- }
- this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/);
- return false;
- }
- public boolean visit(MarkerAnnotation annotation, ClassScope scope) {
- this.scribe.printNextToken(TerminalTokens.TokenNameAT);
- if (this.preferences.insert_space_after_at_in_annotation) {
- this.scribe.space();
- }
- this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/);
- return false;
- }
- public boolean visit(MemberValuePair pair, BlockScope scope) {
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
- this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator);
- if (this.preferences.insert_space_after_assignment_operator) {
- this.scribe.space();
- }
- pair.value.traverse(this, scope);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(MessageSend messageSend, BlockScope scope) {
-
- final int numberOfParens = (messageSend.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(messageSend, numberOfParens);
- }
- CascadingMethodInvocationFragmentBuilder builder = buildFragments(messageSend, scope);
-
- if (builder.size() >= 3 && numberOfParens == 0) {
- formatCascadingMessageSends(builder, scope);
- } else {
- Alignment messageAlignment = null;
- if (!messageSend.receiver.isImplicitThis()) {
- messageSend.receiver.traverse(this, scope);
- int alignmentMode = this.preferences.alignment_for_selector_in_method_invocation;
- messageAlignment = this.scribe.createAlignment(
- Alignment.MESSAGE_SEND,
- alignmentMode,
- 1,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(messageAlignment);
- boolean ok = false;
- do {
- switch (alignmentMode & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT:
- case Alignment.M_NEXT_PER_LINE_SPLIT:
- messageAlignment.startingColumn = this.scribe.column;
- break;
- }
- try {
- formatMessageSend(messageSend, scope, messageAlignment);
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(messageAlignment, true);
- } else {
- formatMessageSend(messageSend, scope, null);
- }
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(messageSend, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(
- MethodDeclaration methodDeclaration,
- ClassScope scope) {
-
- if (methodDeclaration.ignoreFurtherInvestigation) {
- this.scribe.printComment();
- if (this.scribe.indentationLevel != 0) {
- this.scribe.printIndentationIfNecessary();
- }
- this.scribe.scanner.resetTo(methodDeclaration.declarationSourceEnd + 1, this.scribe.scannerEndPosition - 1);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (!this.scribe.scanner.atEnd()) {
- switch(this.scribe.scanner.source[this.scribe.scanner.currentPosition]) {
- case '\n' :
- this.scribe.scanner.currentPosition++;
- this.scribe.lastNumberOfNewLines = 1;
- break;
- case '\r' :
- this.scribe.scanner.currentPosition++;
- if (this.scribe.scanner.source[this.scribe.scanner.currentPosition] == '\n') {
- this.scribe.scanner.currentPosition++;
- }
- this.scribe.lastNumberOfNewLines = 1;
- }
- }
- return false;
- }
-
- /*
- * Print comments to get proper line number
- */
- this.scribe.printComment();
- int line = this.scribe.line;
-
- // Create alignment
- Alignment methodDeclAlignment = this.scribe.createAlignment(
- Alignment.METHOD_DECLARATION,
- this.preferences.alignment_for_method_declaration,
- Alignment.R_INNERMOST,
- 3,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(methodDeclAlignment);
- boolean ok = false;
- final MethodScope methodDeclarationScope = methodDeclaration.scope;
- do {
- try {
-
- this.scribe.printModifiers(methodDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_METHOD);
- int fragmentIndex = 0;
- this.scribe.alignFragment(methodDeclAlignment, fragmentIndex);
-
- if (this.scribe.line > line) {
- // annotations introduced new line, but this is not a line wrapping
- // see 158267
- line = this.scribe.line;
- }
- this.scribe.space();
-
- TypeParameter[] typeParameters = methodDeclaration.typeParameters;
- if (typeParameters != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_parameters);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_parameters) {
- this.scribe.space();
- }
- int length = typeParameters.length;
- for (int i = 0; i < length - 1; i++) {
- typeParameters[i].traverse(this, methodDeclaration.scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_parameters);
- if (this.preferences.insert_space_after_comma_in_type_parameters) {
- this.scribe.space();
- }
- }
- typeParameters[length - 1].traverse(this, methodDeclaration.scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_parameters);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_parameters) {
- this.scribe.space();
- }
- this.scribe.alignFragment(methodDeclAlignment, ++fragmentIndex);
- }
-
- /*
- * Print the method return type
- */
- final TypeReference returnType = methodDeclaration.returnType;
-
- if (returnType != null) {
- returnType.traverse(this, methodDeclarationScope);
- }
- this.scribe.alignFragment(methodDeclAlignment, ++fragmentIndex);
-
- /*
- * Print the method name
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, true);
-
- // Format arguments
- formatMethodArguments(
- methodDeclaration,
- this.preferences.insert_space_before_opening_paren_in_method_declaration,
- this.preferences.insert_space_between_empty_parens_in_method_declaration,
- this.preferences.insert_space_before_closing_paren_in_method_declaration,
- this.preferences.insert_space_after_opening_paren_in_method_declaration,
- this.preferences.insert_space_before_comma_in_method_declaration_parameters,
- this.preferences.insert_space_after_comma_in_method_declaration_parameters,
- this.preferences.alignment_for_parameters_in_method_declaration);
-
- formatExtraDimensions(methodDeclaration.returnType);
-
- // Format throws
- formatThrowsClause(
- methodDeclaration,
- this.preferences.insert_space_before_comma_in_method_declaration_throws,
- this.preferences.insert_space_after_comma_in_method_declaration_throws,
- this.preferences.alignment_for_throws_clause_in_method_declaration);
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(methodDeclAlignment, true);
-
- if (!methodDeclaration.isNative() && !methodDeclaration.isAbstract() && ((methodDeclaration.modifiers & ExtraCompilerModifiers.AccSemicolonBody) == 0)) {
- /*
- * Method body
- */
- String method_declaration_brace = this.preferences.brace_position_for_method_declaration;
- formatLeftCurlyBrace(line, method_declaration_brace);
- formatOpeningBrace(method_declaration_brace, this.preferences.insert_space_before_opening_brace_in_method_declaration);
- final int numberOfBlankLinesAtBeginningOfMethodBody = this.preferences.blank_lines_at_beginning_of_method_body;
- if (numberOfBlankLinesAtBeginningOfMethodBody > 0) {
- this.scribe.printEmptyLines(numberOfBlankLinesAtBeginningOfMethodBody);
- }
- final Statement[] statements = methodDeclaration.statements;
- if (statements != null) {
- this.scribe.printNewLine();
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.indent();
- }
- formatStatements(methodDeclarationScope, statements, true);
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION);
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.unIndent();
- }
- } else {
- if (this.preferences.insert_new_line_in_empty_method_body) {
- this.scribe.printNewLine();
- }
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.indent();
- }
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION);
- if (this.preferences.indent_statements_compare_to_body) {
- this.scribe.unIndent();
- }
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (method_declaration_brace.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- } else {
- // no method body
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.COMPLEX_TRAILING_COMMENT);
- }
- return false;
- }
-
- public boolean visit(NormalAnnotation annotation, BlockScope scope) {
- this.scribe.printNextToken(TerminalTokens.TokenNameAT);
- if (this.preferences.insert_space_after_at_in_annotation) {
- this.scribe.space();
- }
- this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/);
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_annotation);
- if (this.preferences.insert_space_after_opening_paren_in_annotation) {
- this.scribe.space();
- }
- MemberValuePair[] memberValuePairs = annotation.memberValuePairs;
- if (memberValuePairs != null) {
- int length = memberValuePairs.length;
- Alignment annotationAlignment = this.scribe.createAlignment(
- Alignment.ANNOTATION_MEMBERS_VALUE_PAIRS,
- this.preferences.alignment_for_arguments_in_annotation,
- length,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(annotationAlignment);
- boolean ok = false;
- do {
- try {
- for (int i = 0; i < length; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_annotation);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.alignFragment(annotationAlignment, i);
- if (i > 0 && this.preferences.insert_space_after_comma_in_annotation) {
- this.scribe.space();
- }
- memberValuePairs[i].traverse(this, scope);
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(annotationAlignment, true);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation);
- return false;
- }
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
-
- final int numberOfParens = (nullLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(nullLiteral, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamenull);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(nullLiteral, numberOfParens);
- }
- return false;
- }
-
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) {
- return dumpBinaryExpression(or_or_Expression, TerminalTokens.TokenNameOR_OR, scope);
- }
- public boolean visit(
- ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference,
- BlockScope scope) {
- final int numberOfParens = (parameterizedQualifiedTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(parameterizedQualifiedTypeReference, numberOfParens);
- }
- TypeReference[][] typeArguments = parameterizedQualifiedTypeReference.typeArguments;
- int length = typeArguments.length;
- for (int i = 0; i < length; i++) {
- if (parameterizedQualifiedTypeReference.annotations != null) {
- formatInlineAnnotations(parameterizedQualifiedTypeReference.annotations[i], false);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
- TypeReference[] typeArgument = typeArguments[i];
- if (typeArgument != null) {
- int typeArgumentLength = typeArgument.length;
- if (typeArgumentLength > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_parameterized_type_reference) {
- this.scribe.space();
- }
- for (int j = 0; j < typeArgumentLength - 1; j++) {
- typeArgument[j].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_comma_in_parameterized_type_reference) {
- this.scribe.space();
- }
- }
- typeArgument[typeArgumentLength - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_parameterized_type_reference);
- }
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS);
- }
- }
- if (i < length - 1) {
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- }
- }
- formatLeadingDimensions(parameterizedQualifiedTypeReference);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(parameterizedQualifiedTypeReference, numberOfParens);
- }
- return false;
- }
- public boolean visit(
- ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference,
- ClassScope scope) {
- final int numberOfParens = (parameterizedQualifiedTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(parameterizedQualifiedTypeReference, numberOfParens);
- }
- TypeReference[][] typeArguments = parameterizedQualifiedTypeReference.typeArguments;
- int length = typeArguments.length;
- for (int i = 0; i < length; i++) {
- if (parameterizedQualifiedTypeReference.annotations != null) {
- formatInlineAnnotations(parameterizedQualifiedTypeReference.annotations[i], false);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
- TypeReference[] typeArgument = typeArguments[i];
- if (typeArgument != null) {
- int typeArgumentLength = typeArgument.length;
- if (typeArgumentLength > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_parameterized_type_reference) {
- this.scribe.space();
- }
- for (int j = 0; j < typeArgumentLength - 1; j++) {
- typeArgument[j].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_comma_in_parameterized_type_reference) {
- this.scribe.space();
- }
- }
- typeArgument[typeArgumentLength - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_parameterized_type_reference);
- }
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS);
- }
- }
- if (i < length - 1) {
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- }
- }
- formatLeadingDimensions(parameterizedQualifiedTypeReference);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(parameterizedQualifiedTypeReference, numberOfParens);
- }
- return false;
- }
- public boolean visit(
- ParameterizedSingleTypeReference parameterizedSingleTypeReference,
- BlockScope scope) {
- final int numberOfParens = (parameterizedSingleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(parameterizedSingleTypeReference, numberOfParens);
- }
- if (parameterizedSingleTypeReference.annotations != null) {
- formatInlineAnnotations(parameterizedSingleTypeReference.annotations[0], false);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
-
- TypeReference[] typeArguments = parameterizedSingleTypeReference.typeArguments;
- int typeArgumentsLength = typeArguments.length;
- if (typeArgumentsLength > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_parameterized_type_reference) {
- this.scribe.space();
- }
- for (int i = 0; i < typeArgumentsLength - 1; i++) {
- typeArguments[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_comma_in_parameterized_type_reference) {
- this.scribe.space();
- }
- }
- typeArguments[typeArgumentsLength - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_parameterized_type_reference);
- }
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS);
- }
- formatLeadingDimensions(parameterizedSingleTypeReference);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(parameterizedSingleTypeReference, numberOfParens);
- }
- return false;
- }
- public boolean visit(
- ParameterizedSingleTypeReference parameterizedSingleTypeReference,
- ClassScope scope) {
- final int numberOfParens = (parameterizedSingleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(parameterizedSingleTypeReference, numberOfParens);
- }
- if (parameterizedSingleTypeReference.annotations != null) {
- formatInlineAnnotations(parameterizedSingleTypeReference.annotations[0], false);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
-
- TypeReference[] typeArguments = parameterizedSingleTypeReference.typeArguments;
- int typeArgumentsLength = typeArguments.length;
- if (typeArgumentsLength > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_parameterized_type_reference) {
- this.scribe.space();
- }
- for (int i = 0; i < typeArgumentsLength - 1; i++) {
- typeArguments[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_parameterized_type_reference);
- if (this.preferences.insert_space_after_comma_in_parameterized_type_reference) {
- this.scribe.space();
- }
- }
- typeArguments[typeArgumentsLength - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_parameterized_type_reference);
- }
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_parameterized_type_reference);
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS);
- }
-
- formatLeadingDimensions(parameterizedSingleTypeReference);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(parameterizedSingleTypeReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.PostfixExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- PostfixExpression postfixExpression,
- BlockScope scope) {
-
- final int numberOfParens = (postfixExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(postfixExpression, numberOfParens);
- }
- postfixExpression.lhs.traverse(this, scope);
- int operator = postfixExpression.operator == OperatorIds.PLUS
- ? TerminalTokens.TokenNamePLUS_PLUS : TerminalTokens.TokenNameMINUS_MINUS;
- this.scribe.printNextToken(operator, this.preferences.insert_space_before_postfix_operator);
- if (this.preferences.insert_space_after_postfix_operator) {
- this.scribe.space();
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(postfixExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.PrefixExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(PrefixExpression prefixExpression, BlockScope scope) {
-
- final int numberOfParens = (prefixExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(prefixExpression, numberOfParens);
- }
- int operator = prefixExpression.operator == OperatorIds.PLUS
- ? TerminalTokens.TokenNamePLUS_PLUS : TerminalTokens.TokenNameMINUS_MINUS;
- this.scribe.printNextToken(operator, this.preferences.insert_space_before_prefix_operator);
- if (this.preferences.insert_space_after_prefix_operator) {
- this.scribe.space();
- }
- prefixExpression.lhs.traverse(this, scope);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(prefixExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- QualifiedAllocationExpression qualifiedAllocationExpression,
- BlockScope scope) {
-
- final int numberOfParens = (qualifiedAllocationExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(qualifiedAllocationExpression, numberOfParens);
- }
- final Expression enclosingInstance = qualifiedAllocationExpression.enclosingInstance;
- if (enclosingInstance != null) {
- enclosingInstance.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- }
-
- this.scribe.printNextToken(TerminalTokens.TokenNamenew);
- // used for the new line on wrap style of formatting
- TypeReference[] typeArguments = qualifiedAllocationExpression.typeArguments;
- if (typeArguments != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_arguments);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- int length = typeArguments.length;
- for (int i = 0; i < length - 1; i++) {
- typeArguments[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_arguments);
- if (this.preferences.insert_space_after_comma_in_type_arguments) {
- this.scribe.space();
- }
- }
- typeArguments[length - 1].traverse(this, scope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_arguments);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- } else {
- this.scribe.space();
- }
-
- final int line = this.scribe.line;
- qualifiedAllocationExpression.type.traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_method_invocation);
-
- final Expression[] arguments = qualifiedAllocationExpression.arguments;
- if (arguments != null) {
- if (this.preferences.insert_space_after_opening_paren_in_method_invocation) {
- this.scribe.space();
- }
- int argumentLength = arguments.length;
- Alignment argumentsAlignment =this.scribe.createAlignment(
- Alignment.ALLOCATION,
- this.preferences.alignment_for_arguments_in_qualified_allocation_expression,
- argumentLength,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean ok = false;
- do {
- try {
- for (int i = 0; i < argumentLength; i++) {
- if (i > 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_allocation_expression);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.alignFragment(argumentsAlignment, i);
- if (i > 0 && this.preferences.insert_space_after_comma_in_allocation_expression) {
- this.scribe.space();
- }
- arguments[i].traverse(this, scope);
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(argumentsAlignment, true);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_method_invocation);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_between_empty_parens_in_method_invocation);
- }
- final TypeDeclaration anonymousType = qualifiedAllocationExpression.anonymousType;
- if (anonymousType != null) {
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_anonymous_type_declaration);
- formatAnonymousTypeDeclaration(anonymousType);
- }
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(qualifiedAllocationExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- QualifiedNameReference qualifiedNameReference,
- BlockScope scope) {
-
- final int numberOfParens = (qualifiedNameReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(qualifiedNameReference, numberOfParens);
- }
- this.scribe.printQualifiedReference(qualifiedNameReference.sourceEnd, numberOfParens>=0/*expect parenthesis*/);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(qualifiedNameReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedSuperReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- QualifiedSuperReference qualifiedSuperReference,
- BlockScope scope) {
-
- final int numberOfParens = (qualifiedSuperReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(qualifiedSuperReference, numberOfParens);
- }
- qualifiedSuperReference.qualification.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- this.scribe.printNextToken(TerminalTokens.TokenNamesuper);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(qualifiedSuperReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedThisReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- QualifiedThisReference qualifiedThisReference,
- BlockScope scope) {
-
- final int numberOfParens = (qualifiedThisReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(qualifiedThisReference, numberOfParens);
- }
- qualifiedThisReference.qualification.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameDOT);
- this.scribe.printNextToken(TerminalTokens.TokenNamethis);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(qualifiedThisReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- QualifiedTypeReference qualifiedTypeReference,
- BlockScope scope) {
-
- final int numberOfParens = (qualifiedTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(qualifiedTypeReference, numberOfParens);
- }
- formatQualifiedTypeReference(qualifiedTypeReference);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(qualifiedTypeReference, numberOfParens);
- }
- return false;
- }
-
- private void formatQualifiedTypeReference(QualifiedTypeReference qualifiedTypeReference) {
- for (int i = 0, length = qualifiedTypeReference.tokens.length; i < length; ++i) {
- if (i != 0) this.scribe.printNextToken(TerminalTokens.TokenNameDOT, false);
- if (qualifiedTypeReference.annotations != null) {
- formatInlineAnnotations(qualifiedTypeReference.annotations[i], false);
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
- } else {
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
- }
- }
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(
- QualifiedTypeReference qualifiedTypeReference,
- ClassScope scope) {
-
- final int numberOfParens = (qualifiedTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(qualifiedTypeReference, numberOfParens);
- }
- formatQualifiedTypeReference(qualifiedTypeReference);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(qualifiedTypeReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReferenceExpression referenceExpression, BlockScope blockScope) {
- referenceExpression.lhs.traverse(this, blockScope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOLON_COLON);
-
- TypeReference[] typeArguments = referenceExpression.typeArguments;
- if (typeArguments != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameLESS, this.preferences.insert_space_before_opening_angle_bracket_in_type_arguments);
- if (this.preferences.insert_space_after_opening_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- int length = typeArguments.length;
- for (int i = 0; i < length - 1; i++) {
- typeArguments[i].traverse(this, blockScope);
- this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_type_arguments);
- if (this.preferences.insert_space_after_comma_in_type_arguments) {
- this.scribe.space();
- }
- }
- typeArguments[length - 1].traverse(this, blockScope);
- if (isClosingGenericToken()) {
- this.scribe.printNextToken(CLOSING_GENERICS_EXPECTEDTOKENS, this.preferences.insert_space_before_closing_angle_bracket_in_type_arguments);
- }
- if (this.preferences.insert_space_after_closing_angle_bracket_in_type_arguments) {
- this.scribe.space();
- }
- }
-
- this.scribe.printNextToken(referenceExpression.isMethodReference() ? TerminalTokens.TokenNameIdentifier : TerminalTokens.TokenNamenew);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ReturnStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamereturn);
- final Expression expression = returnStatement.expression;
- if (expression != null) {
- final int numberOfParens = (expression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if ((numberOfParens != 0 && this.preferences.insert_space_before_parenthesized_expression_in_return)
- || numberOfParens == 0) {
- this.scribe.space();
- }
- expression.traverse(this, scope);
- }
- /*
- * Print the semi-colon
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
- public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
- this.scribe.printNextToken(TerminalTokens.TokenNameAT);
- if (this.preferences.insert_space_after_at_in_annotation) {
- this.scribe.space();
- }
- this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/);
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_annotation);
- if (this.preferences.insert_space_after_opening_paren_in_annotation) {
- this.scribe.space();
- }
- annotation.memberValue.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation);
- return false;
- }
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleNameReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(SingleNameReference singleNameReference, BlockScope scope) {
-
- final int numberOfParens = (singleNameReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(singleNameReference, numberOfParens);
- }
- this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(singleNameReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- SingleTypeReference singleTypeReference,
- BlockScope scope) {
-
- final int numberOfParens = (singleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(singleTypeReference, numberOfParens);
- }
- if (singleTypeReference.annotations != null) {
- formatInlineAnnotations(singleTypeReference.annotations[0], false);
- }
- this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(singleTypeReference, numberOfParens);
- }
- return false;
- }
-
- private boolean formatInlineAnnotations(final Annotation[] annotations, boolean spaceBefore) {
- if (annotations != null ) {
- if (spaceBefore) this.scribe.space();
- int length = annotations.length;
- for (int i = 0; i < length; ++i) {
- if (i != 0) this.scribe.space();
- annotations[i].traverse(this, (BlockScope)null);
- }
- if (length > 0 && (!this.isNextTokenPunctuation() || this.isNextToken(TerminalTokens.TokenNameLBRACKET))) {
- this.scribe.space();
- }
- if (this.scribe.formatter.preferences.insert_new_line_after_type_annotation) {
- this.scribe.printNewLine();
- }
- return true;
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(
- SingleTypeReference singleTypeReference,
- ClassScope scope) {
-
- final int numberOfParens = (singleTypeReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(singleTypeReference, numberOfParens);
- }
- if (singleTypeReference.annotations != null) {
- formatInlineAnnotations(singleTypeReference.annotations[0], false);
- }
- this.scribe.printNextToken(SINGLETYPEREFERENCE_EXPECTEDTOKENS);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(singleTypeReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
- final int numberOfParens = (stringLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(stringLiteral, numberOfParens);
- }
- this.scribe.checkNLSTag(stringLiteral.sourceStart);
- this.scribe.printNextToken(TerminalTokens.TokenNameStringLiteral);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(stringLiteral, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.NullLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(StringLiteralConcatenation stringLiteral, BlockScope scope) {
- final int numberOfParens = (stringLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(stringLiteral, numberOfParens);
- }
-
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_IN_STRING_LITERAL_CONCATENATION);
- ASTNode[] fragments = stringLiteral.literals;
- int fragmentsSize = stringLiteral.counter;
- Alignment binaryExpressionAlignment = this.scribe.createAlignment(
- Alignment.STRING_CONCATENATION,
- this.preferences.alignment_for_binary_expression,
- Alignment.R_OUTERMOST,
- fragmentsSize,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(binaryExpressionAlignment);
- boolean ok = false;
- do {
- try {
- for (int i = 0; i < fragmentsSize - 1; i++) {
- ASTNode fragment = fragments[i];
- fragment.traverse(this, scope);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (this.scribe.lastNumberOfNewLines == 1) {
- // a new line has been inserted by printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT)
- this.scribe.indentationLevel = binaryExpressionAlignment.breakIndentationLevel;
- }
- this.scribe.alignFragment(binaryExpressionAlignment, i);
- this.scribe.printNextToken(TerminalTokens.TokenNamePLUS, this.preferences.insert_space_before_binary_operator);
- if (this.preferences.insert_space_after_binary_operator) {
- this.scribe.space();
- }
- }
- fragments[fragmentsSize - 1].traverse(this, scope);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- ok = true;
- } catch(AlignmentException e){
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
- this.scribe.exitAlignment(binaryExpressionAlignment, true);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(stringLiteral, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SuperReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(SuperReference superReference, BlockScope scope) {
-
- final int numberOfParens = (superReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(superReference, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamesuper);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(superReference, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SwitchStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(SwitchStatement switchStatement, BlockScope scope) {
- this.scribe.printNextToken(TerminalTokens.TokenNameswitch);
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_switch);
-
- if (this.preferences.insert_space_after_opening_paren_in_switch) {
- this.scribe.space();
- }
- switchStatement.expression.traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_switch);
- /*
- * Type body
- */
- String switch_brace = this.preferences.brace_position_for_switch;
- formatOpeningBrace(switch_brace, this.preferences.insert_space_before_opening_brace_in_switch);
- this.scribe.printNewLine();
-
- final Statement[] statements = switchStatement.statements;
- int switchIndentationLevel = this.scribe.indentationLevel;
- int caseIndentation = 0;
- int statementIndentation = 0;
- int breakIndentation = 0;
- if (this.preferences.indent_switchstatements_compare_to_switch) {
- caseIndentation++;
- statementIndentation++;
- breakIndentation++;
- }
- if (this.preferences.indent_switchstatements_compare_to_cases) {
- statementIndentation++;
- }
- if (this.preferences.indent_breaks_compare_to_cases) {
- breakIndentation++;
- }
- boolean wasACase = false;
- boolean wasABreak = false;
- if (statements != null) {
- int statementsLength = statements.length;
- for (int i = 0; i < statementsLength; i++) {
- final Statement statement = statements[i];
- if (statement instanceof CaseStatement) {
- if (wasABreak) {
- this.scribe.setIndentation(switchIndentationLevel, caseIndentation);
- this.scribe.printComment();
- } else {
- if (wasACase) {
- this.scribe.printComment(Scribe.PRESERVE_EMPTY_LINES_IN_SWITCH_CASE);
- } else {
- this.scribe.printComment();
- }
- this.scribe.setIndentation(switchIndentationLevel, caseIndentation);
- }
- if (wasACase) {
- this.scribe.printNewLine();
- }
- statement.traverse(this, scope);
- // Print following trailing (if any) comment at statement indentation
- this.scribe.setIndentation(switchIndentationLevel, statementIndentation);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.COMPLEX_TRAILING_COMMENT);
- wasACase = true;
- wasABreak = false;
- } else if (statement instanceof BreakStatement) {
- this.scribe.setIndentation(switchIndentationLevel, breakIndentation);
- if (wasACase) {
- this.scribe.printNewLine();
- }
- this.scribe.printComment();
- statement.traverse(this, scope);
- wasACase = false;
- wasABreak = true;
- } else if (statement instanceof Block) {
- this.scribe.setIndentation(switchIndentationLevel, wasACase ? caseIndentation : statementIndentation);
- this.scribe.printComment();
- String bracePosition = wasACase ? this.preferences.brace_position_for_block_in_case : this.preferences.brace_position_for_block;
- formatBlock((Block) statement, scope, bracePosition, this.preferences.insert_space_before_opening_brace_in_block);
- wasACase = false;
- wasABreak = false;
- } else {
- this.scribe.setIndentation(switchIndentationLevel, statementIndentation);
- this.scribe.printNewLine();
- this.scribe.printComment();
- statement.traverse(this, scope);
- wasACase = false;
- wasABreak = false;
- }
- if (statement instanceof Expression) {
- /*
- * Print the semi-colon
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.printNewLine();
- } else if (statement instanceof LocalDeclaration) {
- LocalDeclaration currentLocal = (LocalDeclaration) statement;
- if (i < (statementsLength - 1)) {
- /*
- * We need to check that the next statement is a local declaration
- */
- if (statements[i + 1] instanceof LocalDeclaration) {
- LocalDeclaration nextLocal = (LocalDeclaration) statements[i + 1];
- if (currentLocal.declarationSourceStart != nextLocal.declarationSourceStart) {
- /*
- * Print the semi-colon
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.printNewLine();
- }
- } else {
- /*
- * Print the semi-colon
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.printNewLine();
- }
- } else {
- /*
- * Print the semi-colon
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- this.scribe.printNewLine();
- }
- } else if (!wasACase) {
- this.scribe.printNewLine();
- }
- }
- }
- this.scribe.printNewLine();
- if (wasABreak) {
- this.scribe.setIndentation(switchIndentationLevel, 0);
- this.scribe.printComment();
- } else {
- this.scribe.printComment();
- this.scribe.setIndentation(switchIndentationLevel, 0);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameRBRACE);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (switch_brace.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
- this.scribe.unIndent();
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- SynchronizedStatement synchronizedStatement,
- BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamesynchronized);
-
- final int line = this.scribe.line;
-
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_synchronized);
-
- if (this.preferences.insert_space_after_opening_paren_in_synchronized) {
- this.scribe.space();
- }
- synchronizedStatement.expression.traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_synchronized);
-
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
- synchronizedStatement.block.traverse(this, scope);
- return false;
- }
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ThisReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ThisReference thisReference, BlockScope scope) {
-
- if (!thisReference.isImplicitThis()) {
- final int numberOfParens = (thisReference.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(thisReference, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamethis);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(thisReference, numberOfParens);
- }
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.ThrowStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(ThrowStatement throwStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamethrow);
- Expression expression = throwStatement.exception;
- final int numberOfParens = (expression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if ((numberOfParens > 0 && this.preferences.insert_space_before_parenthesized_expression_in_throw)
- || numberOfParens == 0) {
- this.scribe.space();
- }
- expression.traverse(this, scope);
- /*
- * Print the semi-colon
- */
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(TrueLiteral trueLiteral, BlockScope scope) {
-
- final int numberOfParens = (trueLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(trueLiteral, numberOfParens);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNametrue);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(trueLiteral, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.TryStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(TryStatement tryStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNametry);
- formatTryResources(
- tryStatement,
- this.preferences.insert_space_before_opening_paren_in_try,
- this.preferences.insert_space_before_closing_paren_in_try,
- this.preferences.insert_space_after_opening_paren_in_try,
- this.preferences.insert_space_before_semicolon_in_try_resources,
- this.preferences.insert_space_after_semicolon_in_try_resources,
- this.preferences.alignment_for_resources_in_try);
- tryStatement.tryBlock.traverse(this, scope);
- if (tryStatement.catchArguments != null) {
- for (int i = 0, max = tryStatement.catchBlocks.length; i < max; i++) {
- if (this.preferences.insert_new_line_before_catch_in_try_statement) {
- this.scribe.printNewLine();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamecatch, this.preferences.insert_space_after_closing_brace_in_block);
- final int line = this.scribe.line;
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_catch);
-
- if (this.preferences.insert_space_after_opening_paren_in_catch) {
- this.scribe.space();
- }
- tryStatement.catchArguments[i].traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_catch);
-
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
- tryStatement.catchBlocks[i].traverse(this, scope);
- }
- }
- if (tryStatement.finallyBlock != null) {
- if (this.preferences.insert_new_line_before_finally_in_try_statement) {
- this.scribe.printNewLine();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNamefinally, this.preferences.insert_space_after_closing_brace_in_block);
- tryStatement.finallyBlock.traverse(this, scope);
- }
- return false;
- }
-
- private void formatMultiCatchArguments(Argument argument,
- boolean spaceBeforePipe,
- boolean spaceAfterPipe,
- int multiCatchAlignment,
- BlockScope scope) {
- UnionTypeReference unionType = (UnionTypeReference) argument.type;
- int length = unionType.typeReferences != null ? unionType.typeReferences.length : 0;
- if (length > 0) {
- Alignment argumentsAlignment = this.scribe.createAlignment(
- Alignment.MULTI_CATCH,
- multiCatchAlignment,
- length,
- this.scribe.scanner.currentPosition);
- this.scribe.enterAlignment(argumentsAlignment);
- boolean ok = false;
- do {
- switch (multiCatchAlignment & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT:
- case Alignment.M_NEXT_PER_LINE_SPLIT:
- argumentsAlignment.startingColumn = this.scribe.column;
- break;
- }
- try {
- for (int i = 0; i < length; i++) {
- if (i > 0) {
- if (this.preferences.wrap_before_or_operator_multicatch) {
- this.scribe.alignFragment(argumentsAlignment, i);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameOR, spaceBeforePipe);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- if (this.scribe.lastNumberOfNewLines == 1) {
- // a new line has been inserted while printing the comment
- // hence we need to use the break indentation level before printing next token...
- this.scribe.indentationLevel = argumentsAlignment.breakIndentationLevel;
- }
- if (!this.preferences.wrap_before_or_operator_multicatch) {
- this.scribe.alignFragment(argumentsAlignment, i);
- }
- }
- if (i == 0) {
- this.scribe.alignFragment(argumentsAlignment, i);
- int fragmentIndentation = argumentsAlignment.fragmentIndentations[0];
- if ((argumentsAlignment.mode & Alignment.M_INDENT_ON_COLUMN) != 0 && fragmentIndentation > 0) {
- this.scribe.indentationLevel = fragmentIndentation;
- }
- } else if (spaceAfterPipe) {
- this.scribe.space();
- }
- unionType.typeReferences[i].traverse(this, scope);
- argumentsAlignment.startingColumn = -1;
- }
- ok = true;
- } catch (AlignmentException e) {
- this.scribe.redoAlignment(e);
- }
- } while (!ok);
-
- this.scribe.exitAlignment(argumentsAlignment, true);
- }
-
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- TypeDeclaration localTypeDeclaration,
- BlockScope scope) {
-
- format(localTypeDeclaration);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope)
- */
- public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) {
- format(memberTypeDeclaration);
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope)
- */
- public boolean visit(
- TypeDeclaration typeDeclaration,
- CompilationUnitScope scope) {
-
- format(typeDeclaration);
- return false;
- }
- public boolean visit(TypeParameter typeParameter, BlockScope scope) {
- if (typeParameter.annotations != null) {
- formatInlineAnnotations(typeParameter.annotations, false);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
- if (typeParameter.type != null) {
- this.scribe.space();
- this.scribe.printNextToken(TerminalTokens.TokenNameextends, true);
- this.scribe.space();
- typeParameter.type.traverse(this, scope);
- }
- final TypeReference[] bounds = typeParameter.bounds;
- if (bounds != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter);
- if (this.preferences.insert_space_after_and_in_type_parameter) {
- this.scribe.space();
- }
- int boundsLength = bounds.length;
- for (int i = 0; i < boundsLength - 1; i++) {
- bounds[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter);
- if (this.preferences.insert_space_after_and_in_type_parameter) {
- this.scribe.space();
- }
- }
- bounds[boundsLength - 1].traverse(this, scope);
- }
- return false;
- }
- public boolean visit(TypeParameter typeParameter, ClassScope scope) {
- if (typeParameter.annotations != null) {
- formatInlineAnnotations(typeParameter.annotations, false);
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier);
- if (typeParameter.type != null) {
- this.scribe.space();
- this.scribe.printNextToken(TerminalTokens.TokenNameextends, true);
- this.scribe.space();
- typeParameter.type.traverse(this, scope);
- }
- final TypeReference[] bounds = typeParameter.bounds;
- if (bounds != null) {
- this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter);
- if (this.preferences.insert_space_after_and_in_type_parameter) {
- this.scribe.space();
- }
- int boundsLength = bounds.length;
- for (int i = 0; i < boundsLength - 1; i++) {
- bounds[i].traverse(this, scope);
- this.scribe.printNextToken(TerminalTokens.TokenNameAND, this.preferences.insert_space_before_and_in_type_parameter);
- if (this.preferences.insert_space_after_and_in_type_parameter) {
- this.scribe.space();
- }
- }
- bounds[boundsLength - 1].traverse(this, scope);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.UnaryExpression, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(UnaryExpression unaryExpression, BlockScope scope) {
-
- final int numberOfParens = (unaryExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParens > 0) {
- manageOpeningParenthesizedExpression(unaryExpression, numberOfParens);
- }
-
- /*
- * Print the operator
- */
- int operator;
- int operatorValue = (unaryExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT;
- switch(operatorValue) {
- case OperatorIds.PLUS:
- operator = TerminalTokens.TokenNamePLUS;
- break;
- case OperatorIds.MINUS:
- operator = TerminalTokens.TokenNameMINUS;
- break;
- case OperatorIds.TWIDDLE:
- operator = TerminalTokens.TokenNameTWIDDLE;
- break;
- default:
- operator = TerminalTokens.TokenNameNOT;
- }
-
- this.scribe.printNextToken(operator, this.preferences.insert_space_before_unary_operator);
- if (this.preferences.insert_space_after_unary_operator) {
- this.scribe.space();
- }
- Expression expression = unaryExpression.expression;
-
- if (expression instanceof PrefixExpression) {
- PrefixExpression prefixExpression = (PrefixExpression) expression;
- final int numberOfParensForExpression = (prefixExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParensForExpression == 0) {
- switch(operatorValue) {
- case OperatorIds.PLUS:
- if (prefixExpression.operator == OperatorIds.PLUS) {
- this.scribe.space();
- }
- break;
- case OperatorIds.MINUS:
- if (prefixExpression.operator == OperatorIds.MINUS) {
- this.scribe.space();
- }
- break;
- }
- }
- } else if (expression instanceof UnaryExpression) {
- UnaryExpression unaryExpression2 = (UnaryExpression) expression;
- final int numberOfParensForExpression = (unaryExpression2.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
- if (numberOfParensForExpression == 0) {
- int operatorValue2 = (unaryExpression2.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT;
- switch(operatorValue) {
- case OperatorIds.PLUS:
- if (operatorValue2 == OperatorIds.PLUS) {
- this.scribe.space();
- }
- break;
- case OperatorIds.MINUS:
- if (operatorValue2 == OperatorIds.MINUS) {
- this.scribe.space();
- }
- break;
- }
- }
- }
- expression.traverse(this, scope);
-
- if (numberOfParens > 0) {
- manageClosingParenthesizedExpression(unaryExpression, numberOfParens);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.UnionTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- UnionTypeReference unionTypeReference,
- BlockScope scope) {
-
- TypeReference[] typeReferences = unionTypeReference.typeReferences;
- for (int i = 0, max = typeReferences.length; i < max; i++) {
- if (i != 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameOR, true);
- this.scribe.space();
- }
- typeReferences[i].traverse(this, scope);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.UnionTypeReference, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(
- UnionTypeReference unionTypeReference,
- ClassScope scope) {
-
- TypeReference[] typeReferences = unionTypeReference.typeReferences;
- for (int i = 0, max = typeReferences.length; i < max; i++) {
- if (i != 0) {
- this.scribe.printNextToken(TerminalTokens.TokenNameOR, true);
- this.scribe.space();
- }
- typeReferences[i].traverse(this, scope);
- }
- return false;
- }
-
- /**
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.aspectj.org.eclipse.jdt.internal.compiler.ast.WhileStatement, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope)
- */
- public boolean visit(WhileStatement whileStatement, BlockScope scope) {
-
- this.scribe.printNextToken(TerminalTokens.TokenNamewhile);
- final int line = this.scribe.line;
- this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_while);
-
- if (this.preferences.insert_space_after_opening_paren_in_while) {
- this.scribe.space();
- }
- whileStatement.condition.traverse(this, scope);
-
- this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_while);
-
- final Statement action = whileStatement.action;
- if (action != null) {
- if (action instanceof Block) {
- formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
- action.traverse(this, scope);
- } else if (action instanceof EmptyStatement) {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- } else {
- this.scribe.printNewLine();
- this.scribe.indent();
- action.traverse(this, scope);
- if (action instanceof Expression) {
- this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
- this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
- }
- this.scribe.unIndent();
- }
- } else {
- /*
- * This is an empty statement
- */
- formatNecessaryEmptyStatement();
- }
- return false;
- }
- public boolean visit(Wildcard wildcard, BlockScope scope) {
- if (wildcard.annotations != null) {
- if (formatInlineAnnotations(wildcard.annotations[0], false)) this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameQUESTION, this.preferences.insert_space_before_question_in_wilcard);
- switch(wildcard.kind) {
- case Wildcard.SUPER :
- this.scribe.printNextToken(TerminalTokens.TokenNamesuper, true);
- this.scribe.space();
- wildcard.bound.traverse(this, scope);
- break;
- case Wildcard.EXTENDS :
- this.scribe.printNextToken(TerminalTokens.TokenNameextends, true);
- this.scribe.space();
- wildcard.bound.traverse(this, scope);
- break;
- case Wildcard.UNBOUND :
- if (this.preferences.insert_space_after_question_in_wilcard) {
- this.scribe.space();
- }
- }
- return false;
- }
- public boolean visit(Wildcard wildcard, ClassScope scope) {
- if (wildcard.annotations != null) {
- if (formatInlineAnnotations(wildcard.annotations[0], false)) this.scribe.space();
- }
- this.scribe.printNextToken(TerminalTokens.TokenNameQUESTION, this.preferences.insert_space_before_question_in_wilcard);
- switch(wildcard.kind) {
- case Wildcard.SUPER :
- this.scribe.printNextToken(TerminalTokens.TokenNamesuper, true);
- this.scribe.space();
- wildcard.bound.traverse(this, scope);
- break;
- case Wildcard.EXTENDS :
- this.scribe.printNextToken(TerminalTokens.TokenNameextends, true);
- this.scribe.space();
- wildcard.bound.traverse(this, scope);
- break;
- case Wildcard.UNBOUND :
- if (this.preferences.insert_space_after_question_in_wilcard) {
- this.scribe.space();
- }
- }
- return false;
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CommentsPreparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
new file mode 100644
index 0000000..bed1d5d
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
@@ -0,0 +1,1231 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] IndexOutOfBoundsException in TokenManager - https://bugs.eclipse.org/462945
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameLBRACE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameNotAToken;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameRBRACE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameRPAREN;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameStringLiteral;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameWHITESPACE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNamepackage;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTVisitor;
+import org.aspectj.org.eclipse.jdt.core.dom.BlockComment;
+import org.aspectj.org.eclipse.jdt.core.dom.Javadoc;
+import org.aspectj.org.eclipse.jdt.core.dom.LineComment;
+import org.aspectj.org.eclipse.jdt.core.dom.MemberRef;
+import org.aspectj.org.eclipse.jdt.core.dom.MethodRef;
+import org.aspectj.org.eclipse.jdt.core.dom.TagElement;
+import org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter;
+import org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token.WrapPolicy;
+
+public class CommentsPreparator extends ASTVisitor {
+
+ public static final int COMMENT_LINE_SEPARATOR_LENGTH = 3;
+
+ private final static Pattern NLS_TAG_PATTERN = Pattern.compile("//\\$NON-NLS-([0-9]+)\\$"); //$NON-NLS-1$
+ private final static Pattern STRING_LITERAL_PATTERN = Pattern.compile("\".*?(\\\\(\\\\\\\\)*\".*?)*\""); //$NON-NLS-1$
+ private final static Pattern HTML_TAG_PATTERN;
+ private final static Pattern HTML_ATTRIBUTE_PATTERN;
+ static {
+ String formatCodeTags = "(pre)?"; //$NON-NLS-1$
+ String separateLineTags = "(dl|hr|nl|p|ul|ol|table|tr)?"; //$NON-NLS-1$
+ String breakBeforeTags = "(dd|dt|li|td|th|h1|h2|h3|h4|h5|h6|q)?"; //$NON-NLS-1$
+ String breakAfterTags = "(br)?"; //$NON-NLS-1$
+ String noFormatTags = "(code|em|tt)?"; //$NON-NLS-1$
+ String otherTags = "([^<>&&\\S]+)??"; //$NON-NLS-1$
+ String ws = "(?:[ \\t]+|[\\r\\n]+[ \\t]*\\*?)"; // whitespace or line break with optional asterisk //$NON-NLS-1$
+ String attribute = "(?:" + ws + "+[^=&&\\S]+" + ws + "*(=)" + ws + "*\"?[^\"]*\"?)"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ HTML_TAG_PATTERN = Pattern.compile("<(/)?" //$NON-NLS-1$
+ + formatCodeTags + separateLineTags + breakBeforeTags + breakAfterTags + noFormatTags + otherTags
+ + "(" + attribute + "*)" + ws + "*/?>", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ HTML_ATTRIBUTE_PATTERN = Pattern.compile(attribute);
+ }
+
+ private final static Pattern HTML_ENTITY_PATTERN = Pattern
+ .compile("&(#x[0-9a-fA-F]+)?(#[0-9]+)?(lt)?(gt)?(nbsp)?(amp)?(circ)?(tilde)?(quot)?;"); //$NON-NLS-1$
+ private final static String HTML_ENTITY_REPLACE = " <> &^~\""; //$NON-NLS-1$
+
+ // Param tags list copied from IJavaDocTagConstants in legacy formatter for compatibility.
+ // There were the following comments:
+ // TODO (frederic) should have another name than 'param' for the following tags
+ // TODO (frederic) investigate how and why this list was created
+ private final static List<String> PARAM_TAGS = Arrays.asList(
+ "@param", //$NON-NLS-1$
+ "@exception", //$NON-NLS-1$
+ "@serialField", //$NON-NLS-1$
+ "@throws"); //$NON-NLS-1$
+
+ private final static List<String> IMMUTABLE_TAGS = Arrays.asList("@code", "@literal"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private final static int[] NO_INDENT_AFTER_COMMENT = { TokenNameRPAREN, TokenNameLBRACE, TokenNameRBRACE };
+ static {
+ Arrays.sort(NO_INDENT_AFTER_COMMENT);
+ }
+
+ private final TokenManager tm;
+ private final DefaultCodeFormatterOptions options;
+ private final String sourceLevel;
+ private final String formatDisableTag;
+ private final String formatEnableTag;
+
+ private Token lastLineComment;
+ private int lastLineCommentPosition;
+
+ private Token lastFormatOffComment;
+
+ private TokenManager ctm;
+ private List<Token> commentStructure;
+ private int commentIndent;
+ /** Index: position within current comment; Value: whether wrapping on special characters is allowed */
+ private boolean[] noSubstituteWrapping;
+
+ private int noFormatTagOpenStart = -1;
+ private int formatCodeTagOpenEnd = -1;
+ private int lastFormatCodeClosingTagIndex = -1;
+ private Token firstTagToken;
+ private DefaultCodeFormatter commentCodeFormatter;
+
+ public CommentsPreparator(TokenManager tm, DefaultCodeFormatterOptions options, String sourceLevel) {
+ this.tm = tm;
+ this.options = options;
+ this.sourceLevel = sourceLevel;
+ this.formatDisableTag = options.disabling_tag != null ? new String(options.disabling_tag) : null;
+ this.formatEnableTag = options.enabling_tag != null ? new String(options.enabling_tag) : null;
+ }
+
+ @Override
+ public boolean preVisit2(ASTNode node) {
+ boolean isMalformed = (node.getFlags() & ASTNode.MALFORMED) != 0;
+ return !isMalformed;
+ }
+
+ @Override
+ public boolean visit(LineComment node) {
+ int commentIndex = this.tm.firstIndexIn(node, TokenNameCOMMENT_LINE);
+ handleLineComment(commentIndex);
+ return true;
+ }
+
+ public void handleLineComment(int commentIndex) {
+ Token commentToken = this.tm.get(commentIndex);
+
+ boolean isOnFirstColumn = handleWhitespaceAround(commentIndex);
+
+ if (handleFormatOnOffTags(commentToken))
+ return;
+
+ if (isOnFirstColumn) {
+ if (this.options.comment_format_line_comment
+ && !this.options.comment_format_line_comment_starting_on_first_column) {
+ this.lastLineComment = null;
+ commentToken.setIndent(0);
+ commentToken.setWrapPolicy(null);
+ return;
+ }
+ if (this.options.never_indent_line_comments_on_first_column) {
+ commentToken.setIndent(0);
+ commentToken.setWrapPolicy(null);
+ }
+ }
+
+ handleNLSTags(commentToken, commentIndex);
+
+ int positionInLine = this.tm.findSourcePositionInLine(commentToken.originalStart);
+ boolean isContinuation = commentIndex > 0 && this.tm.get(commentIndex - 1) == this.lastLineComment
+ && (positionInLine >= this.lastLineCommentPosition - this.options.indentation_size + 1)
+ && this.tm.countLineBreaksBetween(this.lastLineComment, commentToken) == 1;
+
+ boolean isHeader = this.tm.isInHeader(commentIndex);
+ boolean formattingEnabled = (this.options.comment_format_line_comment && !isHeader)
+ || (this.options.comment_format_header && isHeader);
+ if (!formattingEnabled) {
+ preserveWhitespace(commentToken, commentIndex);
+ if (isContinuation) {
+ WrapPolicy policy = this.lastLineComment.getWrapPolicy();
+ if (policy == null) {
+ int lineStart = this.tm.getPositionInLine(this.tm.findFirstTokenInLine(commentIndex - 1));
+ int commentStart = this.tm.getPositionInLine(commentIndex - 1);
+ policy = new WrapPolicy(commentStart - lineStart, commentIndex - 1, true);
+ }
+ commentToken.setWrapPolicy(policy);
+ this.lastLineComment = commentToken;
+ } else if (commentToken.getLineBreaksBefore() == 0) {
+ this.lastLineComment = commentToken;
+ this.lastLineCommentPosition = positionInLine;
+ }
+ return;
+ }
+
+ List<Token> structure = tokenizeLineComment(commentToken);
+ if (isContinuation) {
+ Token first = structure.get(0);
+ first.breakBefore();
+ first.setWrapPolicy(new WrapPolicy(this.lastLineCommentPosition, commentIndex - 1, false));
+
+ // merge previous and current line comment
+ Token previous = this.lastLineComment;
+ Token merged = new Token(previous, previous.originalStart, commentToken.originalEnd, previous.tokenType);
+ this.tm.remove(commentIndex - 1);
+ this.tm.insert(commentIndex - 1, merged);
+ this.tm.remove(commentIndex);
+ List<Token> lastStructure = this.lastLineComment.getInternalStructure();
+ lastStructure.addAll(structure);
+ structure = lastStructure;
+ commentToken = merged;
+ } else {
+ this.lastLineCommentPosition = positionInLine;
+ }
+ commentToken.setInternalStructure(structure);
+ preserveWhitespace(commentToken, commentIndex);
+ this.lastLineComment = commentToken;
+ }
+
+ private void preserveWhitespace(Token commentToken, int commentIndex) {
+ if (this.options.comment_preserve_white_space_between_code_and_line_comments
+ && commentToken.getLineBreaksBefore() == 0 && commentIndex > 0) {
+ commentToken.clearSpaceBefore();
+ List<Token> structure = commentToken.getInternalStructure();
+ if (structure != null && !structure.isEmpty())
+ structure.get(0).clearSpaceBefore();
+
+ Token previous = this.tm.get(commentIndex - 1);
+ if (previous.originalEnd + 1 >= commentToken.originalStart)
+ return;
+ if (structure == null || structure.isEmpty()) {
+ structure = new ArrayList<Token>();
+ structure.add(new Token(previous.originalEnd + 1, commentToken.originalEnd, TokenNameCOMMENT_LINE));
+ } else {
+ structure.add(0, new Token(previous.originalEnd + 1, commentToken.originalStart - 1,
+ TokenNameWHITESPACE));
+ }
+ }
+ }
+
+ /**
+ * @return true if the comment contains on/off tag and should not be formatted
+ */
+ private boolean handleFormatOnOffTags(Token commentToken) {
+ if (!this.options.use_tags)
+ return false;
+ String commentString = this.tm.toString(commentToken);
+ int offIndex = this.formatDisableTag != null ? commentString.lastIndexOf(this.formatDisableTag) : -1;
+ int onIndex = this.formatEnableTag != null ? commentString.lastIndexOf(this.formatEnableTag) : -1;
+ if (this.lastFormatOffComment == null) {
+ if (offIndex > onIndex)
+ this.lastFormatOffComment = commentToken;
+ } else {
+ if (onIndex > offIndex) {
+ this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, commentToken);
+ this.lastFormatOffComment = null;
+ }
+ }
+ return offIndex >= 0 || onIndex >= 0;
+ }
+
+ private void handleNLSTags(Token comment, int commentIndex) {
+ List<Token> stringLiterals = findStringLiteralsInLine(commentIndex);
+ if (stringLiterals.isEmpty())
+ return;
+
+ List<Token> commentFragments = new ArrayList<Token>();
+ Matcher matcher = NLS_TAG_PATTERN.matcher(this.tm.toString(comment));
+ int previousMatcherEnd = 0;
+ boolean nlsFound = false;
+ while (matcher.find()) {
+ int nlsNumber = Integer.parseInt(matcher.group(1));
+ if (nlsNumber > 0 && nlsNumber <= stringLiterals.size()) {
+ if (matcher.start() > previousMatcherEnd) {
+ Token fragment = new Token(comment.originalStart + previousMatcherEnd,
+ comment.originalStart + matcher.start() - 1, TokenNameCOMMENT_LINE);
+ commentFragments.add(fragment);
+ }
+ Token nlsTag = new Token(comment.originalStart + matcher.start(),
+ comment.originalStart + matcher.end() - 1, TokenNameCOMMENT_LINE);
+ stringLiterals.get(nlsNumber - 1).setNLSTag(nlsTag);
+ nlsTag.setNLSTag(stringLiterals.get(nlsNumber - 1));
+ commentFragments.add(nlsTag);
+ nlsFound = true;
+ previousMatcherEnd = matcher.end();
+ }
+ }
+ if (nlsFound) {
+ comment.setInternalStructure(commentFragments);
+ if (comment.originalStart + previousMatcherEnd <= comment.originalEnd) {
+ Token fragment = new Token(comment.originalStart + previousMatcherEnd, comment.originalEnd,
+ TokenNameCOMMENT_LINE);
+ commentFragments.add(fragment);
+ }
+ }
+ }
+
+ private List<Token> findStringLiteralsInLine(int lastTokenIndex) {
+ List<Token> stringLiterals = new ArrayList<Token>();
+ Token previous = this.tm.get(lastTokenIndex);
+ for (int i = lastTokenIndex - 1; i >= 0; i--) {
+ Token token = this.tm.get(i);
+ if (this.tm.countLineBreaksBetween(token, previous) > 0)
+ break;
+ if (token.tokenType == TokenNameStringLiteral)
+ stringLiterals.add(token);
+ previous = token;
+ }
+ Collections.reverse(stringLiterals);
+ return stringLiterals;
+ }
+
+ private List<Token> tokenizeLineComment(Token commentToken) {
+ List<Token> fragments = commentToken.getInternalStructure();
+ if (fragments == null) {
+ fragments = Arrays.asList(commentToken);
+ }
+ ArrayList<Token> result = new ArrayList<Token>();
+ for (int i = 0; i < fragments.size(); i++) {
+ Token token = fragments.get(i);
+ if (token.hasNLSTag()) {
+ if (ScannerHelper.isWhitespace(this.tm.charAt(token.originalStart - 1)))
+ token.spaceBefore();
+ result.add(token);
+ continue;
+ }
+ int sourcePosition = token.originalStart;
+ if (sourcePosition == commentToken.originalStart) {
+ // separate starting slashes
+ while (sourcePosition <= token.originalEnd && this.tm.charAt(sourcePosition) == '/')
+ sourcePosition++;
+ result.add(new Token(commentToken.originalStart, sourcePosition - 1, TokenNameCOMMENT_LINE));
+ }
+ int tokenStart = sourcePosition;
+ while (sourcePosition <= token.originalEnd + 1) {
+ if (sourcePosition == token.originalEnd + 1
+ || ScannerHelper.isWhitespace(this.tm.charAt(sourcePosition))) {
+ if (tokenStart < sourcePosition) {
+ Token outputToken = new Token(tokenStart, sourcePosition - 1, TokenNameCOMMENT_LINE);
+ outputToken.spaceBefore();
+ result.add(outputToken);
+ }
+ tokenStart = sourcePosition + 1;
+ }
+ sourcePosition++;
+ }
+ }
+
+ if (this.tm.getSource().startsWith("$FALL-THROUGH$", result.get(0).originalEnd + 1)) { //$NON-NLS-1$
+ result.get(1).clearSpaceBefore();
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean visit(BlockComment node) {
+ int commentIndex = this.tm.firstIndexIn(node, TokenNameCOMMENT_BLOCK);
+ handleBlockComment(commentIndex);
+
+ return true;
+ }
+
+ public void handleBlockComment(int commentIndex) {
+ Token commentToken = this.tm.get(commentIndex);
+ boolean isFirstColumn = handleWhitespaceAround(commentIndex);
+
+ if (handleFormatOnOffTags(commentToken))
+ return;
+
+ boolean isHeader = this.tm.isInHeader(commentIndex);
+ boolean formattingEnabled = (this.options.comment_format_block_comment && !isHeader)
+ || (this.options.comment_format_header && isHeader);
+ formattingEnabled = formattingEnabled && this.tm.charAt(commentToken.originalStart + 2) != '-';
+ if (formattingEnabled && tokenizeMultilineComment(commentToken)) {
+ this.commentStructure = commentToken.getInternalStructure();
+ this.ctm = new TokenManager(this.commentStructure, this.tm);
+ handleStringLiterals(this.tm.toString(commentToken), commentToken.originalStart);
+ addSubstituteWraps();
+ } else {
+ commentToken.setInternalStructure(commentToLines(commentToken, -1));
+ }
+
+ if (this.options.never_indent_block_comments_on_first_column && isFirstColumn) {
+ commentToken.setIndent(0);
+ commentToken.setWrapPolicy(null);
+ }
+ }
+
+ private boolean handleWhitespaceAround(int commentIndex) {
+ Token commentToken = this.tm.get(commentIndex);
+ char charBefore = commentToken.originalStart > 0 ? this.tm.charAt(commentToken.originalStart - 1) : 0;
+ if (charBefore == ' ' || charBefore == '\t')
+ commentToken.spaceBefore();
+
+ if (commentToken.originalEnd < this.tm.getSourceLength() - 1) {
+ char charAfter = this.tm.charAt(commentToken.originalEnd + 1);
+ if (charAfter == ' ' || charAfter == '\t')
+ commentToken.spaceAfter();
+ }
+
+ Token previous = null, next = null;
+ int existingBreaksBefore = 2, existingBreaksAfter = 2;
+ if (commentIndex > 0) {
+ previous = this.tm.get(commentIndex - 1);
+ existingBreaksBefore = this.tm.countLineBreaksBetween(previous, commentToken);
+ if (existingBreaksBefore > 0) {
+ commentToken.breakBefore();
+ commentToken.clearSpaceBefore();
+ }
+ }
+ if (commentIndex < this.tm.size() - 1) {
+ next = this.tm.get(commentIndex + 1);
+ existingBreaksAfter = this.tm.countLineBreaksBetween(commentToken, next);
+ if (existingBreaksAfter > 0)
+ commentToken.breakAfter();
+ }
+
+ if (existingBreaksBefore <= 1
+ && (previous.tokenType == TokenNameCOMMENT_LINE || previous.tokenType == TokenNameCOMMENT_BLOCK)) {
+ commentToken.setWrapPolicy(previous.getWrapPolicy());
+ } else {
+ int i = commentIndex + 2;
+ while (existingBreaksAfter <= 1 && i < this.tm.size()
+ && (next.tokenType == TokenNameCOMMENT_LINE || next.tokenType == TokenNameCOMMENT_BLOCK)) {
+ Token next2 = this.tm.get(i++);
+ existingBreaksAfter = this.tm.countLineBreaksBetween(next, next2);
+ next = next2;
+ }
+
+ if (previous != null && previous.getLineBreaksAfter() == 0
+ && next != null && next.getLineBreaksBefore() == 0
+ && Arrays.binarySearch(NO_INDENT_AFTER_COMMENT, next.tokenType) < 0) {
+ int policyIndent = (commentToken.getIndent() - previous.getIndent());
+ WrapPolicy wrapPolicy = new WrapPolicy(policyIndent, commentIndex - 1, true);
+ if (this.tm.countLineBreaksBetween(previous, commentToken) == 1)
+ commentToken.setWrapPolicy(wrapPolicy);
+ if (this.tm.countLineBreaksBetween(commentToken, next) == 1)
+ next.setWrapPolicy(wrapPolicy);
+ }
+
+ if (existingBreaksBefore < existingBreaksAfter && previous != null) {
+ commentToken.putLineBreaksAfter(previous.getLineBreaksAfter());
+ previous.clearLineBreaksAfter();
+ } else if (existingBreaksAfter <= existingBreaksBefore && next != null
+ && next.tokenType != TokenNamepackage /* doesn't apply to a comment before the package declaration */) {
+ commentToken.putLineBreaksBefore(next.getLineBreaksBefore());
+ next.clearLineBreaksBefore();
+ }
+ }
+
+ boolean isFirstColumn = (charBefore == '\r' || charBefore == '\n' || commentToken.originalStart == 0);
+ return isFirstColumn;
+ }
+
+ private List<Token> commentToLines(Token commentToken, int commentStartPositionInLine) {
+ List<Token> lines = new ArrayList<Token>();
+
+ int tab = this.options.tab_size;
+ String commentText = this.tm.toString(commentToken);
+ int commentStartPosition = commentStartPositionInLine;
+ if (commentStartPosition < 0)
+ commentStartPosition = this.tm.findSourcePositionInLine(commentToken.originalStart);
+ int positionInLine = commentStartPosition;
+ int lineStart = 0;
+ int breaksBeforeFirstLine = 0;
+ boolean firstLine = true; // all lines except first will be NotAToken to disable asterisk adding
+ boolean emptyLine = true;
+
+ for (int i = 0; i < commentText.length(); i++) {
+ char c = commentText.charAt(i);
+ switch (c) {
+ case ' ':
+ if ((lineStart == i && positionInLine < commentStartPosition)
+ || (emptyLine && positionInLine == commentToken.getIndent() - 1))
+ lineStart = i + 1;
+ positionInLine++;
+ break;
+ case '\t':
+ if ((lineStart == i && positionInLine < commentStartPosition)
+ || (emptyLine && positionInLine == commentToken.getIndent() - 1))
+ lineStart = i + 1;
+ if (tab > 0)
+ positionInLine += tab - positionInLine % tab;
+ break;
+ case '\r':
+ case '\n':
+ if (lineStart < i) {
+ Token line = new Token(commentToken.originalStart + lineStart,
+ commentToken.originalStart + i - 1,
+ firstLine ? commentToken.tokenType : TokenNameNotAToken);
+ line.breakAfter();
+ if (lines.isEmpty())
+ line.putLineBreaksBefore(breaksBeforeFirstLine);
+ lines.add(line);
+ } else if (!lines.isEmpty()) {
+ Token previousLine = lines.get(lines.size() - 1);
+ previousLine.putLineBreaksAfter(previousLine.getLineBreaksAfter() + 1);
+ } else {
+ breaksBeforeFirstLine++;
+ }
+ if (i + 1 < commentText.length() && commentText.charAt(i + 1) == (c == '\r' ? '\n' : '\r'))
+ i++;
+ lineStart = i + 1;
+ positionInLine = 0;
+ firstLine = false;
+ emptyLine = true;
+ break;
+ default:
+ positionInLine++;
+ emptyLine = false;
+ }
+ }
+ if (lineStart < commentText.length()) {
+ Token line = new Token(commentToken.originalStart + lineStart, commentToken.originalEnd,
+ firstLine ? commentToken.tokenType : TokenNameNotAToken);
+ line.setWrapPolicy(WrapPolicy.DISABLE_WRAP);
+ lines.add(line);
+ }
+ return lines;
+ }
+
+ @Override
+ public boolean visit(Javadoc node) {
+ this.noFormatTagOpenStart = -1;
+ this.formatCodeTagOpenEnd = -1;
+ this.lastFormatCodeClosingTagIndex = -1;
+ this.firstTagToken = null;
+ this.ctm = null;
+
+ int commentIndex = this.tm.firstIndexIn(node, TokenNameCOMMENT_JAVADOC);
+ Token commentToken = this.tm.get(commentIndex);
+
+ if (node.getParent() == null) {
+ // not a proper javadoc, treat as block comment
+ handleWhitespaceAround(commentIndex);
+ }
+ if (commentIndex < this.tm.size() - 1)
+ commentToken.breakAfter();
+
+ if (handleFormatOnOffTags(commentToken))
+ return false;
+
+ boolean isHeader = this.tm.isInHeader(commentIndex);
+ boolean formattingEnabled = (this.options.comment_format_javadoc_comment && !isHeader)
+ || (this.options.comment_format_header && isHeader);
+ if (!formattingEnabled || !tokenizeMultilineComment(commentToken)) {
+ commentToken.setInternalStructure(commentToLines(commentToken, -1));
+ return false;
+ }
+ this.commentStructure = commentToken.getInternalStructure();
+ this.commentIndent = this.tm.toIndent(commentToken.getIndent(), true);
+ this.ctm = new TokenManager(commentToken.getInternalStructure(), this.tm);
+ return true;
+ }
+
+ @Override
+ public void endVisit(Javadoc node) {
+ if (this.ctm == null)
+ return;
+ if (this.options.comment_insert_empty_line_before_root_tags && this.firstTagToken != null
+ && this.ctm.indexOf(this.firstTagToken) > 1) {
+ this.firstTagToken.putLineBreaksBefore(2);
+ }
+ addSubstituteWraps();
+ }
+
+ @Override
+ public boolean visit(TagElement node) {
+ String tagName = node.getTagName();
+ if (tagName == null || tagName.length() <= 1)
+ return true;
+
+ int startIndex = tokenStartingAt(node.getStartPosition());
+ int nodeEnd = node.getStartPosition() + node.getLength() - 1;
+ while (ScannerHelper.isWhitespace(this.ctm.charAt(nodeEnd)))
+ nodeEnd--;
+ int endIndex = tokenEndingAt(nodeEnd);
+
+ this.ctm.get(startIndex + 1).setWrapPolicy(WrapPolicy.DISABLE_WRAP);
+
+ if (node.getParent() instanceof Javadoc) {
+ assert this.ctm.toString(startIndex).startsWith(tagName);
+
+ boolean isParamTag = PARAM_TAGS.contains(tagName);
+ if (isParamTag && this.options.comment_insert_new_line_for_parameter && startIndex < endIndex) {
+ Token token = this.ctm.get(startIndex + 2);
+ token.breakBefore();
+ }
+
+ if (this.options.comment_indent_root_tags) {
+ int indent = this.ctm.getLength(this.ctm.get(startIndex), 0) + 1;
+ if (isParamTag && this.options.comment_indent_parameter_description)
+ indent += this.options.indentation_size;
+ for (int i = startIndex + 1; i <= endIndex; i++) {
+ Token token = this.ctm.get(i);
+ token.setIndent(indent);
+ // indent is used temporarily, tokens that are actually first in line
+ // will have this changed to align (indent is reserved for code inside <pre> tags)
+ }
+ }
+
+ Token startTokeen = this.ctm.get(startIndex);
+ startTokeen.breakBefore();
+ int firstTagIndex;
+ if (this.firstTagToken == null || (firstTagIndex = this.ctm.indexOf(this.firstTagToken)) < 0
+ || startIndex < firstTagIndex)
+ this.firstTagToken = startTokeen;
+
+ handleHtml(node);
+ }
+
+ else if (IMMUTABLE_TAGS.contains(tagName)) {
+ if (startIndex < endIndex)
+ disableFormatting(startIndex, endIndex);
+ noSubstituteWrapping(node.getStartPosition(), nodeEnd);
+ }
+
+ else if (node.isNested()) {
+ noSubstituteWrapping(node.getStartPosition(), nodeEnd);
+ }
+ return true;
+ }
+
+ @Override
+ public void endVisit(TagElement node) {
+ String tagName = node.getTagName();
+ if (tagName == null || tagName.length() <= 1)
+ handleHtml(node);
+
+ handleStringLiterals(this.tm.toString(node), node.getStartPosition());
+ }
+
+ private void handleHtml(TagElement node) {
+ if (!this.options.comment_format_html && !this.options.comment_format_source)
+ return;
+ String text = this.tm.toString(node);
+ Matcher matcher = HTML_TAG_PATTERN.matcher(text);
+ while (matcher.find()) {
+ int startPos = matcher.start() + node.getStartPosition();
+ int endPos = matcher.end() - 1 + node.getStartPosition();
+ boolean isOpeningTag = (matcher.start(1) == matcher.end(1));
+
+ int firstTokenIndex = 0, lastTokenIndex = 0;
+ if (this.options.comment_format_html) {
+ // make sure tokens inside the tag are wrapped only as a substitute
+ firstTokenIndex = tokenStartingAt(startPos);
+ lastTokenIndex = tokenEndingAt(endPos);
+ Token startToken = this.ctm.get(firstTokenIndex);
+ if (!isOpeningTag && startToken.getWrapPolicy() == null)
+ startToken.setWrapPolicy(WrapPolicy.SUBSTITUTE_ONLY);
+ for (int i = firstTokenIndex + 1; i <= lastTokenIndex; i++) {
+ Token token = this.ctm.get(i);
+ if (token.getWrapPolicy() == null)
+ token.setWrapPolicy(WrapPolicy.SUBSTITUTE_ONLY);
+ }
+ Token nextToken = this.ctm.get(lastTokenIndex + 1);
+ if (isOpeningTag && nextToken.getWrapPolicy() == null)
+ nextToken.setWrapPolicy(WrapPolicy.SUBSTITUTE_ONLY);
+
+ // never break tags on special characters
+ noSubstituteWrapping(startPos, endPos - 1);
+ // ... except for equals sign in attributes
+ String attributesText = matcher.group(8);
+ Matcher attrMatcher = HTML_ATTRIBUTE_PATTERN.matcher(attributesText);
+ final int commentStart = this.ctm.get(0).originalStart;
+ while (attrMatcher.find()) {
+ int equalPos = node.getStartPosition() + matcher.start(8) + attrMatcher.start(1);
+ assert this.tm.charAt(equalPos) == '=';
+ this.noSubstituteWrapping[equalPos - commentStart] = false;
+ }
+ }
+
+ int matchedGroups = 0;
+ for (int i = 2; i <= 7; i++)
+ if (matcher.start(i) < matcher.end(i))
+ matchedGroups++;
+ if (matchedGroups != 1)
+ continue;
+
+ if (matcher.start(2) < matcher.end(2)) {
+ handleFormatCodeTag(startPos, endPos, isOpeningTag);
+ }
+ if (this.options.comment_format_html) {
+ if (matcher.start(3) < matcher.end(3)) {
+ handleSeparateLineTag(startPos, endPos);
+ } else if (matcher.start(4) < matcher.end(4)) {
+ handleBreakBeforeTag(startPos, endPos, isOpeningTag);
+ } else if (matcher.start(5) < matcher.end(5)) {
+ handleBreakAfterTag(startPos, endPos);
+ } else if (matcher.start(6) < matcher.end(6)) {
+ handleNoFormatTag(startPos, endPos, isOpeningTag);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean visit(MethodRef node) {
+ handleReference(node);
+ return true;
+ }
+
+ @Override
+ public boolean visit(MemberRef node) {
+ handleReference(node);
+ return true;
+ }
+
+ private void handleReference(ASTNode node) {
+ ASTNode parent = node.getParent();
+ if ((parent instanceof TagElement) && ((TagElement) parent).isNested()) {
+ int firstIndex = tokenStartingAt(node.getStartPosition());
+ int lastIndex = tokenEndingAt(node.getStartPosition() + node.getLength() - 1);
+ if (this.ctm.charAt(this.ctm.get(lastIndex + 1).originalStart) == '}')
+ lastIndex++;
+ for (int i = firstIndex; i <= lastIndex; i++) {
+ Token token = this.ctm.get(i);
+ token.setWrapPolicy(WrapPolicy.DISABLE_WRAP);
+ }
+ }
+ noSubstituteWrapping(node.getStartPosition(), node.getStartPosition() + node.getLength() - 1);
+ }
+
+ private void handleStringLiterals(String text, int textStartPosition) {
+ Matcher matcher = STRING_LITERAL_PATTERN.matcher(text);
+ while (matcher.find()) {
+ int startPosition = textStartPosition + matcher.start();
+ int startIndex = this.ctm.findIndex(startPosition, -1, false);
+ int endPosition = textStartPosition + matcher.end() - 1;
+ int endIndex = this.ctm.findIndex(endPosition, -1, false);
+ if (startIndex != endIndex)
+ disableFormatting(tokenStartingAt(startPosition), tokenEndingAt(endPosition));
+ noSubstituteWrapping(startPosition, endPosition);
+ }
+ }
+
+ private void handleSeparateLineTag(int startPos, int endPos) {
+ int openingTagIndex = tokenStartingAt(startPos);
+ if (openingTagIndex > 1 && this.lastFormatCodeClosingTagIndex == openingTagIndex - 1) {
+ Token token = this.ctm.get(openingTagIndex - 1);
+ assert token.getLineBreaksAfter() == 2;
+ token.clearLineBreaksAfter();
+ token.breakAfter();
+ }
+
+ handleBreakBeforeTag(startPos, endPos, true);
+ handleBreakAfterTag(startPos, endPos);
+ }
+
+ private void handleBreakBeforeTag(int start, int end, boolean isOpeningTag) {
+ int firstPartIndex = tokenStartingAt(start);
+ int lastPartIndex = tokenEndingAt(end);
+ Token firstPartToken = this.ctm.get(firstPartIndex);
+ if (isOpeningTag) {
+ firstPartToken.breakBefore();
+ this.ctm.get(lastPartIndex + 1).clearSpaceBefore();
+ } else {
+ firstPartToken.clearSpaceBefore();
+ firstPartToken.setWrapPolicy(null);
+ }
+ }
+
+ private void handleBreakAfterTag(int start, int end) {
+ int tokenIndex = tokenEndingAt(end);
+ this.ctm.get(tokenIndex).breakAfter();
+ }
+
+ private void handleNoFormatTag(int start, int end, boolean isOpeningTag) {
+ if (isOpeningTag) {
+ if (this.noFormatTagOpenStart < 0)
+ this.noFormatTagOpenStart = start;
+ } else if (this.noFormatTagOpenStart >= 0) {
+ int openingTagIndex = tokenStartingAt(this.noFormatTagOpenStart);
+ int closingTagIndex = tokenEndingAt(end);
+ if (openingTagIndex < closingTagIndex)
+ disableFormatting(openingTagIndex, closingTagIndex);
+ closingTagIndex = tokenEndingAt(end);
+ cleanupHTMLElement(openingTagIndex, closingTagIndex, false);
+ noSubstituteWrapping(this.noFormatTagOpenStart, end);
+ this.noFormatTagOpenStart = -1;
+ }
+ }
+
+ private void handleFormatCodeTag(int startPos, int endPos, boolean isOpeningTag) {
+ if (!this.options.comment_format_source) {
+ handleNoFormatTag(startPos, endPos, isOpeningTag);
+ return;
+ }
+
+ // add empty lines before opening and after closing token
+ handleSeparateLineTag(startPos, endPos);
+ if (isOpeningTag) {
+ int startIndex = tokenStartingAt(startPos);
+ if (startIndex > 1)
+ this.ctm.get(startIndex).putLineBreaksBefore(2);
+
+ if (this.formatCodeTagOpenEnd < 0)
+ this.formatCodeTagOpenEnd = endPos;
+ } else if (this.formatCodeTagOpenEnd >= 0) {
+ int endTagIndex = tokenEndingAt(endPos);
+ if (endTagIndex < this.ctm.size() - 2)
+ this.ctm.get(endTagIndex).putLineBreaksAfter(2);
+
+ formatCode(startPos, endPos);
+ this.formatCodeTagOpenEnd = -1;
+ this.lastFormatCodeClosingTagIndex = this.ctm.findIndex(startPos, -1, true);
+ }
+ }
+
+ private void cleanupHTMLElement(int openingTagIndex, int closingTagIndex, boolean formattedCode) {
+ Token previous = this.ctm.get(openingTagIndex);
+ int indent = previous.getIndent();
+ for (int i = openingTagIndex + 1; i < closingTagIndex; i++) {
+ Token token = this.ctm.get(i);
+ token.setToEscape(true);
+ if (formattedCode && (token.getLineBreaksBefore() > 0 || previous.getLineBreaksAfter() > 0))
+ token.setAlign(indent);
+ previous = token;
+ }
+ for (int i = closingTagIndex; i < this.ctm.size(); i++) {
+ Token token = this.ctm.get(i);
+ if (token.getIndent() == 0)
+ break;
+ token.setIndent(indent);
+ previous = token;
+ }
+ }
+
+ private void disableFormatting(int startIndex, int endIndex) {
+ Token startToken = this.ctm.get(startIndex), endToken = this.ctm.get(endIndex);
+ Token noFormatToken = new Token(startToken.originalStart, endToken.originalEnd, TokenNameCOMMENT_JAVADOC);
+
+ List<Token> tokensToReplace = this.commentStructure.subList(startIndex, endIndex + 1);
+ if (this.ctm.countLineBreaksBetween(startToken, endToken) == 0) {
+ tokensToReplace.clear();
+ tokensToReplace.add(noFormatToken);
+ } else {
+ int commentStart = findCommentLineIndent(startIndex);
+ tokensToReplace.clear();
+ tokensToReplace.addAll(commentToLines(noFormatToken, commentStart));
+ }
+ if (startToken.isSpaceBefore())
+ tokensToReplace.get(0).spaceBefore();
+ tokensToReplace.get(0).putLineBreaksBefore(startToken.getLineBreaksBefore());
+ Token lastToReplace = tokensToReplace.get(tokensToReplace.size() - 1);
+ if (endToken.isSpaceAfter())
+ lastToReplace.spaceAfter();
+ lastToReplace.putLineBreaksAfter(endToken.getLineBreaksAfter());
+ for (Token token : tokensToReplace)
+ if (token.tokenType == TokenNameCOMMENT_JAVADOC)
+ token.setIndent(startToken.getIndent());
+ }
+
+ private void disableFormattingExclusively(int openingTagIndex, int closingTagIndex) {
+ Token openingTag = this.ctm.get(openingTagIndex);
+ int noFormatStart = openingTag.originalEnd + 1;
+ int noFormatEnd = this.ctm.get(closingTagIndex - 1).originalEnd;
+ if (noFormatStart <= noFormatEnd) {
+ Token noFormatToken = new Token(noFormatStart, noFormatEnd, TokenNameCOMMENT_JAVADOC);
+ int commentStart = findCommentLineIndent(openingTagIndex);
+ List<Token> lines = commentToLines(noFormatToken, commentStart);
+ List<Token> tokensToReplace = this.commentStructure.subList(openingTagIndex + 1, closingTagIndex);
+ tokensToReplace.clear();
+ tokensToReplace.addAll(lines);
+ noSubstituteWrapping(noFormatStart, noFormatEnd);
+ } else {
+ this.commentStructure.subList(openingTagIndex + 1, closingTagIndex).clear();
+ Token closingTag = this.ctm.get(closingTagIndex);
+ if (this.ctm.countLineBreaksBetween(openingTag, closingTag) == 0) {
+ openingTag.clearLineBreaksAfter();
+ closingTag.clearLineBreaksBefore();
+ }
+ }
+ }
+
+ private int findCommentLineIndent(int commentFragmentIndex) {
+ int position = this.ctm.get(commentFragmentIndex).originalStart;
+ int lastNonWhitespace = position;
+ while (--position > 0) {
+ char c = this.ctm.charAt(position);
+ if (c == '\r' || c == '\n')
+ break;
+ if (!ScannerHelper.isWhitespace(c))
+ lastNonWhitespace = position;
+ }
+ if (lastNonWhitespace > 0 && this.ctm.charAt(lastNonWhitespace - 1) == ' ')
+ lastNonWhitespace--;
+ return this.ctm.getLength(position, lastNonWhitespace - 1, 0);
+ }
+
+ private int tokenStartingAt(int start) {
+ int tokenIndex = this.ctm.findIndex(start, -1, false);
+ Token token = this.ctm.get(tokenIndex);
+ if (token.originalStart == start)
+ return tokenIndex;
+
+ assert start > token.originalStart && start <= token.originalEnd;
+ splitToken(token, tokenIndex, start);
+ return tokenIndex + 1;
+ }
+
+ private int tokenEndingAt(int end) {
+ int tokenIndex = this.ctm.findIndex(end, -1, true);
+ Token token = this.ctm.get(tokenIndex);
+ if (token.originalEnd == end)
+ return tokenIndex;
+
+ assert end < token.originalEnd && end >= token.originalStart;
+ splitToken(token, tokenIndex, end + 1);
+ return tokenIndex;
+ }
+
+ private void splitToken(Token token, int tokenIndex, int splitPosition) {
+ assert splitPosition > token.originalStart && splitPosition <= token.originalEnd;
+
+ Token part1 = new Token(token.originalStart, splitPosition - 1, token.tokenType);
+ Token part2 = new Token(splitPosition, token.originalEnd, token.tokenType);
+ if (token.isSpaceBefore())
+ part1.spaceBefore();
+ part1.putLineBreaksBefore(token.getLineBreaksBefore());
+ if (token.isSpaceAfter())
+ part2.spaceAfter();
+ part2.putLineBreaksAfter(token.getLineBreaksAfter());
+ part1.setIndent(token.getIndent());
+ part2.setIndent(token.getIndent());
+ part1.setWrapPolicy(token.getWrapPolicy());
+ this.commentStructure.set(tokenIndex, part1);
+ this.commentStructure.add(tokenIndex + 1, part2);
+ }
+
+ private boolean tokenizeMultilineComment(Token commentToken) {
+ if (this.noSubstituteWrapping == null || this.noSubstituteWrapping.length < commentToken.countChars()) {
+ this.noSubstituteWrapping = new boolean[commentToken.countChars()];
+ } else {
+ Arrays.fill(this.noSubstituteWrapping, 0, commentToken.countChars(), false);
+ }
+
+ final boolean cleanBlankLines = commentToken.tokenType == TokenNameCOMMENT_JAVADOC
+ ? this.options.comment_clear_blank_lines_in_javadoc_comment
+ : this.options.comment_clear_blank_lines_in_block_comment;
+
+ List<Token> structure = new ArrayList<Token>();
+
+ int firstTokenEnd = commentToken.originalStart + 1;
+ while (firstTokenEnd < commentToken.originalEnd - 1 && this.tm.charAt(firstTokenEnd + 1) == '*')
+ firstTokenEnd++;
+ Token first = new Token(commentToken.originalStart, firstTokenEnd, commentToken.tokenType);
+ first.spaceAfter();
+ structure.add(first);
+
+ int lastTokenStart = commentToken.originalEnd - 1;
+ while (lastTokenStart - 1 > firstTokenEnd && this.tm.charAt(lastTokenStart - 1) == '*')
+ lastTokenStart--;
+
+ int position = firstTokenEnd + 1;
+ int lineBreaks = 0;
+ while (position <= commentToken.originalEnd) {
+ // find line start
+ for (int i = position; i < lastTokenStart; i++) {
+ char c = this.tm.charAt(i);
+ if (c == '\r' || c == '\n') {
+ lineBreaks++;
+ char c2 = this.tm.charAt(i + 1);
+ if ((c2 == '\r' || c2 == '\n') && c2 != c)
+ i++;
+ position = i + 1;
+ } else if (!ScannerHelper.isWhitespace(c)) {
+ while (this.tm.charAt(i) == '*' && lineBreaks > 0)
+ i++;
+ position = i;
+ break;
+ }
+ }
+
+ int tokenStart = position;
+ while (position <= commentToken.originalEnd + 1) {
+ char c = 0;
+ if (position == commentToken.originalEnd + 1 || position == lastTokenStart
+ || ScannerHelper.isWhitespace(c = this.tm.charAt(position))) {
+ if (tokenStart < position) {
+ Token outputToken = new Token(tokenStart, position - 1, commentToken.tokenType);
+ outputToken.spaceBefore();
+ if (lineBreaks > 0) {
+ if (cleanBlankLines)
+ lineBreaks = 1;
+ if (lineBreaks > 1 || !this.options.join_lines_in_comments)
+ outputToken.putLineBreaksBefore(lineBreaks);
+ }
+ if (this.tm.charAt(tokenStart) == '@') {
+ outputToken.setWrapPolicy(WrapPolicy.DISABLE_WRAP);
+ if (commentToken.tokenType == TokenNameCOMMENT_BLOCK && lineBreaks == 1
+ && structure.size() > 1)
+ outputToken.putLineBreaksBefore(cleanBlankLines ? 1 : 2);
+ if (this.tm.charAt(tokenStart + 1) == '@' && lineBreaks > 0 && this.firstTagToken == null) {
+ // Commons Attributes annotation, see bug 237051
+ this.firstTagToken = outputToken;
+ }
+ }
+ structure.add(outputToken);
+ lineBreaks = 0;
+ }
+ if (c == '\r' || c == '\n')
+ break;
+ tokenStart = position == lastTokenStart ? position : position + 1;
+ }
+ position++;
+ }
+ }
+
+ Token last = structure.get(structure.size() - 1);
+ boolean newLinesAtBoundries = commentToken.tokenType == TokenNameCOMMENT_JAVADOC
+ ? this.options.comment_new_lines_at_javadoc_boundaries
+ : this.options.comment_new_lines_at_block_boundaries;
+ if (newLinesAtBoundries && this.tm.countLineBreaksBetween(first, last) > 0) {
+ first.breakAfter();
+ last.breakBefore();
+ last.setAlign(1);
+ }
+
+ if (structure.size() == 2)
+ return false;
+ commentToken.setInternalStructure(structure);
+ return true;
+ }
+
+ private void noSubstituteWrapping(int from, int to) {
+ int commentStart = this.ctm.get(0).originalStart;
+ assert commentStart <= from && from <= to && to <= this.ctm.get(this.ctm.size() - 1).originalEnd;
+ Arrays.fill(this.noSubstituteWrapping, from - commentStart, to - commentStart + 1, true);
+ }
+
+ private void addSubstituteWraps() {
+ int commentStart = this.ctm.get(0).originalStart;
+ for (int i = 1; i < this.ctm.size() - 1; i++) {
+ Token token = this.ctm.get(i);
+ for (int pos = token.originalStart + 1; pos < token.originalEnd; pos++) {
+ if (this.noSubstituteWrapping[pos - commentStart])
+ continue;
+ char c = this.ctm.charAt(pos);
+ if (!ScannerHelper.isJavaIdentifierPart(c) && c != '@'/* wrapping on @ would create a javadoc tag */) {
+ this.ctm.get(tokenStartingAt(pos)).setWrapPolicy(WrapPolicy.SUBSTITUTE_ONLY);
+ this.ctm.get(tokenStartingAt(pos + 1)).setWrapPolicy(WrapPolicy.SUBSTITUTE_ONLY);
+ }
+ }
+ }
+ }
+
+ private void formatCode(int javadocNoFormatCloseStart, int javadocNoFormatCloseEnd) {
+ int openingTagLastIndex = tokenEndingAt(this.formatCodeTagOpenEnd);
+ int closingTagFirstIndex = tokenStartingAt(javadocNoFormatCloseStart);
+
+ int codeStartPosition = this.formatCodeTagOpenEnd + 1;
+ int codeEndPosition = javadocNoFormatCloseStart - 1;
+ StringBuilder codeBuilder = new StringBuilder(codeEndPosition - codeStartPosition + 1);
+ int[] positionMapping = new int[codeEndPosition - codeStartPosition + 1];
+ // ^ index: original source position (minus startPosition), value: position in code string
+ getCodeToFormat(codeStartPosition, codeEndPosition, codeBuilder, positionMapping);
+
+ List<Token> formattedTokens = getCommentCodeFormatter().prepareFormattedCode(codeBuilder.toString(),
+ CodeFormatter.K_UNKNOWN);
+
+ if (formattedTokens == null) {
+ disableFormattingExclusively(openingTagLastIndex, closingTagFirstIndex);
+ closingTagFirstIndex = tokenStartingAt(javadocNoFormatCloseStart);
+ cleanupHTMLElement(openingTagLastIndex, closingTagFirstIndex, false);
+ return;
+ }
+
+ formattedTokens = translateFormattedTokens(codeStartPosition, formattedTokens, positionMapping, null);
+ // there are too few linebreaks at the start and end
+ Token start = formattedTokens.get(0);
+ start.putLineBreaksBefore(start.getLineBreaksBefore() + 1);
+ Token end = formattedTokens.get(formattedTokens.size() - 1);
+ end.putLineBreaksAfter(end.getLineBreaksAfter() + 1);
+ // and there may be too many line breaks before closing tag
+ this.ctm.get(closingTagFirstIndex).clearLineBreaksBefore();
+
+ List<Token> tokensToReplace = this.commentStructure.subList(openingTagLastIndex + 1, closingTagFirstIndex);
+ tokensToReplace.clear();
+ tokensToReplace.addAll(formattedTokens);
+ cleanupHTMLElement(openingTagLastIndex, openingTagLastIndex + formattedTokens.size() + 1, true);
+ noSubstituteWrapping(codeStartPosition, codeEndPosition);
+ }
+
+ private DefaultCodeFormatter getCommentCodeFormatter() {
+ if (this.commentCodeFormatter == null) {
+ Map<String, String> options2 = this.options.getMap();
+ options2.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH,
+ String.valueOf(this.options.comment_line_length - this.commentIndent
+ - COMMENT_LINE_SEPARATOR_LENGTH));
+ options2.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT,
+ String.valueOf(this.options.page_width - this.commentIndent - COMMENT_LINE_SEPARATOR_LENGTH));
+ options2.put(CompilerOptions.OPTION_Source, this.sourceLevel);
+ this.commentCodeFormatter = new DefaultCodeFormatter(options2);
+ }
+ return this.commentCodeFormatter;
+ }
+
+ private void getCodeToFormat(int startPos, int endPos, StringBuilder sb, int[] posMapping) {
+ int position = 0; // original source position (minus startPos)
+
+ // skip excessive line break at the beginning
+ char c, c2;
+ if ((c = this.ctm.charAt(position + startPos)) == '\r' || c == '\n') {
+ posMapping[position++] = sb.length() - 1;
+ if (((c2 = this.ctm.charAt(position + startPos)) == '\r' || c2 == '\n') && c2 != c)
+ posMapping[position++] = sb.length() - 1;
+ }
+
+ while (position + startPos <= endPos) {
+ int lineStart = position + startPos;
+ for (int i = lineStart;; i++) {
+ c = this.ctm.charAt(i);
+ if (c == '\r' || c == '\n') {
+ sb.append(c);
+ lineStart = i + 1;
+ } else if (!ScannerHelper.isWhitespace(c)) {
+ if (c == '*')
+ lineStart = (this.ctm.charAt(i + 1) == ' ') ? i + 2 : i + 1;
+ break;
+ }
+ }
+ int lineEnd = endPos + 1;
+ for (int i = lineStart; i <= endPos; i++) {
+ c = this.ctm.charAt(i);
+ if (c == '\r' || c == '\n') {
+ lineEnd = i;
+ break;
+ }
+ }
+
+ while (position + startPos < lineStart) {
+ posMapping[position++] = sb.length() - 1;
+ }
+
+ int htmlEntityStart = -1;
+ for (int i = lineStart; i < lineEnd; i++) {
+ c = this.ctm.charAt(i);
+ sb.append(c);
+ posMapping[position++] = sb.length() - 1;
+
+ if (c == '&') {
+ htmlEntityStart = i;
+ } else if (c == ';' && htmlEntityStart >= 0) {
+ char replacementChar = getHtmlEntityChar(this.ctm.getSource().substring(htmlEntityStart, i + 1));
+ if (replacementChar != 0) {
+ sb.setLength(sb.length() - (i + 1 - htmlEntityStart));
+ sb.append(replacementChar);
+ for (int k = position - (i + 1 - htmlEntityStart); k < position; k++)
+ posMapping[k] = sb.length() - 1;
+ }
+ htmlEntityStart = -1;
+ }
+ }
+ }
+
+ // remove last line if empty
+ while (sb.length() > 0 && ((c = sb.charAt(sb.length() - 1)) == ' ' || c == '\t'))
+ sb.deleteCharAt(sb.length() - 1);
+ if (sb.length() > 0 && ((c = sb.charAt(sb.length() - 1)) == '\r' || c == '\n')) {
+ sb.deleteCharAt(sb.length() - 1);
+ if (sb.length() > 0 && ((c2 = sb.charAt(sb.length() - 1)) == '\r' || c2 == '\n') && c2 != c)
+ sb.deleteCharAt(sb.length() - 1);
+ }
+ }
+
+ private char getHtmlEntityChar(String entity) {
+ Matcher matcher = HTML_ENTITY_PATTERN.matcher(entity);
+ if (matcher.find()) {
+ char replaceChar = 0;
+ for (int i = 1; i < HTML_ENTITY_REPLACE.length(); i++) {
+ int start = matcher.start(i);
+ int end = matcher.end(i);
+ if (start == end)
+ continue; // group not matched
+ if (replaceChar != 0)
+ return 0; // more than one group matched
+ switch (i) {
+ case 1:
+ replaceChar = (char) Integer.parseInt(entity.substring(start + 2, end), 16);
+ break;
+ case 2:
+ replaceChar = (char) Integer.parseInt(entity.substring(start + 1, end), 10);
+ break;
+ default:
+ replaceChar = HTML_ENTITY_REPLACE.charAt(i);
+ }
+ }
+ return replaceChar;
+ }
+ return 0;
+ }
+
+ private List<Token> translateFormattedTokens(int startPosition, List<Token> formattedTokens, int[] positionMapping,
+ HashMap<Token, Token> translationMap) {
+ int previousLineBreaks = 0;
+ List<Token> result = new ArrayList<Token>();
+ for (Token token : formattedTokens) {
+ int newStart = Arrays.binarySearch(positionMapping, token.originalStart);
+ while (newStart > 0 && positionMapping[newStart - 1] == token.originalStart)
+ newStart--;
+ int newEnd = Arrays.binarySearch(positionMapping, token.originalEnd);
+ while (newEnd + 1 < positionMapping.length && positionMapping[newEnd + 1] == token.originalEnd)
+ newEnd++;
+ Token translated = new Token(token, newStart + startPosition, newEnd + startPosition, token.tokenType);
+ if (translated.getWrapPolicy() == null)
+ translated.setWrapPolicy(WrapPolicy.DISABLE_WRAP);
+ if (token.hasNLSTag())
+ translationMap.put(token, translated);
+
+ int lineBreaks = Math.max(previousLineBreaks, token.getLineBreaksBefore());
+ List<Token> structure = token.getInternalStructure();
+ if (structure != null && !structure.isEmpty()) {
+ if (translationMap == null)
+ translationMap = new HashMap<Token, Token>();
+ translated.setInternalStructure(translateFormattedTokens(startPosition, structure, positionMapping,
+ translationMap));
+ }
+ translated.putLineBreaksBefore(lineBreaks);
+ result.add(translated);
+ previousLineBreaks = token.getLineBreaksAfter();
+ }
+ result.get(result.size() - 1).putLineBreaksAfter(previousLineBreaks);
+
+ for (Token translated : result) {
+ if (translated.getNLSTag() != null) {
+ Token nlsTagToken = translationMap.get(translated.getNLSTag());
+ translated.setNLSTag(nlsTagToken);
+ nlsTagToken.setNLSTag(translated);
+ assert translated.getNLSTag() != null;
+ }
+ }
+ return result;
+ }
+
+ public void finishUp() {
+ if (this.lastFormatOffComment != null)
+ this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, this.tm.get(this.tm.size() - 1));
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
index 2605167..d540a08 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,32 +9,44 @@
* IBM Corporation - initial API and implementation
* Jesper Steen Moller - Contributions for
* bug 404146 - [1.7][compiler] nested try-catch-finally-blocks leads to unrunnable Java byte code
+ * Harry Terkelsen (het@google.com) - Bug 449262 - Allow the use of third-party Java formatters
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] follow up bug for comments - https://bugs.eclipse.org/458208
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.formatter;
-import java.util.HashMap;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameEOF;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameNotAToken;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import org.aspectj.org.eclipse.jdt.core.JavaCore;
-import org.aspectj.org.eclipse.jdt.core.compiler.ITerminalSymbols;
+import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
+import org.aspectj.org.eclipse.jdt.core.dom.AST;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTParser;
+import org.aspectj.org.eclipse.jdt.core.dom.Comment;
+import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.dom.Javadoc;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter;
import org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
-import org.aspectj.org.eclipse.jdt.internal.core.util.CodeSnippetParsingUtil;
+import org.aspectj.org.eclipse.jdt.internal.formatter.linewrap.CommentWrapExecutor;
+import org.aspectj.org.eclipse.jdt.internal.formatter.linewrap.WrapPreparator;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
+import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.edits.TextEdit;
-@SuppressWarnings({ "rawtypes", "unchecked" })
public class DefaultCodeFormatter extends CodeFormatter {
/**
@@ -42,111 +54,89 @@
*/
public static boolean DEBUG = false;
- // Mask for code formatter kinds
- private static final int K_MASK = K_UNKNOWN
- | K_EXPRESSION
- | K_STATEMENTS
- | K_CLASS_BODY_DECLARATIONS
- | K_COMPILATION_UNIT
- | K_SINGLE_LINE_COMMENT
+ private static final int K_COMMENTS_MASK = K_SINGLE_LINE_COMMENT
| K_MULTI_LINE_COMMENT
| K_JAVA_DOC;
- // Scanner use to probe the kind of the source given to the formatter
- private static Scanner PROBING_SCANNER;
+ // Mask for code formatter kinds
+ private static final int K_MASK = K_UNKNOWN
+ | K_EXPRESSION
+ | K_STATEMENTS
+ | K_CLASS_BODY_DECLARATIONS
+ | K_COMPILATION_UNIT
+ | K_COMMENTS_MASK;
- private CodeSnippetParsingUtil codeSnippetParsingUtil;
- private Map defaultCompilerOptions;
+ private DefaultCodeFormatterOptions originalOptions;
+ private DefaultCodeFormatterOptions workingOptions;
- private CodeFormatterVisitor newCodeFormatter;
- private Map options;
+ private Object oldCommentFormatOption;
+ private String sourceLevel;
- private DefaultCodeFormatterOptions preferences;
+ private String sourceString;
+ private char[] sourceArray;
+
+ private ASTNode astRoot;
+ private List<Token> tokens = new ArrayList<Token>();
+ private TokenManager tokenManager;
public DefaultCodeFormatter() {
this(new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings()), null);
}
- public DefaultCodeFormatter(DefaultCodeFormatterOptions preferences) {
- this(preferences, null);
+ public DefaultCodeFormatter(DefaultCodeFormatterOptions options) {
+ this(options, null);
}
- public DefaultCodeFormatter(DefaultCodeFormatterOptions defaultCodeFormatterOptions, Map options) {
- if (options != null) {
- this.options = options;
- this.preferences = new DefaultCodeFormatterOptions(options);
- } else {
- this.options = JavaCore.getOptions();
- this.preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings());
- }
- this.defaultCompilerOptions = getDefaultCompilerOptions();
- if (defaultCodeFormatterOptions != null) {
- this.preferences.set(defaultCodeFormatterOptions.getMap());
- }
- }
-
- public DefaultCodeFormatter(Map options) {
+ public DefaultCodeFormatter(Map<String, String> options) {
this(null, options);
}
+ public DefaultCodeFormatter(DefaultCodeFormatterOptions defaultCodeFormatterOptions, Map<String, String> options) {
+ initOptions(defaultCodeFormatterOptions, options);
+ }
+
+ private void initOptions(DefaultCodeFormatterOptions defaultCodeFormatterOptions, Map<String, String> options) {
+ if (options != null) {
+ this.originalOptions = new DefaultCodeFormatterOptions(options);
+ this.workingOptions = new DefaultCodeFormatterOptions(options);
+ this.oldCommentFormatOption = getOldCommentFormatOption(options);
+ String compilerSource = options.get(CompilerOptions.OPTION_Source);
+ this.sourceLevel = compilerSource != null ? compilerSource : CompilerOptions.VERSION_1_8;
+ } else {
+ Map<String, String> settings = DefaultCodeFormatterConstants.getJavaConventionsSettings();
+ this.originalOptions = new DefaultCodeFormatterOptions(settings);
+ this.workingOptions = new DefaultCodeFormatterOptions(settings);
+ this.oldCommentFormatOption = DefaultCodeFormatterConstants.TRUE;
+ this.sourceLevel = CompilerOptions.VERSION_1_8;
+ }
+ if (defaultCodeFormatterOptions != null) {
+ this.originalOptions.set(defaultCodeFormatterOptions.getMap());
+ this.workingOptions.set(defaultCodeFormatterOptions.getMap());
+ }
+ }
+
+ @Deprecated
+ private Object getOldCommentFormatOption(Map<String, String> options) {
+ return options.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT);
+ }
+
public String createIndentationString(final int indentationLevel) {
if (indentationLevel < 0) {
throw new IllegalArgumentException();
}
- int tabs = 0;
- int spaces = 0;
- switch(this.preferences.tab_char) {
- case DefaultCodeFormatterOptions.SPACE :
- spaces = indentationLevel * this.preferences.tab_size;
- break;
- case DefaultCodeFormatterOptions.TAB :
- tabs = indentationLevel;
- break;
- case DefaultCodeFormatterOptions.MIXED :
- int tabSize = this.preferences.tab_size;
- if (tabSize != 0) {
- int spaceEquivalents = indentationLevel * this.preferences.indentation_size;
- tabs = spaceEquivalents / tabSize;
- spaces = spaceEquivalents % tabSize;
- }
- break;
- default:
- return Util.EMPTY_STRING;
- }
- if (tabs == 0 && spaces == 0) {
- return Util.EMPTY_STRING;
- }
- StringBuffer buffer = new StringBuffer(tabs + spaces);
- for(int i = 0; i < tabs; i++) {
- buffer.append('\t');
- }
- for(int i = 0; i < spaces; i++) {
- buffer.append(' ');
- }
- return buffer.toString();
+ StringBuilder sb = new StringBuilder();
+ int indent = indentationLevel * this.originalOptions.indentation_size;
+ TextEditsBuilder.appendIndentationString(sb, this.originalOptions.tab_char, this.originalOptions.tab_size,
+ indent, 0);
+ return sb.toString();
}
/**
* @see org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter#format(int, java.lang.String, int, int, int, java.lang.String)
*/
public TextEdit format(int kind, String source, int offset, int length, int indentationLevel, String lineSeparator) {
- if (offset < 0 || length < 0 || length > source.length()) {
- throw new IllegalArgumentException();
- }
-
- switch(kind & K_MASK) {
- case K_JAVA_DOC :
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=102780
- // use the integrated comment formatter to format comment
- return formatComment(kind & K_MASK, source, indentationLevel, lineSeparator, new IRegion[] {new Region(offset, length)});
- // $FALL-THROUGH$ - fall through next case when old comment formatter is activated
- case K_MULTI_LINE_COMMENT :
- case K_SINGLE_LINE_COMMENT :
- return formatComment(kind & K_MASK, source, indentationLevel, lineSeparator, new IRegion[] {new Region(offset, length)});
- }
-
- return format(kind, source, new IRegion[] {new Region(offset, length)}, indentationLevel, lineSeparator);
+ return format(kind, source, new IRegion[] { new Region(offset, length) }, indentationLevel, lineSeparator);
}
/**
@@ -157,321 +147,237 @@
throw new IllegalArgumentException();
}
- this.codeSnippetParsingUtil = new CodeSnippetParsingUtil();
- boolean includeComments = (kind & F_INCLUDE_COMMENTS) != 0;
- switch(kind & K_MASK) {
- case K_CLASS_BODY_DECLARATIONS :
- return formatClassBodyDeclarations(source, indentationLevel, lineSeparator, regions, includeComments);
- case K_COMPILATION_UNIT :
- return formatCompilationUnit(source, indentationLevel, lineSeparator, regions, includeComments);
- case K_EXPRESSION :
- return formatExpression(source, indentationLevel, lineSeparator, regions, includeComments);
- case K_STATEMENTS :
- return formatStatements(source, indentationLevel, lineSeparator, regions, includeComments);
- case K_UNKNOWN :
- return probeFormatting(source, indentationLevel, lineSeparator, regions, includeComments);
- case K_JAVA_DOC :
- case K_MULTI_LINE_COMMENT :
- case K_SINGLE_LINE_COMMENT :
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204091
+ updateWorkingOptions(indentationLevel, lineSeparator, kind);
+
+ if ((kind & K_COMMENTS_MASK) != 0)
+ return formatComments(source, kind & K_COMMENTS_MASK, regions);
+
+ if (prepareFormattedCode(source, kind) == null)
+ return this.tokens.isEmpty() ? new MultiTextEdit() : null;
+
+ MultiTextEdit result = new MultiTextEdit();
+ TextEditsBuilder resultBuilder = new TextEditsBuilder(this.sourceString, regions, this.tokenManager,
+ this.workingOptions);
+ this.tokenManager.traverse(0, resultBuilder);
+ for (TextEdit edit : resultBuilder.getEdits()) {
+ result.addChild(edit);
+ }
+ return result;
+ }
+
+ private boolean init(String source) {
+
+ // this is convenient for debugging (see Token.toString())
+ // Token.source = source;
+
+ this.sourceString = source;
+ this.sourceArray = source.toCharArray();
+ this.tokens.clear();
+ this.tokenManager = new TokenManager(this.tokens, source, this.workingOptions);
+
+ tokenizeSource();
+ return !this.tokens.isEmpty();
+ }
+
+ List<Token> prepareFormattedCode(String source, int kind) {
+ if (!init(source))
+ return null;
+
+ this.astRoot = parseSourceCode(kind);
+ if (this.astRoot == null)
+ return null;
+
+ if (kind != CodeFormatter.K_UNKNOWN)
+ findHeader();
+
+ prepareSpaces();
+ prepareLineBreaks();
+ prepareComments();
+ prepareWraps(kind);
+
+ this.tokenManager.applyFormatOff();
+
+ return this.tokens;
+ }
+
+ private void findHeader() {
+ if (this.astRoot instanceof CompilationUnit) {
+ List<TypeDeclaration> types = ((CompilationUnit) this.astRoot).types();
+ if (!types.isEmpty()) {
+ int headerEndIndex = this.tokenManager.firstIndexIn(types.get(0), -1);
+ this.tokenManager.setHeaderEndIndex(headerEndIndex);
+ }
+ }
+ }
+
+ private TextEdit formatComments(String source, int kind, IRegion[] regions) {
+ MultiTextEdit result = new MultiTextEdit();
+ if (!init(source))
+ return result;
+
+ CommentsPreparator commentsPreparator = new CommentsPreparator(this.tokenManager, this.workingOptions,
+ this.sourceLevel);
+ CommentWrapExecutor commentWrapper = new CommentWrapExecutor(this.tokenManager, this.workingOptions);
+ switch (kind) {
+ case K_JAVA_DOC:
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
+ for (Token token : this.tokens) {
+ if (token.tokenType == TokenNameCOMMENT_JAVADOC) {
+ parser.setSourceRange(token.originalStart, token.countChars());
+ CompilationUnit cu = (CompilationUnit) parseSourceCode(parser, ASTParser.K_COMPILATION_UNIT,
+ true);
+ Javadoc javadoc = (Javadoc) cu.getCommentList().get(0);
+ javadoc.accept(commentsPreparator);
+ int startPosition = this.tokenManager.findSourcePositionInLine(token.originalStart);
+ commentWrapper.wrapMultiLineComment(token, startPosition, false, false);
+ }
+ }
+ break;
+ case K_MULTI_LINE_COMMENT:
+ for (int i = 0; i < this.tokens.size(); i++) {
+ Token token = this.tokens.get(i);
+ if (token.tokenType == TokenNameCOMMENT_BLOCK) {
+ commentsPreparator.handleBlockComment(i);
+ int startPosition = this.tokenManager.findSourcePositionInLine(token.originalStart);
+ commentWrapper.wrapMultiLineComment(token, startPosition, false, false);
+ }
+ }
+ break;
+ case K_SINGLE_LINE_COMMENT:
+ for (int i = 0; i < this.tokens.size(); i++) {
+ Token token = this.tokens.get(i);
+ if (token.tokenType == TokenNameCOMMENT_LINE) {
+ commentsPreparator.handleLineComment(i);
+ if (i >= this.tokens.size() || this.tokens.get(i) != token) {
+ // current token has been removed and merged with previous one
+ i--;
+ token = this.tokens.get(i);
+ }
+ int startPosition = this.tokenManager.findSourcePositionInLine(token.originalStart);
+ commentWrapper.wrapLineComment(token, startPosition);
+ }
+ }
+ break;
+ default:
+ throw new AssertionError(String.valueOf(kind));
+ }
+
+ this.tokenManager.applyFormatOff();
+
+ TextEditsBuilder resultBuilder = new TextEditsBuilder(source, regions, this.tokenManager, this.workingOptions);
+ resultBuilder.setAlignChar(DefaultCodeFormatterOptions.SPACE);
+ for (Token token : this.tokens) {
+ List<Token> structure = token.getInternalStructure();
+ if (structure != null && !structure.isEmpty())
+ resultBuilder.processComment(token);
+ }
+
+ for (TextEdit edit : resultBuilder.getEdits()) {
+ result.addChild(edit);
+ }
+ return result;
+ }
+
+ private ASTNode parseSourceCode(int kind) {
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
+ Map<String, String> parserOptions = JavaCore.getOptions();
+ parserOptions.put(CompilerOptions.OPTION_Source, this.sourceLevel);
+ parser.setCompilerOptions(parserOptions);
+
+ switch (kind & K_MASK) {
+ case K_COMPILATION_UNIT:
+ return parseSourceCode(parser, ASTParser.K_COMPILATION_UNIT, true);
+ case K_CLASS_BODY_DECLARATIONS:
+ return parseSourceCode(parser, ASTParser.K_CLASS_BODY_DECLARATIONS, false);
+ case K_STATEMENTS:
+ return parseSourceCode(parser, ASTParser.K_STATEMENTS, false);
+ case K_EXPRESSION:
+ return parseSourceCode(parser, ASTParser.K_EXPRESSION, false);
+ case K_UNKNOWN:
+ int[] parserModes = { ASTParser.K_COMPILATION_UNIT, ASTParser.K_EXPRESSION,
+ ASTParser.K_CLASS_BODY_DECLARATIONS, ASTParser.K_STATEMENTS };
+ for (int parserMode : parserModes) {
+ ASTNode astNode = parseSourceCode(parser, parserMode, false);
+ if (astNode != null)
+ return astNode;
+ parser.setCompilerOptions(parserOptions); // parser loses compiler options after every use
+ }
+ return null;
+ default:
throw new IllegalArgumentException();
}
- return null;
}
- private TextEdit formatClassBodyDeclarations(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) {
- ASTNode[] bodyDeclarations = this.codeSnippetParsingUtil.parseClassBodyDeclarations(source.toCharArray(), getDefaultCompilerOptions(), true);
+ private ASTNode parseSourceCode(ASTParser parser, int parserMode, boolean ignoreErrors) {
+ parser.setKind(parserMode);
+ parser.setSource(this.sourceArray);
+ ASTNode astNode = parser.createAST(null);
+ if (ignoreErrors)
+ return astNode;
- if (bodyDeclarations == null) {
- // a problem occurred while parsing the source
- return null;
- }
- return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments);
- }
-
- /*
- * Format a javadoc comment.
- * Since bug 102780 this is done by a specific method when new javadoc formatter is activated.
- */
- private TextEdit formatComment(int kind, String source, int indentationLevel, String lineSeparator, IRegion[] regions) {
- Object oldOption = oldCommentFormatOption();
- boolean isFormattingComments = false;
- if (oldOption == null) {
- switch (kind & K_MASK) {
- case K_SINGLE_LINE_COMMENT:
- isFormattingComments = DefaultCodeFormatterConstants.TRUE.equals(this.options.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT));
- break;
- case K_MULTI_LINE_COMMENT:
- isFormattingComments = DefaultCodeFormatterConstants.TRUE.equals(this.options.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT));
- break;
- case K_JAVA_DOC:
- isFormattingComments = DefaultCodeFormatterConstants.TRUE.equals(this.options.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT));
+ boolean hasErrors = false;
+ CompilationUnit root = (CompilationUnit) astNode.getRoot();
+ for (IProblem problem : root.getProblems()) {
+ if (problem.isError()) {
+ hasErrors = true;
+ break;
}
- } else {
- isFormattingComments = DefaultCodeFormatterConstants.TRUE.equals(oldOption);
}
- if (isFormattingComments) {
- if (lineSeparator != null) {
- this.preferences.line_separator = lineSeparator;
- } else {
- this.preferences.line_separator = Util.LINE_SEPARATOR;
- }
- this.preferences.initial_indentation_level = indentationLevel;
- if (this.codeSnippetParsingUtil == null) this.codeSnippetParsingUtil = new CodeSnippetParsingUtil();
- this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true);
- this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, true);
- IRegion coveredRegion = getCoveredRegion(regions);
- int start = coveredRegion.getOffset();
- int end = start + coveredRegion.getLength();
- this.newCodeFormatter.formatComment(kind, source, start, end, indentationLevel);
- return this.newCodeFormatter.scribe.getRootEdit();
- }
- return null;
+ return hasErrors ? null : astNode;
}
- private TextEdit formatCompilationUnit(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) {
- CompilationUnitDeclaration compilationUnitDeclaration = this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true);
-
- if (lineSeparator != null) {
- this.preferences.line_separator = lineSeparator;
- } else {
- this.preferences.line_separator = Util.LINE_SEPARATOR;
- }
- this.preferences.initial_indentation_level = indentationLevel;
-
- this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, includeComments);
-
- return this.newCodeFormatter.format(source, compilationUnitDeclaration);
- }
-
- private TextEdit formatExpression(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) {
- Expression expression = this.codeSnippetParsingUtil.parseExpression(source.toCharArray(), getDefaultCompilerOptions(), true);
-
- if (expression == null) {
- // a problem occurred while parsing the source
- return null;
- }
- return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments);
- }
-
- private TextEdit formatStatements(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) {
- ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false);
-
- if (constructorDeclaration.statements == null) {
- // a problem occured while parsing the source
- return null;
- }
- return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments);
- }
-
- private IRegion getCoveredRegion(IRegion[] regions) {
- int length = regions.length;
- if (length == 1) {
- return regions[0];
- }
-
- int offset = regions[0].getOffset();
- IRegion lastRegion = regions[length - 1];
-
- return new Region(offset, lastRegion.getOffset() + lastRegion.getLength() - offset);
- }
-
- public String getDebugOutput() {
- return this.newCodeFormatter.scribe.toString();
- }
-
- private Map getDefaultCompilerOptions() {
- if (this.defaultCompilerOptions == null) {
- Map optionsMap = new HashMap(30);
- optionsMap.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE);
- optionsMap.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE);
- optionsMap.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE);
- optionsMap.put(CompilerOptions.OPTION_MethodParametersAttribute, CompilerOptions.DO_NOT_GENERATE);
- optionsMap.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.PRESERVE);
- optionsMap.put(CompilerOptions.OPTION_DocCommentSupport, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportMethodWithConstructorName, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportOverridingMethodWithoutSuperInvocation, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedObjectAllocation, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportEmptyStatement, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportAssertIdentifier, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, CompilerOptions.PUBLIC);
- optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagDescription, CompilerOptions.RETURN_TAG);
- optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, CompilerOptions.PUBLIC);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTagsOverriding, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocComments, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
- optionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
- optionsMap.put(CompilerOptions.OPTION_TaskTags, Util.EMPTY_STRING);
- optionsMap.put(CompilerOptions.OPTION_TaskPriorities, Util.EMPTY_STRING);
- optionsMap.put(CompilerOptions.OPTION_TaskCaseSensitive, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportUnavoidableGenericTypeProblems, CompilerOptions.ENABLED);
- optionsMap.put(CompilerOptions.OPTION_MaxProblemPerUnit, String.valueOf(100));
- optionsMap.put(CompilerOptions.OPTION_InlineJsr, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ShareCommonFinallyBlocks, CompilerOptions.DISABLED);
- optionsMap.put(CompilerOptions.OPTION_ReportMethodCanBeStatic, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportMethodCanBePotentiallyStatic, CompilerOptions.IGNORE);
- optionsMap.put(CompilerOptions.OPTION_ReportUnusedTypeParameter, CompilerOptions.IGNORE);
- this.defaultCompilerOptions = optionsMap;
- }
- Object sourceOption = this.options.get(CompilerOptions.OPTION_Source);
- if (sourceOption != null) {
- this.defaultCompilerOptions.put(CompilerOptions.OPTION_Source, sourceOption);
- } else {
- this.defaultCompilerOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
- }
- return this.defaultCompilerOptions;
- }
-
- private TextEdit internalFormatClassBodyDeclarations(String source, int indentationLevel, String lineSeparator, ASTNode[] bodyDeclarations, IRegion[] regions, boolean includeComments) {
- if (lineSeparator != null) {
- this.preferences.line_separator = lineSeparator;
- } else {
- this.preferences.line_separator = Util.LINE_SEPARATOR;
- }
- this.preferences.initial_indentation_level = indentationLevel;
-
- this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, includeComments);
- return this.newCodeFormatter.format(source, bodyDeclarations);
- }
-
- private TextEdit internalFormatExpression(String source, int indentationLevel, String lineSeparator, Expression expression, IRegion[] regions, boolean includeComments) {
- if (lineSeparator != null) {
- this.preferences.line_separator = lineSeparator;
- } else {
- this.preferences.line_separator = Util.LINE_SEPARATOR;
- }
- this.preferences.initial_indentation_level = indentationLevel;
-
- this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, includeComments);
-
- TextEdit textEdit = this.newCodeFormatter.format(source, expression);
- return textEdit;
- }
-
- private TextEdit internalFormatStatements(String source, int indentationLevel, String lineSeparator, ConstructorDeclaration constructorDeclaration, IRegion[] regions, boolean includeComments) {
- if (lineSeparator != null) {
- this.preferences.line_separator = lineSeparator;
- } else {
- this.preferences.line_separator = Util.LINE_SEPARATOR;
- }
- this.preferences.initial_indentation_level = indentationLevel;
-
- this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, includeComments);
-
- return this.newCodeFormatter.format(source, constructorDeclaration);
- }
-
- /**
- * Deprecated as using old option constant
- * @deprecated
- */
- private Object oldCommentFormatOption() {
- return this.options.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT);
- }
-
- private TextEdit probeFormatting(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) {
- if (PROBING_SCANNER == null) {
- // scanner use to check if the kind could be K_JAVA_DOC, K_MULTI_LINE_COMMENT or K_SINGLE_LINE_COMMENT
- // do not tokenize white spaces to get single comments even with spaces before...
- PROBING_SCANNER = new Scanner(true, false/*do not tokenize whitespaces*/, false/*nls*/, ClassFileConstants.JDK1_6, ClassFileConstants.JDK1_6, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
- }
- PROBING_SCANNER.setSource(source.toCharArray());
-
- IRegion coveredRegion = getCoveredRegion(regions);
- int offset = coveredRegion.getOffset();
- int length = coveredRegion.getLength();
-
- PROBING_SCANNER.resetTo(offset, offset + length - 1);
- try {
- int kind = -1;
- switch(PROBING_SCANNER.getNextToken()) {
- case ITerminalSymbols.TokenNameCOMMENT_BLOCK :
- if (PROBING_SCANNER.getNextToken() == TerminalTokens.TokenNameEOF) {
- kind = K_MULTI_LINE_COMMENT;
- }
+ private void tokenizeSource() {
+ this.tokens.clear();
+ Scanner scanner = new Scanner(true, false, false/* nls */, CompilerOptions.versionToJdkLevel(this.sourceLevel),
+ null/* taskTags */, null/* taskPriorities */, false/* taskCaseSensitive */);
+ scanner.setSource(this.sourceArray);
+ while (true) {
+ try {
+ int tokenType = scanner.getNextToken();
+ if (tokenType == TokenNameEOF)
break;
- case ITerminalSymbols.TokenNameCOMMENT_LINE :
- if (PROBING_SCANNER.getNextToken() == TerminalTokens.TokenNameEOF) {
- kind = K_SINGLE_LINE_COMMENT;
- }
- break;
- case ITerminalSymbols.TokenNameCOMMENT_JAVADOC :
- if (PROBING_SCANNER.getNextToken() == TerminalTokens.TokenNameEOF) {
- kind = K_JAVA_DOC;
- }
- break;
+ Token token = Token.fromCurrent(scanner, tokenType);
+ this.tokens.add(token);
+ } catch (InvalidInputException e) {
+ Token token = Token.fromCurrent(scanner, TokenNameNotAToken);
+ this.tokens.add(token);
}
- if (kind != -1) {
- return formatComment(kind, source, indentationLevel, lineSeparator, regions);
- }
- } catch (InvalidInputException e) {
- // ignore
}
- PROBING_SCANNER.setSource((char[]) null);
+ }
- // probe for expression
- Expression expression = this.codeSnippetParsingUtil.parseExpression(source.toCharArray(), getDefaultCompilerOptions(), true);
- if (expression != null) {
- return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments);
+ private void prepareSpaces() {
+ SpacePreparator spacePreparator = new SpacePreparator(this.tokenManager, this.workingOptions);
+ this.astRoot.accept(spacePreparator);
+ spacePreparator.finishUp();
+ }
+
+ private void prepareLineBreaks() {
+ LineBreaksPreparator breaksPreparator = new LineBreaksPreparator(this.tokenManager, this.workingOptions);
+ this.astRoot.accept(breaksPreparator);
+ breaksPreparator.finishUp();
+ }
+
+ private void prepareComments() {
+ CommentsPreparator commentsPreparator = new CommentsPreparator(this.tokenManager, this.workingOptions,
+ this.sourceLevel);
+ List<Comment> comments = ((CompilationUnit) this.astRoot.getRoot()).getCommentList();
+ for (Comment comment : comments) {
+ comment.accept(commentsPreparator);
}
+ commentsPreparator.finishUp();
+ }
- // probe for body declarations (fields, methods, constructors)
- ASTNode[] bodyDeclarations = this.codeSnippetParsingUtil.parseClassBodyDeclarations(source.toCharArray(), getDefaultCompilerOptions(), true);
- if (bodyDeclarations != null) {
- return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments);
- }
-
- // probe for statements
- ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false);
- if (constructorDeclaration.statements != null) {
- return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments);
- }
-
- // this has to be a compilation unit
- return formatCompilationUnit(source, indentationLevel, lineSeparator, regions, includeComments);
+ private void prepareWraps(int kind) {
+ WrapPreparator wrapPreparator = new WrapPreparator(this.tokenManager, this.workingOptions, kind);
+ this.astRoot.accept(wrapPreparator);
+ wrapPreparator.finishUp(this.astRoot);
}
/**
* True if
- * 1. All regions are within maxLength
- * 2. regions are sorted
- * 3. regions are not overlapping
+ * <li>1. All regions are within maxLength
+ * <li>2. regions are sorted
+ * <li>3. regions are not overlapping
*/
private boolean regionsSatisfiesPreconditions(IRegion[] regions, int maxLength) {
int regionsLength = regions == null ? 0 : regions.length;
@@ -485,13 +391,14 @@
}
int lastOffset = first.getOffset() + first.getLength() - 1;
- for (int i= 1; i < regionsLength; i++) {
+ for (int i = 1; i < regionsLength; i++) {
IRegion current = regions[i];
if (lastOffset > current.getOffset()) {
return false;
}
- if (current.getOffset() < 0 || current.getLength() < 0 || current.getOffset() + current.getLength() > maxLength) {
+ if (current.getOffset() < 0 || current.getLength() < 0
+ || current.getOffset() + current.getLength() > maxLength) {
return false;
}
@@ -500,4 +407,37 @@
return true;
}
+
+ private void updateWorkingOptions(int indentationLevel, String lineSeparator, int kind) {
+ this.workingOptions.line_separator = lineSeparator != null ? lineSeparator
+ : this.originalOptions.line_separator;
+ if (this.workingOptions.line_separator == null)
+ this.workingOptions.line_separator = Util.LINE_SEPARATOR;
+
+ this.workingOptions.initial_indentation_level = indentationLevel;
+
+ this.workingOptions.comment_format_javadoc_comment = this.originalOptions.comment_format_javadoc_comment
+ && canFormatComment(kind, K_JAVA_DOC);
+ this.workingOptions.comment_format_block_comment = this.originalOptions.comment_format_block_comment
+ && canFormatComment(kind, K_MULTI_LINE_COMMENT);
+ this.workingOptions.comment_format_line_comment = this.originalOptions.comment_format_line_comment
+ && canFormatComment(kind, K_SINGLE_LINE_COMMENT);
+ }
+
+ private boolean canFormatComment(int kind, int commentKind) {
+ if ((kind & F_INCLUDE_COMMENTS) != 0)
+ return true;
+ if (DefaultCodeFormatterConstants.FALSE.equals(this.oldCommentFormatOption))
+ return false;
+ if ((kind & K_MASK) == commentKind)
+ return true;
+ if (kind == K_UNKNOWN && DefaultCodeFormatterConstants.TRUE.equals(this.oldCommentFormatOption))
+ return true;
+ return false;
+ }
+
+ @Override
+ public void setOptions(Map<String, String> options) {
+ initOptions(null, options);
+ }
}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
index 0e5e022..49d76b0 100644
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
* Brock Janiczak - Contribution for bug 150741
* Ray V. (voidstar@gmail.com) - Contribution for bug 282988
* Jesper S Moller - Contribution for bug 402173
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
*******************************************************************************/
package org.aspectj.org.eclipse.jdt.internal.formatter;
@@ -19,15 +20,72 @@
import org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.aspectj.org.eclipse.jdt.core.JavaCore;
import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
-import org.aspectj.org.eclipse.jdt.internal.formatter.align.Alignment;
/**
* This is still subject to changes before 3.0.
* @since 3.0
*/
-@SuppressWarnings({ "rawtypes", "unchecked" })
public class DefaultCodeFormatterOptions {
+
+ /** Internal constants related to wrapping alignment settings */
+ public static class Alignment {
+
+ /*
+ * Alignment modes
+ */
+ public static final int M_FORCE = 1; // if bit set, then alignment will be non-optional (default is optional)
+ public static final int M_INDENT_ON_COLUMN = 2; // if bit set, broken fragments will be aligned on current location column (default is to break at current indentation level)
+ public static final int M_INDENT_BY_ONE = 4; // if bit set, broken fragments will be indented one level below current (not using continuation indentation)
+
+ // split modes can be combined either with M_FORCE or M_INDENT_ON_COLUMN
+
+ /** foobar(#fragment1, #fragment2, <ul>
+ * <li> #fragment3, #fragment4 </li>
+ * </ul>
+ */
+ public static final int M_COMPACT_SPLIT = 16; // fill each line with all possible fragments
+
+ /** foobar(<ul>
+ * <li> #fragment1, #fragment2, </li>
+ * <li> #fragment3, #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_COMPACT_FIRST_BREAK_SPLIT = 32; // compact mode, but will first try to break before first fragment
+
+ /** foobar(<ul>
+ * <li> #fragment1, </li>
+ * <li> #fragment2, </li>
+ * <li> #fragment3 </li>
+ * <li> #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_ONE_PER_LINE_SPLIT = 32+16; // one fragment per line
+
+ /**
+ * foobar(<ul>
+ * <li> #fragment1, </li>
+ * <li> #fragment2, </li>
+ * <li> #fragment3 </li>
+ * <li> #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_NEXT_SHIFTED_SPLIT = 64; // one fragment per line, subsequent are indented further
+
+ /** foobar(#fragment1, <ul>
+ * <li> #fragment2, </li>
+ * <li> #fragment3 </li>
+ * <li> #fragment4, </li>
+ * </ul>
+ */
+ public static final int M_NEXT_PER_LINE_SPLIT = 64+16; // one per line, except first fragment (if possible)
+
+ public static final int M_NO_ALIGNMENT = 0;
+
+ public static final int SPLIT_MASK = M_ONE_PER_LINE_SPLIT | M_NEXT_SHIFTED_SPLIT | M_COMPACT_SPLIT | M_COMPACT_FIRST_BREAK_SPLIT | M_NEXT_PER_LINE_SPLIT;
+ }
+
+
public static final int TAB = 1;
public static final int SPACE = 2;
public static final int MIXED = 4;
@@ -63,6 +121,7 @@
public int alignment_for_enum_constants;
public int alignment_for_expressions_in_array_initializer;
public int alignment_for_method_declaration;
+ // TODO following option cannot be set in preferences dialog (but it's used by old.CodeFormatter)
public int alignment_for_multiple_fields;
public int alignment_for_parameters_in_constructor_declaration;
public int alignment_for_parameters_in_method_declaration;
@@ -174,6 +233,7 @@
public boolean insert_space_after_closing_paren_in_cast;
public boolean insert_space_after_closing_brace_in_block;
public boolean insert_space_after_colon_in_assert;
+ //TODO field is never used
public boolean insert_space_after_colon_in_case;
public boolean insert_space_after_colon_in_conditional;
public boolean insert_space_after_colon_in_for;
@@ -338,7 +398,6 @@
public boolean join_lines_in_comments;
public boolean put_empty_statement_on_new_line;
public int tab_size;
- public final char filling_space = ' ';
public int page_width;
public int tab_char;
public boolean use_tabs_only_for_leading_indentations;
@@ -353,7 +412,7 @@
// cannot be instantiated
}
- public DefaultCodeFormatterOptions(Map settings) {
+ public DefaultCodeFormatterOptions(Map<String, String> settings) {
setDefaultSettings();
if (settings == null) return;
set(settings);
@@ -363,8 +422,8 @@
return Integer.toString(alignment);
}
- public Map getMap() {
- Map options = new HashMap();
+ public Map<String, String> getMap() {
+ Map<String, String> options = new HashMap<String, String>();
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION, getAlignment(this.alignment_for_arguments_in_allocation_expression));
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ANNOTATION, getAlignment(this.alignment_for_arguments_in_annotation));
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT, getAlignment(this.alignment_for_arguments_in_enum_constant));
@@ -443,7 +502,7 @@
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, this.indent_empty_lines ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
- options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size));
+ options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.tab_char == MIXED ? this.indentation_size : this.tab_size)); // reverse values swapping performed by IndentationTabPage
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, this.insert_new_line_after_annotation_on_type ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_TYPE_ANNOTATION, this.insert_new_line_after_type_annotation ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, this.insert_new_line_after_annotation_on_field ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
@@ -651,7 +710,7 @@
options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED);
break;
}
- options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, Integer.toString(this.tab_size));
+ options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, Integer.toString(this.tab_char == MIXED ? this.tab_size : this.indentation_size)); // reverse values swapping performed by IndentationTabPage
options.put(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, this.use_tabs_only_for_leading_indentations ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
options.put(DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BINARY_OPERATOR, this.wrap_before_binary_operator ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
options.put(DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH, this.wrap_before_or_operator_multicatch ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
@@ -662,7 +721,7 @@
return options;
}
- public void set(Map settings) {
+ public void set(Map<String, String> settings) {
final Object alignmentForArgumentsInAllocationExpressionOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION);
if (alignmentForArgumentsInAllocationExpressionOption != null) {
try {
@@ -768,9 +827,9 @@
try {
this.alignment_for_enum_constants = Integer.parseInt((String) alignmentForEnumConstantsOption);
} catch (NumberFormatException e) {
- this.alignment_for_enum_constants = Alignment.NONE;
+ this.alignment_for_enum_constants = Alignment.M_NO_ALIGNMENT;
} catch (ClassCastException e) {
- this.alignment_for_enum_constants = Alignment.NONE;
+ this.alignment_for_enum_constants = Alignment.M_NO_ALIGNMENT;
}
}
final Object alignmentForExpressionsInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
@@ -1256,13 +1315,19 @@
}
final Object indentationSizeOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE);
if (indentationSizeOption != null) {
+ int indentationSize = 4;
try {
- this.indentation_size = Integer.parseInt((String) indentationSizeOption);
+ indentationSize = Integer.parseInt((String) indentationSizeOption);
} catch (NumberFormatException e) {
- this.indentation_size = 4;
+ // keep default
} catch(ClassCastException e) {
- this.indentation_size = 4;
+ // keep default
}
+ // reverse values swapping performed by IndentationTabPage
+ if (DefaultCodeFormatterConstants.MIXED.equals(settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR)))
+ this.indentation_size = indentationSize;
+ else
+ this.tab_size = indentationSize;
}
final Object insertNewLineAfterOpeningBraceInArrayInitializerOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER);
if (insertNewLineAfterOpeningBraceInArrayInitializerOption != null) {
@@ -2024,13 +2089,19 @@
}
final Object tabSizeOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE);
if (tabSizeOption != null) {
+ int tabSize = 4;
try {
- this.tab_size = Integer.parseInt((String) tabSizeOption);
+ tabSize = Integer.parseInt((String) tabSizeOption);
} catch (NumberFormatException e) {
- this.tab_size = 4;
+ // keep default
} catch(ClassCastException e) {
- this.tab_size = 4;
+ // keep default
}
+ // reverse values swapping performed by IndentationTabPage
+ if (DefaultCodeFormatterConstants.MIXED.equals(settings.get(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR)))
+ this.tab_size = tabSize;
+ else
+ this.indentation_size = tabSize;
}
final Object useTabsOnlyForLeadingIndentationsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS);
if (useTabsOnlyForLeadingIndentationsOption != null) {
@@ -2115,7 +2186,7 @@
* @param settings the given map
* @deprecated
*/
- private void setDeprecatedOptions(Map settings) {
+ private void setDeprecatedOptions(Map<String, String> settings) {
// backward compatibility code
final Object commentClearBlankLinesOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES);
if (commentClearBlankLinesOption != null) {
@@ -2211,7 +2282,7 @@
this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT;
this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
- this.alignment_for_enum_constants = Alignment.NONE;
+ this.alignment_for_enum_constants = Alignment.M_NO_ALIGNMENT;
this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
this.alignment_for_method_declaration = Alignment.M_NO_ALIGNMENT;
this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
@@ -2502,7 +2573,7 @@
this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT;
this.alignment_for_compact_if = Alignment.M_COMPACT_SPLIT;
this.alignment_for_conditional_expression = Alignment.M_NEXT_PER_LINE_SPLIT;
- this.alignment_for_enum_constants = Alignment.NONE;
+ this.alignment_for_enum_constants = Alignment.M_NO_ALIGNMENT;
this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
this.alignment_for_method_declaration = Alignment.M_NO_ALIGNMENT;
this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadoc.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadoc.java
deleted file mode 100644
index cacea14..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadoc.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Javadoc;
-
-/**
- * Represents a full Javadoc comment for the {@link FormatterCommentParser}.
- * <p>
- * It might have one or several blocks ( see {@link FormatJavadocBlock}). The
- * javadoc comment might starts with a <b>description</b> which means that its
- * first block has no tag.
- * </p>
- */
-public class FormatJavadoc extends Javadoc {
-
- FormatJavadocBlock[] blocks;
- int textStart, textEnd;
- int lineStart, lineEnd;
-
-public FormatJavadoc(int sourceStart, int sourceEnd, int length) {
- super(sourceStart, sourceEnd);
- if (length > 0) {
- this.blocks = new FormatJavadocBlock[length];
- }
-}
-
-/**
- * Return the first block of the javadoc or <code>null</code> if has no block
- * at all.
- *
- * @return a {@link FormatJavadocBlock} or <code>null</code>.
- */
-public FormatJavadocBlock getFirstBlock() {
- if (this.blocks != null) {
- return this.blocks[0];
- }
- return null;
-}
-
-/**
- * Returns whether it has several lines or not.
- *
- * @return <code>true</code> if the javadoc comment has several lines
- * <code>false</code> otherwise (e.g. header and footer are on the same
- * line).
- */
-public boolean isMultiLine() {
- return this.lineStart < this.lineEnd;
-}
-
-public String toDebugString(char[] source) {
- if (this.blocks == null) {
- return "No block in current Javadoc comment"; //$NON-NLS-1$
- }
- StringBuffer buffer = new StringBuffer();
- int length = this.blocks.length;
- for (int i=0; i<length; i++) {
- this.blocks[i].toStringDebug(buffer, source);
- buffer.append('\n');
- }
- return buffer.toString();
-}
-
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java
deleted file mode 100644
index fac6879..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner;
-import org.aspectj.org.eclipse.jdt.internal.formatter.comment.IJavaDocTagConstants;
-
-/**
- * Represents a block in a {@link FormatJavadoc} which might be a
- * <b>description</b> or a <b>tag</b> (see{@link #isDescription()}).
- * </p><p>
- * The block might have a tag, a reference and nodes (see
- * {@link FormatJavadocNode}. Each of these elements might be present or not,
- * but at least one of them is.
- * </p>
- */
-public class FormatJavadocBlock extends FormatJavadocNode implements IJavaDocTagConstants {
- // flags
- final static int INLINED = 0x0001;
- final static int FIRST = 0x0002;
- final static int ON_HEADER_LINE = 0x0004;
- final static int TEXT_ON_TAG_LINE = 0x0008;
- final static int ONE_LINE_TAG = 0x0010;
- final static int PARAM_TAG = 0x0020;
- final static int IN_PARAM_TAG = 0x0040;
- final static int IN_DESCRIPTION = 0x0080;
- final static int IMMUTABLE = 0x0100;
-
- // constants
- final static int MAX_TAG_HIERARCHY = 10;
-
- private int tagValue = NO_TAG_VALUE;
- int tagEnd;
- FormatJavadocReference reference;
- FormatJavadocNode[] nodes;
- int nodesPtr = -1;
- int flags = 0;
-
-public FormatJavadocBlock(int start, int end, int line, int value) {
- super(start, end, line);
- this.tagValue = value;
- this.tagEnd = end;
- switch (value) {
- case TAG_PARAM_VALUE:
- // TODO why are following tags considered like @param by the formatter?
- case TAG_SERIAL_FIELD_VALUE:
- case TAG_THROWS_VALUE:
- case TAG_EXCEPTION_VALUE:
- this.flags |= PARAM_TAG;
- break;
- case TAG_CODE_VALUE:
- case TAG_LITERAL_VALUE:
- this.flags |= IMMUTABLE;
- break;
- }
-}
-
-private void addNode(FormatJavadocNode node) {
- // Initialize or resize array if necessary
- if (++this.nodesPtr == 0) {
- this.nodes = new FormatJavadocNode[DEFAULT_ARRAY_SIZE];
- } else if (this.nodesPtr >= this.nodes.length) {
- System.arraycopy(
- this.nodes, 0,
- this.nodes = new FormatJavadocNode[this.nodes.length+INCREMENT_ARRAY_SIZE], 0,
- this.nodesPtr);
- }
-
- // Store the node
- this.nodes[this.nodesPtr] = node;
- this.sourceEnd = node.sourceEnd;
-}
-
-void addBlock(FormatJavadocBlock block, int htmlLevel) {
- if (this.nodes != null) {
- FormatJavadocText[] textHierarchy = getTextHierarchy(block, htmlLevel);
- if (textHierarchy != null) {
- FormatJavadocText lastText = textHierarchy[htmlLevel];
- if (lastText != null) {
- lastText.appendNode(block);
- for (int i=htmlLevel-1; i>=0; i--) {
- textHierarchy[i].sourceEnd = block.sourceEnd;
- }
- this.sourceEnd = block.sourceEnd;
- if (isParamTag()) {
- block.flags |= IN_PARAM_TAG;
- } else if (isDescription()) {
- block.flags |= IN_DESCRIPTION;
- }
- block.flags |= INLINED;
- return;
- }
- }
- }
- addNode(block);
- if (isParamTag()) {
- block.flags |= IN_PARAM_TAG;
- } else if (isDescription()) {
- block.flags |= IN_DESCRIPTION;
- }
- block.flags |= INLINED;
-}
-
-void addText(FormatJavadocText text) {
- if (this.nodes != null) {
- FormatJavadocText[] textHierarchy = getTextHierarchy(text, text.depth);
- if (textHierarchy != null) {
- FormatJavadocText lastText = textHierarchy[text.depth];
- if (lastText != null) {
- lastText.appendText(text);
- for (int i=text.depth-1; i>=0; i--) {
- textHierarchy[i].sourceEnd = text.sourceEnd;
- }
- this.sourceEnd = text.sourceEnd;
- return;
- }
- if (text.depth > 0) {
- FormatJavadocText parentText = textHierarchy[text.depth-1];
- if (parentText != null) {
- parentText.appendText(text);
- for (int i=text.depth-2; i>=0; i--) {
- textHierarchy[i].sourceEnd = text.sourceEnd;
- }
- this.sourceEnd = text.sourceEnd;
- return;
- }
- }
- }
- }
- if (text.isHtmlTag()) {
- switch (text.getHtmlTagID()) {
- case JAVADOC_CODE_TAGS_ID:
- text.linesBefore = this.nodesPtr == -1 ? 0 : 2;
- break;
- case JAVADOC_SEPARATOR_TAGS_ID:
- text.linesBefore = 1;
- break;
-// case JAVADOC_BREAK_TAGS_ID:
-// if (this.nodesPtr >= 0) text.linesBefore = 1;
- }
- }
- addNode(text);
- if (isImmutable()) {
- text.immutable = true;
- }
-}
-
-void clean() {
- int length = this.nodes == null ? 0 : this.nodes.length;
- if (this.nodesPtr != (length-1)) {
- System.arraycopy(this.nodes, 0, this.nodes = new FormatJavadocNode[this.nodesPtr+1], 0, this.nodesPtr+1);
- }
- for (int i=0; i<=this.nodesPtr; i++) {
- this.nodes[i].clean();
- }
-}
-
-FormatJavadocNode getLastNode() {
- if (this.nodes != null) {
- return this.nodes[this.nodesPtr];
- }
- return null;
-}
-
-/*
- * Return the text hierarchy for the given node
- */
-FormatJavadocText[] getTextHierarchy(FormatJavadocNode node, int htmlDepth) {
- if (this.nodes == null) return null;
- FormatJavadocText[] textHierarchy = null;
- int ptr = 0;
- FormatJavadocText text = node.isText() ? (FormatJavadocText) node : null;
- FormatJavadocNode lastNode = this.nodes[this.nodesPtr];
- while (lastNode.isText()) {
- FormatJavadocText lastText = (FormatJavadocText) lastNode;
- int lastTagCategory = lastText.getHtmlTagID();
- boolean lastSingleTag = lastTagCategory <= JAVADOC_SINGLE_TAGS_ID;
- boolean lastTextCanHaveChildren = lastText.isHtmlTag() && !lastText.isClosingHtmlTag() && !lastSingleTag;
- if (lastText.depth == htmlDepth || // found same html tag level => use it
- lastText.htmlNodesPtr == -1) { // no more sub-levels => add one
- // Text breakage
- if (lastText.isHtmlTag()) {
- // Set some lines before if previous was specific html tag
- // The added text is concerned if the parent has no child yet or is top level and closing html tag
- boolean setLinesBefore = lastText.separatorsPtr == -1 || (ptr == 0 && lastText.isClosingHtmlTag());
- if (!setLinesBefore && ptr > 0 && lastText.isClosingHtmlTag()) {
- // for non-top level closing html tag, text is concerned only if no new text has been written after
- FormatJavadocText parentText = textHierarchy[ptr-1];
- int textStart = (int) parentText.separators[parentText.separatorsPtr];
- if (textStart < lastText.sourceStart) {
- setLinesBefore = true;
- }
- }
- if (setLinesBefore) {
- switch (lastText.getHtmlTagID()) {
- case JAVADOC_CODE_TAGS_ID:
- if (node.linesBefore < 2) {
- node.linesBefore = 2;
- }
- break;
- case JAVADOC_SEPARATOR_TAGS_ID:
- case JAVADOC_SINGLE_BREAK_TAG_ID:
- if (node.linesBefore < 1) {
- node.linesBefore = 1;
- }
- }
- }
- // If adding an html tag on same html tag, then close previous one and leave
- if (text != null && text.isHtmlTag() && !text.isClosingHtmlTag() && text.getHtmlTagIndex() == lastText.getHtmlTagIndex() && !lastText.isClosingHtmlTag()) {
- lastText.closeTag();
- return textHierarchy;
- }
- }
- // If we have a text after another text, keep the same level to append
- if (lastTextCanHaveChildren || (htmlDepth == 0 && !lastText.isHtmlTag() && text != null && !text.isHtmlTag())) {
- if (textHierarchy == null) textHierarchy = new FormatJavadocText[htmlDepth+1];
- textHierarchy[ptr] = lastText;
- return textHierarchy;
- }
- // Last text cannot have children, so return the built hierarchy
- return textHierarchy;
- }
- if (textHierarchy == null) textHierarchy = new FormatJavadocText[htmlDepth+1];
- textHierarchy[ptr++] = lastText;
- lastNode = lastText.htmlNodes[lastText.htmlNodesPtr];
- }
- return textHierarchy;
-}
-
-/**
- * Returns whether the text is on the same line of the tag or not.
- *
- * @return <code>true</code> if the text is on the same line than the tag,
- * <code>false</code> otherwise.
- */
-public boolean hasTextOnTagLine() {
- return (this.flags & TEXT_ON_TAG_LINE) != 0;
-}
-
-/**
- * Returns whether the block is the javadoc comment description or not.
- * The description begins after the starting delimiter and continues until the tag
- * section.
- *
- * @return <code>true</code> if the block is the javadoc description,
- * <code>false</code> otherwise.
- */
-public boolean isDescription() {
- return this.tagValue == NO_TAG_VALUE;
-}
-
-/**
- * Returns whether the block is the first block of the javadoc comment or not
- * (independently of the fact it's a description or not).
- *
- * @return <code>true</code> if the block is the first of the javadoc
- * comment, <code>false</code> otherwise.
- */
-public boolean isFirst() {
- return (this.flags & FIRST) != 0;
-}
-
-/**
- * Returns whether the first block starts on the same line than the javadoc
- * starting delimiter or not.
- *
- * @return <code>true</code> if the the first block starts on the same line
- * than the javadoc starting delimiter, <code>false</code> otherwise.
- */
-public boolean isHeaderLine() {
- return (this.flags & ON_HEADER_LINE) != 0;
-}
-
-/**
- * Returns whether the block is immutable or not.
- * <p>
- * Currently, only {@code} and {@literal} inline tags block are considered as
- * immutable.
- * </p>
- * @return <code>true</code> if the block is immutable,
- * <code>false</code> otherwise.
- */
-public boolean isImmutable() {
- return (this.flags & IMMUTABLE) == IMMUTABLE;
-}
-
-/**
- * Returns whether the block is a description or inlined in a description.
- * @see #isParamTag()
- *
- * @return <code>true</code> if the block is a description or inlined in a
- * description, <code>false</code> otherwise.
- */
-public boolean isInDescription() {
- return this.tagValue == NO_TAG_VALUE || (this.flags & IN_DESCRIPTION) == IN_DESCRIPTION;
-}
-
-/**
- * Returns whether the text is on the same line of the tag.
- *
- * @return <code>true</code> if the text is on the same line than the tag,
- * <code>false</code> otherwise.
- */
-public boolean isInlined() {
- return (this.flags & INLINED) != 0;
-}
-
-/**
- * Returns whether the block is a param tag or inlined in a param tag.
- * @see #isParamTag()
- *
- * @return <code>true</code> if the block is a param tag or inlined in a param
- * tag, <code>false</code> otherwise.
- */
-public boolean isInParamTag() {
- return (this.flags & (PARAM_TAG | IN_PARAM_TAG)) != 0;
-}
-
-/**
- * Returns whether the the tag is on one line only.
- *
- * @return <code>true</code> if the tag is on one line only,
- * <code>false</code> otherwise.
- */
-public boolean isOneLineTag() {
- return (this.flags & ONE_LINE_TAG) != 0;
-}
-
-/**
- * Returns whether the block is a param tag or not. Note that this also includes
- * @serialField, @throws and @exception tags.
- *
- * @return <code>true</code> if the block is a param tag,
- * <code>false</code> otherwise.
- */
-public boolean isParamTag() {
- return (this.flags & PARAM_TAG) == PARAM_TAG;
-}
-
-void setHeaderLine(int javadocLineStart) {
- if (javadocLineStart == this.lineStart) {
- this.flags |= ON_HEADER_LINE;
- }
- for (int i=0; i<this.nodesPtr; i++) {
- this.nodes[i].setHeaderLine(javadocLineStart);
- }
-}
-
-protected void toString(StringBuffer buffer) {
- boolean inlined = (this.flags & INLINED) != 0;
- if (inlined) buffer.append(" {"); //$NON-NLS-1$
- buffer.append('@');
- if (this.tagValue == TAG_OTHERS_VALUE) {
- buffer.append("others_tag"); //$NON-NLS-1$
- } else {
- buffer.append(TAG_NAMES[this.tagValue]);
- }
- super.toString(buffer);
- if (this.reference == null) {
- buffer.append('\n');
- } else {
- buffer.append(" ("); //$NON-NLS-1$
- this.reference.toString(buffer);
- buffer.append(")\n"); //$NON-NLS-1$
- }
- StringBuffer flagsBuffer = new StringBuffer();
- if (isDescription()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("description"); //$NON-NLS-1$
- }
- if (isFirst()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("first"); //$NON-NLS-1$
- }
- if (isHeaderLine()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("header line"); //$NON-NLS-1$
- }
- if (isImmutable()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("immutable"); //$NON-NLS-1$
- }
- if (isInDescription()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("in description"); //$NON-NLS-1$
- }
- if (isInlined()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("inlined"); //$NON-NLS-1$
- }
- if (isInParamTag()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("in param tag"); //$NON-NLS-1$
- }
- if (isOneLineTag()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("one line tag"); //$NON-NLS-1$
- }
- if (isParamTag()) {
- if (flagsBuffer.length() > 0) flagsBuffer.append(',');
- flagsBuffer.append("param tag"); //$NON-NLS-1$
- }
- if (flagsBuffer.length() > 0) {
- if (inlined) buffer.append('\t');
- buffer.append(" flags: "); //$NON-NLS-1$
- buffer.append(flagsBuffer);
- buffer.append('\n');
- }
- if (this.nodesPtr > -1) {
- for (int i = 0; i <= this.nodesPtr; i++) {
- if (inlined) buffer.append('\t');
- this.nodes[i].toString(buffer);
- }
- }
-}
-
-public String toStringDebug(char[] source) {
- StringBuffer buffer = new StringBuffer();
- toStringDebug(buffer, source);
- return buffer.toString();
-}
-
-public void toStringDebug(StringBuffer buffer, char[] source) {
- if (this.tagValue > 0) {
- buffer.append(source, this.sourceStart, this.tagEnd-this.sourceStart+1);
- buffer.append(' ');
- }
- if (this.reference != null) {
- this.reference.toStringDebug(buffer, source);
- }
- for (int i=0; i<=this.nodesPtr; i++) {
- this.nodes[i].toStringDebug(buffer, source);
- }
-}
-
-void update(Scanner scanner) {
- int blockEnd = scanner.getLineNumber(this.sourceEnd);
- if (blockEnd == this.lineStart) {
- this.flags |= FormatJavadocBlock.ONE_LINE_TAG;
- }
- for (int i=0; i<=this.nodesPtr; i++) {
- if (!this.nodes[i].isText()) {
- ((FormatJavadocBlock)this.nodes[i]).update(scanner);
- }
- }
-}
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocNode.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocNode.java
deleted file mode 100644
index 93ce472..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocNode.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocTagConstants;
-
-/**
- * Abstract class for all {@link FormatJavadoc} nodes.
- * <p>
- * The basic information for these nodes are the start and end positions in the
- * source.
- * </p>
- */
-public abstract class FormatJavadocNode implements JavadocTagConstants {
-
- // default size used for array
- final static int DEFAULT_ARRAY_SIZE = 10;
- final static int INCREMENT_ARRAY_SIZE = 10;
- protected int sourceStart, sourceEnd;
- protected int lineStart;
- protected int linesBefore = 0;
-
-public FormatJavadocNode(int start, int end, int line) {
- this.sourceStart = start;
- this.sourceEnd = end;
- this.lineStart = line;
-}
-
-abstract void clean();
-
-FormatJavadocNode getLastNode() {
- return null;
-}
-
-public int getLength() {
- return this.sourceEnd - this.sourceStart + 1;
-}
-
-/**
- * Returns whether the node is a text (see {@link FormatJavadocText} or not.
- * In case not, that means that the node is an block (see
- * {@link FormatJavadocBlock}).
- *
- * @return <code>true</code> if the node is a text <code>false</code>
- * otherwise.
- */
-public boolean isText() {
- return false;
-}
-
-/**
- * Returns whether the node is immutable or not. If <code>true</code>, then
- * the formatter will leave it contents unchanged.
- *
- * @return <code>true</code> if the node is immutable, <code>false</code>
- * otherwise.
- */
-public boolean isImmutable() {
- return false;
-}
-
-public String toString() {
- StringBuffer buffer = new StringBuffer();
- toString(buffer);
- return buffer.toString();
-}
-protected void toString(StringBuffer buffer) {
- buffer.append(": "); //$NON-NLS-1$
- buffer.append(this.sourceStart);
- buffer.append(" -> "); //$NON-NLS-1$
- buffer.append(this.sourceEnd);
-}
-
-public String toStringDebug(char[] source) {
- StringBuffer buffer = new StringBuffer();
- toStringDebug(buffer, source);
- return buffer.toString();
-}
-
-public void toStringDebug(StringBuffer buffer, char[] source) {
- buffer.append(source, this.sourceStart, this.sourceEnd-this.sourceStart+1);
- buffer.append(' ');
-}
-
-void setHeaderLine(int javadocLineStart) {
- // do nothing
-}
-
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocReference.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocReference.java
deleted file mode 100644
index 5d15b16..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocReference.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-/**
- * Represents a reference in a javadoc comment block (see
- * {@link FormatJavadocBlock}.
- * <p>
- * A specific class is used as intermediate positions need to be stored for further
- * formatting improvements (typically for qualified references).
- * </p>
- */
-public class FormatJavadocReference extends FormatJavadocNode {
-
-public FormatJavadocReference(int start, int end, int line) {
- super(start, end, line);
-}
-
-public FormatJavadocReference(long position, int line) {
- super((int) (position >>> 32), (int) position, line);
-}
-
-void clean() {
- // Clean positions when used
-}
-
-protected void toString(StringBuffer buffer) {
- buffer.append("ref"); //$NON-NLS-1$
- super.toString(buffer);
-}
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocText.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocText.java
deleted file mode 100644
index eea1518..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatJavadocText.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import org.aspectj.org.eclipse.jdt.internal.formatter.comment.IJavaDocTagConstants;
-
-/**
- * Represents text inside a javadoc comment block.
- * <p>
- * Text may be simple as <code>Line inside a javadoc comment block</code>
- * or may be a html tag. Note that to minimize memory footprint, only text
- * positions are stored.
- * </p><p>
- * Simple text may have one or several lines. When it has several lines, the
- * positions of the line breaks are also stored in the {@link #separators} array.
- * </p><p>
- * When text has html tags, then they are stored in {@link #htmlNodes} array
- * in a recursive way.
- * </p>
- */
-public class FormatJavadocText extends FormatJavadocNode implements IJavaDocTagConstants {
-
- long[] separators;
- int separatorsPtr = -1;
- private int htmlTagIndex = -1;
- boolean immutable = false;
- FormatJavadocNode[] htmlNodes;
- int[] htmlIndexes;
- int htmlNodesPtr = -1;
- int depth = 0;
-
-public FormatJavadocText(int start, int end, int line, int htmlIndex, int htmlDepth) {
- super(start, end, line);
- this.htmlTagIndex = htmlIndex;
- this.depth = htmlDepth;
-}
-
-/*
- * Append a text to current one.
- * If the given text is not an html tag or is a closing tag, then just append to
- * the current text recording the separators. Otherwise, create a new html tag
- * child node.
- */
-void appendText(FormatJavadocText text) {
- text.immutable = this.immutable;
- if (this.depth == text.depth) {
- addSeparator(text);
- this.sourceEnd = text.sourceEnd;
- if (text.isClosingHtmlTag()) {
- // close the tag
- this.htmlTagIndex = text.htmlTagIndex;
- }
- } else {
- appendNode(text);
- }
- if (text.isHtmlTag()) {
- switch (text.htmlTagIndex & JAVADOC_TAGS_ID_MASK) {
- case JAVADOC_CODE_TAGS_ID:
- text.linesBefore = this.htmlNodesPtr == -1 ? 0 : 2;
- break;
- case JAVADOC_SEPARATOR_TAGS_ID:
- text.linesBefore = 1;
- break;
- case JAVADOC_SINGLE_BREAK_TAG_ID:
- if (!text.isClosingHtmlTag()) text.linesBefore = 1;
- break;
- case JAVADOC_BREAK_TAGS_ID:
- if (!text.isClosingHtmlTag()) text.linesBefore = 1;
- }
- }
-}
-void appendNode(FormatJavadocNode node) {
- if (++this.htmlNodesPtr == 0) { // lazy initialization
- this.htmlNodes = new FormatJavadocNode[DEFAULT_ARRAY_SIZE];
- } else {
- if (this.htmlNodesPtr == this.htmlNodes.length) {
- int size = this.htmlNodesPtr + DEFAULT_ARRAY_SIZE;
- System.arraycopy(this.htmlNodes, 0, (this.htmlNodes= new FormatJavadocNode[size]), 0, this.htmlNodesPtr);
- }
- }
- addSeparator(node);
- this.htmlNodes[this.htmlNodesPtr] = node;
- this.sourceEnd = node.sourceEnd;
-}
-
-private void addSeparator(FormatJavadocNode node) {
- // Just append the text
- if (++this.separatorsPtr == 0) { // lazy initialization
- this.separators = new long[DEFAULT_ARRAY_SIZE];
- this.htmlIndexes = new int[DEFAULT_ARRAY_SIZE];
- } else { // resize if needed
- if (this.separatorsPtr == this.separators.length) {
- int size = this.separatorsPtr + DEFAULT_ARRAY_SIZE;
- System.arraycopy(this.separators, 0, (this.separators = new long[size]), 0, this.separatorsPtr);
- System.arraycopy(this.htmlIndexes, 0, (this.htmlIndexes = new int[size]), 0, this.separatorsPtr);
- }
- }
- this.separators[this.separatorsPtr] = (((long) this.sourceEnd) << 32) + node.sourceStart;
- this.htmlIndexes[this.separatorsPtr] = node.isText() ? ((FormatJavadocText)node).htmlTagIndex : -1;
-}
-
-void clean() {
- int length = this.separators == null ? 0 : this.separators.length;
- if (this.separatorsPtr != (length-1)) {
- System.arraycopy(this.separators, 0, this.separators = new long[this.separatorsPtr+1], 0, this.separatorsPtr+1);
- System.arraycopy(this.htmlIndexes, 0, this.htmlIndexes = new int[this.separatorsPtr+1], 0, this.separatorsPtr+1);
- }
- length = this.htmlNodes == null ? 0 : this.htmlNodes.length;
- if (this.htmlNodesPtr != (length-1)) {
- System.arraycopy(this.htmlNodes, 0, this.htmlNodes = new FormatJavadocNode[this.htmlNodesPtr+1], 0, this.htmlNodesPtr+1);
- for (int i=0; i<=this.htmlNodesPtr; i++) {
- this.htmlNodes[i].clean();
- }
- }
-}
-
-void closeTag() {
- this.htmlTagIndex |= JAVADOC_CLOSED_TAG;
-}
-
-int getHtmlTagIndex() {
- return this.htmlTagIndex & JAVADOC_TAGS_INDEX_MASK;
-}
-
-int getHtmlTagID() {
- return this.htmlTagIndex & JAVADOC_TAGS_ID_MASK;
-}
-
-FormatJavadocNode getLastNode() {
- if (this.htmlNodes != null) {
- return this.htmlNodes[this.htmlNodesPtr];
- }
- return null;
-}
-
-/**
- * Returns whether the text is a closing html tag or not.
- *
- * @return <code>true</code> if the node is an html tag and has '/' before its
- * name (e.g. </bla>), <code>false</code> otherwise.
- */
-public boolean isClosingHtmlTag() {
- return this.htmlTagIndex != -1 && (this.htmlTagIndex & JAVADOC_CLOSED_TAG) != 0;
-}
-
-/**
- * Returns whether the text is a html tag or not.
- *
- * @return <code>true</code> if the node is a html tag, <code>false</code>
- * otherwise.
- */
-public boolean isHtmlTag() {
- return this.htmlTagIndex != -1;
-}
-
-/**
- * Returns whether the node is an immutable html tag or not.
- * <p>
- * The text in an immutable tags is <b>never</b> formatted.
- * </p>
- *
- * @return <code>true</code> if the node is an immutable tag,
- * <code>false</code> otherwise.
- */
-public boolean isImmutableHtmlTag() {
- return this.htmlTagIndex != -1 && (this.htmlTagIndex & JAVADOC_TAGS_ID_MASK) == JAVADOC_IMMUTABLE_TAGS_ID;
-
-}
-
-/**
- * Returns whether the text is immutable or not.
- * <p>
- * A text in considered as immutable when it belongs to an immutable block
- * or when it's an immutable html tag.
- * </p>
- *
- * @return <code>true</code> if the node is an immutable tag,
- * <code>false</code> otherwise.
- */
-public boolean isImmutable() {
- return this.immutable || (this.htmlTagIndex != -1 && (this.htmlTagIndex & JAVADOC_TAGS_ID_MASK) == JAVADOC_IMMUTABLE_TAGS_ID);
-
-}
-
-/**
- * Returns whether the text at the given separator index position is after a
- * separator tag or not.
- *
- * @return <code>true</code> if the text is after a separator tag,
- * <code>false</code> otherwise or if the given index is out the range of
- * the text separators.
- */
-public boolean isTextAfterHtmlSeparatorTag(int separatorIndex) {
- int ptr = separatorIndex;
- if (ptr > this.separatorsPtr) return false;
- int tagIndex = this.htmlIndexes[ptr] & JAVADOC_TAGS_ID_MASK;
- return tagIndex != -1 && tagIndex == JAVADOC_SEPARATOR_TAGS_ID;
-
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.formatter.FormatJavadocNode#isText()
- */
-public boolean isText() {
- return true;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.formatter.FormatJavadocNode#setHeaderLine(int)
- */
-void setHeaderLine(int javadocLineStart) {
- for (int i=0; i<this.htmlNodesPtr; i++) {
- FormatJavadocNode node = this.htmlNodes[i];
- if (!node.isText()) {
- ((FormatJavadocBlock) node).setHeaderLine(javadocLineStart);
- }
- }
-}
-
-protected void toString(StringBuffer buffer) {
- StringBuffer indentation = new StringBuffer();
- for (int t=0; t<=this.depth; t++) indentation.append('\t');
- buffer.append(indentation);
- if (isImmutable()) {
- buffer.append("immutable "); //$NON-NLS-1$
- }
- buffer.append("text"); //$NON-NLS-1$
- super.toString(buffer);
- buffer.append(" ("); //$NON-NLS-1$
- buffer.append(this.separatorsPtr+1).append(" sections, "); //$NON-NLS-1$
- buffer.append(this.htmlNodesPtr+1).append(" html tags, "); //$NON-NLS-1$
- buffer.append(this.depth).append(" depth, "); //$NON-NLS-1$
- buffer.append(this.linesBefore).append(" before, "); //$NON-NLS-1$
- String tagID = "no"; //$NON-NLS-1$
- switch (getHtmlTagID()) {
- case JAVADOC_TAGS_ID_MASK:
- tagID = "mask"; //$NON-NLS-1$
- break;
- case JAVADOC_SINGLE_BREAK_TAG_ID:
- tagID = "single break"; //$NON-NLS-1$
- break;
- case JAVADOC_CODE_TAGS_ID:
- tagID = "code"; //$NON-NLS-1$
- break;
- case JAVADOC_BREAK_TAGS_ID:
- tagID = "break"; //$NON-NLS-1$
- break;
- case JAVADOC_IMMUTABLE_TAGS_ID:
- tagID = "immutable"; //$NON-NLS-1$
- break;
- case JAVADOC_SEPARATOR_TAGS_ID:
- tagID = "separator"; //$NON-NLS-1$
- break;
- }
- buffer.append(tagID).append(" tag id)"); //$NON-NLS-1$
- buffer.append('\n');
-}
-
-public void toStringDebug(StringBuffer buffer, char[] source) {
- if (buffer.length() > 0) {
- for (int l=0; l<this.linesBefore; l++) {
- buffer.append('\n');
- for (int t=0; t<this.depth; t++) buffer.append('\t');
- }
- }
- if (this.separatorsPtr == -1) {
- super.toStringDebug(buffer, source);
- return;
- }
- int ptr = 0;
- int nextStart = this.sourceStart;
- int idx = 0;
- while (idx<=this.separatorsPtr || (this.htmlNodesPtr != -1 && ptr <= this.htmlNodesPtr)) {
- if (idx > this.separatorsPtr) {
- // last node
- FormatJavadocNode node = this.htmlNodes[ptr++];
- node.toStringDebug(buffer, source);
- return;
- }
- int end = (int) (this.separators[idx] >>> 32);
- if (this.htmlNodesPtr >= 0 && ptr <= this.htmlNodesPtr && end > this.htmlNodes[ptr].sourceStart) {
- FormatJavadocNode node = this.htmlNodes[ptr++];
- node.toStringDebug(buffer, source);
- } else {
- if (idx > 1 && source[nextStart] != '<') {
- buffer.append('\n');
- for (int t=0; t<this.depth; t++) buffer.append('\t');
- }
- buffer.append(source, nextStart, end - nextStart + 1);
- }
- nextStart = (int) this.separators[idx++];
- }
- if (source[nextStart] == '<') {
- switch (getHtmlTagID()) {
- case JAVADOC_CODE_TAGS_ID:
- buffer.append('\n');
- for (int t=0; t<this.depth; t++) buffer.append('\t');
- break;
- }
- }
- buffer.append(source, nextStart, this.sourceEnd-nextStart+1);
- buffer.append(' ');
-}
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java
deleted file mode 100644
index c975014..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java
+++ /dev/null
@@ -1,832 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import java.util.List;
-
-import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
-import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
-import org.aspectj.org.eclipse.jdt.internal.formatter.comment.IJavaDocTagConstants;
-
-/**
- * Internal parser used for formatting javadoc comments.
- */
-public class FormatterCommentParser extends JavadocParser implements IJavaDocTagConstants {
- char[][] htmlTags;
- int htmlTagsPtr = -1;
- int inlineHtmlTagsPtr = -1;
- private boolean invalidTagName;
- public boolean parseHtmlTags;
-
-public FormatterCommentParser(long sourceLevel) {
- super(null);
- this.kind = FORMATTER_COMMENT_PARSER | TEXT_PARSE;
- this.reportProblems = false;
- this.checkDocComment = true;
- this.sourceLevel = sourceLevel;
-}
-
-public boolean parse(int start, int end) {
-
- // Init
- this.javadocStart = start;
- this.javadocEnd = end;
- this.firstTagPosition = this.javadocStart;
- // Need to flush html tags stack in case of unclosed ones in previous javadoc comments
- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=239941
- this.htmlTagsPtr = -1;
-
- // parse comment
- boolean valid = commentParse();
-
- return valid && this.docComment != null;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#createArgumentReference(char[], int, boolean, java.lang.Object, long[], long)
- */
-protected Object createArgumentReference(char[] name, int dim, boolean isVarargs, Object ref, long[] dimPositions, long argNamePos) throws InvalidInputException {
- FormatJavadocReference typeRef = (FormatJavadocReference) ref;
- if (dim > 0) {
- typeRef.sourceEnd = (int) dimPositions[dim-1];
- }
- if (argNamePos >= 0) typeRef.sourceEnd = (int) argNamePos;
- return ref;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#createFakeReference(int)
- */
-protected boolean createFakeReference(int start) {
- // synch scanner and parser positions
- this.scanner.currentPosition = this.index;
- // create reference in order to be able to format it
- int lineStart = this.scanner.getLineNumber(start);
- FormatJavadocReference reference = new FormatJavadocReference(start, this.index-1, lineStart);
- return pushSeeRef(reference);
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#createFieldReference(java.lang.Object)
- */
-protected Object createFieldReference(Object receiver) throws InvalidInputException {
- int start = receiver == null ? this.memberStart : ((FormatJavadocReference)receiver).sourceStart;
- int lineStart = this.scanner.getLineNumber(start);
- return new FormatJavadocReference(start, (int) this.identifierPositionStack[0], lineStart);
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#createMethodReference(java.lang.Object, java.util.List)
- */
-protected Object createMethodReference(Object receiver, List arguments) throws InvalidInputException {
- int start = receiver == null ? this.memberStart : ((FormatJavadocReference) receiver).sourceStart;
- int lineStart = this.scanner.getLineNumber(start);
- return new FormatJavadocReference(start, this.scanner.getCurrentTokenEndPosition(), lineStart);
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#createTag()
- */
-protected void createTag() {
- int lineStart = this.scanner.getLineNumber(this.tagSourceStart);
- if (this.inlineTagStarted) {
- FormatJavadocBlock block = new FormatJavadocBlock(this.inlineTagStart, this.tagSourceEnd, lineStart, this.tagValue);
- FormatJavadocBlock previousBlock = null;
- if (this.astPtr == -1) {
- previousBlock = new FormatJavadocBlock(this.inlineTagStart, this.tagSourceEnd, lineStart, NO_TAG_VALUE);
- pushOnAstStack(previousBlock, true);
- } else {
- previousBlock = (FormatJavadocBlock) this.astStack[this.astPtr];
- }
- previousBlock.addBlock(block, this.htmlTagsPtr == -1 ? 0 : this.htmlTagsPtr);
- } else {
- FormatJavadocBlock block = new FormatJavadocBlock(this.tagSourceStart, this.tagSourceEnd, lineStart, this.tagValue);
- pushOnAstStack(block, true);
- }
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#createTypeReference(int)
- */
-protected Object createTypeReference(int primitiveToken) {
- int size = this.identifierLengthStack[this.identifierLengthPtr];
- if (size == 0) return null;
- int start = (int) (this.identifierPositionStack[this.identifierPtr] >>> 32);
- int lineStart = this.scanner.getLineNumber(start);
- if (size == 1) {
- return new FormatJavadocReference(this.identifierPositionStack[this.identifierPtr], lineStart);
- }
- long[] positions = new long[size];
- System.arraycopy(this.identifierPositionStack, this.identifierPtr - size + 1, positions, 0, size);
- return new FormatJavadocReference((int) (positions[0] >>> 32), (int) positions[positions.length-1], lineStart);
-}
-
-/*
- * Return the html tag index in the various arrays of IJavaDocTagConstants.
- * The returned int is set as follow:
- * - the array index is set on bits 0 to 7
- * - the tag category is set on bit 8 to 15 (0xFF00 if no array includes the tag)
- */
-private int getHtmlTagIndex(char[] htmlTag) {
- int length = htmlTag == null ? 0 : htmlTag.length;
- int tagId = 0;
- if (length > 0) {
- for (int i=0, max=JAVADOC_SINGLE_BREAK_TAG.length; i<max; i++) {
- char[] tag = JAVADOC_SINGLE_BREAK_TAG[i];
- if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) {
- return (tagId | JAVADOC_SINGLE_BREAK_TAG_ID) + i;
- }
- }
- for (int i=0, max=JAVADOC_CODE_TAGS.length; i<max; i++) {
- char[] tag = JAVADOC_CODE_TAGS[i];
- if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) {
- return (tagId | JAVADOC_CODE_TAGS_ID) + i;
- }
- }
- for (int i=0, max=JAVADOC_BREAK_TAGS.length; i<max; i++) {
- char[] tag = JAVADOC_BREAK_TAGS[i];
- if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) {
- return (tagId | JAVADOC_BREAK_TAGS_ID) + i;
- }
- }
- for (int i=0, max=JAVADOC_IMMUTABLE_TAGS.length; i<max; i++) {
- char[] tag = JAVADOC_IMMUTABLE_TAGS[i];
- if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) {
- return (tagId | JAVADOC_IMMUTABLE_TAGS_ID) + i;
- }
- }
- for (int i=0, max=JAVADOC_SEPARATOR_TAGS.length; i<max; i++) {
- char[] tag = JAVADOC_SEPARATOR_TAGS[i];
- if (length == tag.length && CharOperation.equals(htmlTag, tag, false)) {
- return (tagId | JAVADOC_SEPARATOR_TAGS_ID) + i;
- }
- }
- }
- return JAVADOC_TAGS_ID_MASK;
-}
-
-/*
- * Parse an HTML tag expected to be either opening (e.g. <tag_name> ) or
- * closing (e.g. </tag_name>).
- */
-protected boolean parseHtmlTag(int previousPosition, int endTextPosition) throws InvalidInputException {
- if (!this.parseHtmlTags) return false;
- boolean closing = false;
- boolean valid = false;
- boolean incremented = false;
- int start = this.scanner.currentPosition;
- int currentPosition = start;
- int htmlPtr = this.htmlTagsPtr;
- char firstChar = peekChar();
- boolean hasWhitespaces = firstChar == ' ' || ScannerHelper.isWhitespace(firstChar);
- try {
- int token = readTokenAndConsume();
- char[] htmlTag;
- int htmlIndex;
- switch (token) {
- case TerminalTokens.TokenNameIdentifier:
- // HTML tag opening
- htmlTag = this.scanner.getCurrentIdentifierSource();
- htmlIndex = getHtmlTagIndex(htmlTag);
- if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false;
- if (htmlPtr >= 0) {
- int lastHtmlTagIndex = getHtmlTagIndex(this.htmlTags[htmlPtr]);
- if ((lastHtmlTagIndex & JAVADOC_TAGS_ID_MASK) == JAVADOC_IMMUTABLE_TAGS_ID) {
- // Do not accept tags inside immutable tags except the <pre> tag
- if ((htmlIndex & JAVADOC_TAGS_ID_MASK) == JAVADOC_CODE_TAGS_ID) {
- FormatJavadocBlock previousBlock = (FormatJavadocBlock) this.astStack[this.astPtr];
- FormatJavadocNode parentNode = previousBlock;
- FormatJavadocNode lastNode = parentNode;
- while (lastNode.getLastNode() != null) {
- parentNode = lastNode;
- lastNode = lastNode.getLastNode();
- }
- if (lastNode.isText()) {
- FormatJavadocText text = (FormatJavadocText) lastNode;
- if (text.separatorsPtr == -1) {
- break;
- }
- }
- }
- return false;
- }
- }
- if ((htmlIndex & JAVADOC_TAGS_ID_MASK) > JAVADOC_SINGLE_TAGS_ID) {
- if (this.htmlTagsPtr == -1 || !CharOperation.equals(this.htmlTags[this.htmlTagsPtr], htmlTag, false)) {
- if (++this.htmlTagsPtr == 0) { // lazy initialization
- this.htmlTags = new char[AST_STACK_INCREMENT][];
- } else { // resize if needed
- if (this.htmlTagsPtr == this.htmlTags.length) {
- System.arraycopy(this.htmlTags, 0, (this.htmlTags = new char[this.htmlTags.length + AST_STACK_INCREMENT][]), 0, this.htmlTagsPtr);
- }
- }
- this.htmlTags[this.htmlTagsPtr] = htmlTag;
- incremented = true;
- }
- }
- // Accept xhtml syntax
- currentPosition = this.scanner.currentPosition;
- if (readToken() == TerminalTokens.TokenNameDIVIDE) {
- consumeToken();
- }
- break;
- case TerminalTokens.TokenNameDIVIDE:
- // HTML tag closing
- if (this.htmlTagsPtr == -1) return false;
- htmlTag = this.htmlTags[this.htmlTagsPtr];
- if ((token = readTokenAndConsume()) != TerminalTokens.TokenNameIdentifier) {
- // not a closing html tag
- return false;
- }
- char[] identifier = this.scanner.getCurrentIdentifierSource();
- htmlIndex = getHtmlTagIndex(identifier);
- if (htmlIndex == JAVADOC_TAGS_ID_MASK) return false;
- int ptr = this.htmlTagsPtr;
- while (!CharOperation.equals(htmlTag, identifier, false)) {
- if (this.htmlTagsPtr <= 0) {
- // consider the closing tag as invalid
- this.htmlTagsPtr = ptr;
- return false;
- }
- this.htmlTagsPtr--;
- htmlTag = this.htmlTags[this.htmlTagsPtr];
- }
- // set closing flag
- htmlIndex |= JAVADOC_CLOSED_TAG;
- closing = true;
- currentPosition = this.scanner.currentPosition;
- break;
- default:
- return false;
- }
-
- // Looking for tag closing
- switch (readTokenAndConsume()) {
- case TerminalTokens.TokenNameLESS:
- case TerminalTokens.TokenNameLESS_EQUAL:
- // consider that the closing '>' is missing
- return false;
- case TerminalTokens.TokenNameGREATER:
- // simple tag without attributes
- break;
- case TerminalTokens.TokenNameGREATER_EQUAL:
- case TerminalTokens.TokenNameRIGHT_SHIFT:
- case TerminalTokens.TokenNameRIGHT_SHIFT_EQUAL:
- // simple tag without attributes, but the closing '>' is followed by an '=' or '>'
- break;
- default:
- this.index = currentPosition;
- loop: while (true) {
-// currentPosition = this.index;
- switch (readChar()) {
- case '<':
- if (hasWhitespaces) {
- // not 100% sure this is a tag definition => give up
- return false;
- }
- // opening tag => consider the current one as closed
- this.index = currentPosition;
- this.scanner.startPosition = currentPosition;
- this.scanner.currentPosition = currentPosition;
- this.scanner.currentCharacter = '<';
- break loop;
- case '>':
- // simple tag without attributes
- this.scanner.startPosition = this.index;
- this.scanner.currentPosition = this.index;
- this.scanner.currentCharacter = peekChar();
- break loop;
- default:
- break;
- }
- if (this.index >= this.javadocTextEnd) {
- // the end of the comment is reached => consider current tag as closed
- this.index = currentPosition;
- this.scanner.startPosition = currentPosition;
- this.scanner.currentPosition = currentPosition;
- break;
- }
- }
- }
-
- // Push texts
- if (this.lineStarted && this.textStart != -1 && this.textStart < endTextPosition) {
- pushText(this.textStart, endTextPosition, -1, htmlPtr);
- }
- pushText(previousPosition, this.index, htmlIndex, this.htmlTagsPtr);
- this.textStart = -1;
- valid = true;
- }
- finally {
- if (valid) {
- if (closing) {
- this.htmlTagsPtr--;
- }
- } else if (!this.abort) {
- if (incremented) {
- this.htmlTagsPtr--;
- if (this.htmlTagsPtr == -1) this.htmlTags = null;
- }
- this.scanner.resetTo(start, this.scanner.eofPosition-1);
- this.index = start;
- }
- }
- return valid;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseIdentifierTag(boolean)
- */
-protected boolean parseIdentifierTag(boolean report) {
- if (super.parseIdentifierTag(report)) {
- createTag();
- this.index = this.tagSourceEnd+1;
- this.scanner.resetTo(this.index, this.javadocEnd);
- return true;
- }
- this.tagValue = TAG_OTHERS_VALUE; // tag is invalid, do not keep the parsed tag value
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#parseParam()
- */
-protected boolean parseParam() throws InvalidInputException {
- boolean valid = super.parseParam();
- if (!valid) {
- this.scanner.resetTo(this.tagSourceEnd+1, this.javadocEnd);
- this.index = this.tagSourceEnd+1;
- char ch = peekChar();
- // Try to push an identifier in the stack, otherwise restart from the end tag position
- if (ch == ' ' || ScannerHelper.isWhitespace(ch)) {
- int token = this.scanner.getNextToken();
- if (token == TerminalTokens.TokenNameIdentifier) {
- ch = peekChar();
- if (ch == ' ' || ScannerHelper.isWhitespace(ch)) {
- pushIdentifier(true, false);
- pushParamName(false);
- this.index = this.scanner.currentPosition;
- valid = true;
- }
- }
- this.scanner.resetTo(this.tagSourceEnd+1, this.javadocEnd);
- }
- this.tagValue = TAG_OTHERS_VALUE; // tag is invalid, do not keep the parsed tag value
- }
- return valid;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseReference()
- */
-protected boolean parseReference() throws InvalidInputException {
- boolean valid = super.parseReference();
- if (!valid) {
- this.scanner.resetTo(this.tagSourceEnd+1, this.javadocEnd);
- this.index = this.tagSourceEnd+1;
- this.tagValue = TAG_OTHERS_VALUE; // tag is invalid, do not keep the parsed tag value
- }
- return valid;
-}
-
-/*
- * Parse @return tag declaration
- */
-protected boolean parseReturn() {
- createTag();
- return true;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#parseTag(int)
- */
-protected boolean parseTag(int previousPosition) throws InvalidInputException {
-
- // Do not parse javadoc tag inside <pre>...</pre> tags
- if (this.htmlTagsPtr >= 0) {
- int ptr = this.htmlTagsPtr;
- while (ptr >= 0) {
- if (getHtmlTagIndex(this.htmlTags[ptr--]) == JAVADOC_CODE_TAGS_ID) {
- if (this.textStart == -1) this.textStart = this.inlineTagStarted ? this.inlineTagStart : previousPosition;
- this.inlineTagStarted = false;
- return true;
- }
- }
- }
-
- // Read tag name
- int ptr = this.astPtr;
- this.tagSourceStart = previousPosition;
- this.scanner.startPosition = this.index;
- this.scanner.currentCharacter = readChar();
- switch (this.scanner.currentCharacter) {
- case ' ':
- case '*':
- case '}':
- // tag name is empty
- this.tagSourceEnd = previousPosition;
- if (this.textStart == -1) this.textStart = previousPosition;
- return true;
- default:
- if (ScannerHelper.isWhitespace(this.scanner.currentCharacter)) {
- // tag name is empty
- this.tagSourceEnd = previousPosition;
- if (this.textStart == -1) this.textStart = previousPosition;
- return true;
- }
- break;
- }
- int currentPosition = this.index;
- char currentChar = this.scanner.currentCharacter;
- while (currentChar != ' ' && currentChar != '*' && currentChar != '}' && !ScannerHelper.isWhitespace(currentChar)) {
- currentPosition = this.index;
- currentChar = readChar();
- }
- this.tagSourceEnd = currentPosition - 1;
- this.scanner.currentCharacter = currentChar;
- this.scanner.currentPosition = currentPosition;
- char[] tagName = this.scanner.getCurrentIdentifierSource();
- int length = tagName.length;
- this.index = this.tagSourceEnd+1;
-
- // Decide which parse to perform depending on tag name
- this.tagValue = TAG_OTHERS_VALUE;
- boolean valid = false;
- switch (tagName[0]) {
- case 'a':
- if (length == TAG_AUTHOR_LENGTH && CharOperation.equals(TAG_AUTHOR, tagName)) {
- this.tagValue = TAG_AUTHOR_VALUE;
- }
- break;
- case 'c':
- if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName)) {
- this.tagValue = TAG_CATEGORY_VALUE;
- valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec
- } else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName)) {
- this.tagValue = TAG_CODE_VALUE;
- }
- break;
- case 'd':
- if (length == TAG_DEPRECATED_LENGTH && CharOperation.equals(TAG_DEPRECATED, tagName)) {
- this.deprecated = true;
- valid = true;
- this.tagValue = TAG_DEPRECATED_VALUE;
- } else if (length == TAG_DOC_ROOT_LENGTH && CharOperation.equals(TAG_DOC_ROOT, tagName)) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=227730
- // identify @docRoot tag as a base tag that does not expect any argument
- valid = true;
- this.tagValue = TAG_DOC_ROOT_VALUE;
- }
- break;
- case 'e':
- if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName)) {
- this.tagValue = TAG_EXCEPTION_VALUE;
- valid = parseThrows();
- }
- break;
- case 'i':
- if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName)) {
- if (this.reportProblems) {
- recordInheritedPosition((((long) this.tagSourceStart) << 32) + this.tagSourceEnd);
- }
- valid = true;
- this.tagValue = TAG_INHERITDOC_VALUE;
- }
- break;
- case 'l':
- if (length == TAG_LINK_LENGTH && CharOperation.equals(TAG_LINK, tagName)) {
- this.tagValue = TAG_LINK_VALUE;
- if (this.inlineTagStarted || (this.kind & COMPLETION_PARSER) != 0) {
- valid = parseReference();
- } else {
- // bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=53290
- // Cannot have @link outside inline comment
- valid = false;
- if (this.reportProblems) {
- this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
- }
- }
- } else if (length == TAG_LINKPLAIN_LENGTH && CharOperation.equals(TAG_LINKPLAIN, tagName)) {
- this.tagValue = TAG_LINKPLAIN_VALUE;
- if (this.inlineTagStarted) {
- valid = parseReference();
- } else {
- valid = false;
- if (this.reportProblems) {
- this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
- }
- }
- } else if (length == TAG_LITERAL_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_LITERAL, tagName)) {
- this.tagValue = TAG_LITERAL_VALUE;
- }
- break;
- case 'p':
- if (length == TAG_PARAM_LENGTH && CharOperation.equals(TAG_PARAM, tagName)) {
- this.tagValue = TAG_PARAM_VALUE;
- valid = parseParam();
- }
- break;
- case 's':
- if (length == TAG_SEE_LENGTH && CharOperation.equals(TAG_SEE, tagName)) {
- if (this.inlineTagStarted) {
- // bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=53290
- // Cannot have @see inside inline comment
- valid = false;
- if (this.reportProblems) {
- this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
- }
- } else {
- this.tagValue = TAG_SEE_VALUE;
- valid = parseReference();
- }
- } else if (length == TAG_SERIAL_LENGTH && CharOperation.equals(TAG_SERIAL, tagName)) {
- this.tagValue = TAG_SERIAL_VALUE;
- } else if (length == TAG_SERIAL_DATA_LENGTH && CharOperation.equals(TAG_SERIAL_DATA, tagName)) {
- this.tagValue = TAG_SERIAL_DATA_VALUE;
- } else if (length == TAG_SERIAL_FIELD_LENGTH && CharOperation.equals(TAG_SERIAL_FIELD, tagName)) {
- this.tagValue = TAG_SERIAL_FIELD_VALUE;
- } else if (length == TAG_SINCE_LENGTH && CharOperation.equals(TAG_SINCE, tagName)) {
- this.tagValue = TAG_SINCE_VALUE;
- }
- break;
- case 'v':
- if (length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName)) {
- this.tagValue = TAG_VALUE_VALUE;
- if (this.sourceLevel >= ClassFileConstants.JDK1_5) {
- if (this.inlineTagStarted) {
- valid = parseReference();
- } else {
- valid = false;
- if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
- }
- }
- } else if (length == TAG_VERSION_LENGTH && CharOperation.equals(TAG_VERSION, tagName)) {
- this.tagValue = TAG_VERSION_VALUE;
- } else {
- createTag();
- }
- break;
- case 'r':
- if (length == TAG_RETURN_LENGTH && CharOperation.equals(TAG_RETURN, tagName)) {
- this.tagValue = TAG_RETURN_VALUE;
- valid = parseReturn();
- }
- break;
- case 't':
- if (length == TAG_THROWS_LENGTH && CharOperation.equals(TAG_THROWS, tagName)) {
- this.tagValue = TAG_THROWS_VALUE;
- valid = parseThrows();
- }
- break;
- default:
- createTag();
- break;
- }
- consumeToken();
- this.textStart = -1;
-
- // the javadoc parser may not create tag for some valid tags: force tag creation for such tag.
- if (valid) {
- switch (this.tagValue) {
- case TAG_INHERITDOC_VALUE:
- case TAG_DEPRECATED_VALUE:
- createTag();
- break;
- }
- } else if (this.invalidTagName) {
- this.textStart = previousPosition;
- } else if (this.astPtr == ptr) {
- createTag();
- }
- return true;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#parseThrows()
- */
-protected boolean parseThrows() {
- boolean valid = super.parseThrows();
- if (!valid) {
- // If invalid, restart from the end tag position
- this.scanner.resetTo(this.tagSourceEnd+1, this.javadocEnd);
- this.index = this.tagSourceEnd+1;
- this.tagValue = TAG_OTHERS_VALUE; // tag is invalid, do not keep the parsed tag value
- }
- return valid;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#pushParamName(boolean)
- */
-protected boolean pushParamName(boolean isTypeParam) {
- int lineTagStart = this.scanner.getLineNumber(this.tagSourceStart);
- FormatJavadocBlock block = new FormatJavadocBlock(this.tagSourceStart, this.tagSourceEnd, lineTagStart, TAG_PARAM_VALUE);
- int start = (int) (this.identifierPositionStack[0] >>> 32);
- int lineStart = this.scanner.getLineNumber(start);
- FormatJavadocReference reference;
- reference = new FormatJavadocReference(start, (int) this.identifierPositionStack[isTypeParam ? 2 : 0], lineStart);
- block.reference = reference;
- block.sourceEnd = reference.sourceEnd;
- pushOnAstStack(block, true);
- return true;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.JavadocParser#pushSeeRef(java.lang.Object)
- */
-protected boolean pushSeeRef(Object statement) {
- FormatJavadocReference reference = (FormatJavadocReference) statement;
- int lineTagStart = this.scanner.getLineNumber(this.tagSourceStart);
- FormatJavadocBlock block = new FormatJavadocBlock(this.tagSourceStart, this.tagSourceEnd, lineTagStart, this.tagValue);
- block.reference = reference;
- block.sourceEnd = reference.sourceEnd;
- if (this.inlineTagStarted) {
- block.sourceStart = this.inlineTagStart;
- FormatJavadocBlock previousBlock = null;
- if (this.astPtr == -1) {
- int lineStart = this.scanner.getLineNumber(this.inlineTagStart);
- previousBlock = new FormatJavadocBlock(this.inlineTagStart, this.tagSourceEnd, lineStart, NO_TAG_VALUE);
- previousBlock.sourceEnd = reference.sourceEnd;
- pushOnAstStack(previousBlock, true);
- } else {
- previousBlock = (FormatJavadocBlock) this.astStack[this.astPtr];
- }
- previousBlock.addBlock(block, this.htmlTagsPtr == -1 ? 0 : this.htmlTagsPtr);
- block.flags |= FormatJavadocBlock.INLINED;
- } else {
- pushOnAstStack(block, true);
- }
-
- return true;
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#pushText(int, int)
- */
-protected void pushText(int start, int end) {
- pushText(start, end, -1, this.htmlTagsPtr == -1 ? 0 : this.htmlTagsPtr);
-}
-
-private void pushText(int start, int end, int htmlIndex, int htmlDepth) {
-
- // Search previous tag on which to add the text element
- FormatJavadocBlock previousBlock = null;
- int previousStart = start;
- int lineStart = this.scanner.getLineNumber(start);
- if (this.astPtr == -1) {
- previousBlock = new FormatJavadocBlock(start, start, lineStart, NO_TAG_VALUE);
- pushOnAstStack(previousBlock, true);
- } else {
- previousBlock = (FormatJavadocBlock) this.astStack[this.astPtr];
- previousStart = previousBlock.sourceStart;
- }
-
- // If we're in a inline tag, then retrieve previous tag in its fragments
- if (this.inlineTagStarted) {
- if (previousBlock.nodes == null) {
- // no existing fragment => just add the element
- } else {
- // If last fragment is a tag, then use it as previous tag
- FormatJavadocNode lastNode = previousBlock.nodes[previousBlock.nodesPtr];
- while (lastNode != null && lastNode.isText()) {
- lastNode = lastNode.getLastNode();
- }
- if (lastNode != null) {
- previousBlock = (FormatJavadocBlock) lastNode;
- previousStart = previousBlock.sourceStart;
- }
- }
- }
-
- // Add the text
- FormatJavadocText text = new FormatJavadocText(start, end-1, lineStart, htmlIndex, htmlDepth==-1 ? 0 : htmlDepth);
- previousBlock.addText(text);
- previousBlock.sourceStart = previousStart;
- if (lineStart == previousBlock.lineStart) {
- previousBlock.flags |= FormatJavadocBlock.TEXT_ON_TAG_LINE;
- }
- this.textStart = -1;
-}
-
-/*
- * (non-Javadoc)
- *
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#pushThrowName(java.lang.Object)
- */
-protected boolean pushThrowName(Object typeRef) {
- int lineStart = this.scanner.getLineNumber(this.tagSourceStart);
- FormatJavadocBlock block = new FormatJavadocBlock(this.tagSourceStart, this.tagSourceEnd, lineStart, this.tagValue);
- block.reference = (FormatJavadocReference) typeRef;
- block.sourceEnd = block.reference.sourceEnd;
- pushOnAstStack(block, true);
- return true;
-}
-
-/*
- * (non-Javadoc)
- * Will update the inline tag position (end position) once tag was fully parsed.
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#refreshInlineTagPosition(int)
- */
-protected void refreshInlineTagPosition(int previousPosition) {
- if (this.astPtr != -1) {
- FormatJavadocNode previousBlock = (FormatJavadocNode) this.astStack[this.astPtr];
- if (this.inlineTagStarted) {
- FormatJavadocNode lastNode = previousBlock;
- while (lastNode != null) {
- lastNode.sourceEnd = previousPosition;
- lastNode = lastNode.getLastNode();
- }
- }
- }
-}
-
-/*
- * Store the html tags level when entering an inline tag in case a wrong sequence
- * of opening/closing tags is defined inside it. Then, when leaving the inline tag
- * the level is reset to the entering value and avoid to wrongly attach subsequent
- * html tags to node inside the inline tag last node...
- */
-protected void setInlineTagStarted(boolean started) {
- super.setInlineTagStarted(started);
- if (started) {
- this.inlineHtmlTagsPtr = this.htmlTagsPtr;
- } else {
- if (this.htmlTagsPtr > this.inlineHtmlTagsPtr) {
- this.htmlTagsPtr = this.inlineHtmlTagsPtr;
- }
- }
-}
-
-public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("FormatterCommentParser\n"); //$NON-NLS-1$
- buffer.append(super.toString());
- return buffer.toString();
-}
-
-public String toDebugString() {
- if (this.docComment == null) {
- return "No javadoc!"; //$NON-NLS-1$
- }
- return ((FormatJavadoc)this.docComment).toDebugString(this.source);
-}
-
-/*
- * Add stored tag elements to associated comment.
- * Clean all blocks (i.e. resize arrays to avoid null slots)
- * Set extra information on block about line relative positions.
- */
-protected void updateDocComment() {
- int length = this.astPtr + 1;
- FormatJavadoc formatJavadoc = new FormatJavadoc(this.javadocStart, this.javadocEnd, length);
- if (length > 0) {
- formatJavadoc.blocks = new FormatJavadocBlock[length];
- for (int i=0; i<length; i++) {
- FormatJavadocBlock block = (FormatJavadocBlock) this.astStack[i];
- block.clean();
- block.update(this.scanner);
- formatJavadoc.blocks[i] = block;
- if (i== 0) {
- block.flags |= FormatJavadocBlock.FIRST;
- }
- }
- }
- formatJavadoc.textStart = this.javadocTextStart;
- formatJavadoc.textEnd = this.javadocTextEnd;
- formatJavadoc.lineStart = this.scanner.getLineNumber(this.javadocTextStart);
- formatJavadoc.lineEnd = this.scanner.getLineNumber(this.javadocTextEnd);
- FormatJavadocBlock firstBlock = formatJavadoc.getFirstBlock();
- if (firstBlock != null) {
- firstBlock.setHeaderLine(formatJavadoc.lineStart);
- }
- this.docComment = formatJavadoc;
- if (DefaultCodeFormatter.DEBUG) {
- System.out.println(toDebugString());
- }
-}
-
-/* (non-Javadoc)
- * @see org.aspectj.org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#verifyEndLine(int)
- */
-protected boolean verifyEndLine(int textPosition) {
- // do not verify anything at end of line while formatting
- return true;
-}
-
-protected boolean verifySpaceOrEndComment() {
- // Don't care if there's no spaces after a reference...
- return true;
-}
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/ICodeFormatterConstants.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/ICodeFormatterConstants.java
deleted file mode 100644
index f66c2b4..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/ICodeFormatterConstants.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-/**
- * Internal code formatter constants.
- *
- * @since 3.4
- */
-
-public interface ICodeFormatterConstants {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
- // constants used to handle the addition of new lines after annotations
-
- /** annotation on unspecified source*/
- public static final int ANNOTATION_UNSPECIFIED = 0;
-
- /** annotation on a type */
- public static final int ANNOTATION_ON_TYPE = 1;
-
- /** annotation on a field */
- public static final int ANNOTATION_ON_FIELD = 2;
-
- /** annotation on a method */
- public static final int ANNOTATION_ON_METHOD = 3;
-
- /** annotation on a package */
- public static final int ANNOTATION_ON_PACKAGE = 4;
-
- /** annotation on a parameter */
- public static final int ANNOTATION_ON_PARAMETER = 5;
-
- /** annotation on a local variable */
- public static final int ANNOTATION_ON_LOCAL_VARIABLE = 6;
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java
new file mode 100644
index 0000000..5506493
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java
@@ -0,0 +1,597 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] IndexOutOfBoundsException in TokenManager - https://bugs.eclipse.org/462945
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] follow up bug for comments - https://bugs.eclipse.org/458208
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameAT;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOLON;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMA;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameLBRACE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameRBRACE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameSEMICOLON;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameelse;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNamefinally;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNamepackage;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNamewhile;
+
+import java.util.List;
+
+import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTVisitor;
+import org.aspectj.org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Annotation;
+import org.aspectj.org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayInitializer;
+import org.aspectj.org.eclipse.jdt.core.dom.Block;
+import org.aspectj.org.eclipse.jdt.core.dom.BodyDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.BreakStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.CatchClause;
+import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.dom.DoStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.EmptyStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.EnhancedForStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.EnumConstantDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.EnumDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.ForStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.IfStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Initializer;
+import org.aspectj.org.eclipse.jdt.core.dom.LabeledStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.LambdaExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.MarkerAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Modifier;
+import org.aspectj.org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.ReturnStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.SingleMemberAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Statement;
+import org.aspectj.org.eclipse.jdt.core.dom.SwitchCase;
+import org.aspectj.org.eclipse.jdt.core.dom.SwitchStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.TryStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.WhileStatement;
+import org.aspectj.org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
+
+public class LineBreaksPreparator extends ASTVisitor {
+ final private TokenManager tm;
+ final private DefaultCodeFormatterOptions options;
+
+ private boolean declarationModifierVisited;
+
+ public LineBreaksPreparator(TokenManager tokenManager, DefaultCodeFormatterOptions options) {
+ this.tm = tokenManager;
+ this.options = options;
+ }
+
+ @Override
+ public boolean preVisit2(ASTNode node) {
+ boolean isMalformed = (node.getFlags() & ASTNode.MALFORMED) != 0;
+ return !isMalformed;
+ }
+
+ @Override
+ public boolean visit(CompilationUnit node) {
+ List<ImportDeclaration> imports = node.imports();
+ if (!imports.isEmpty()) {
+ int index = this.tm.firstIndexIn(imports.get(0), -1);
+ if (index > 0)
+ this.tm.get(index).putLineBreaksBefore(this.options.blank_lines_before_imports + 1);
+ }
+
+ List<AnnotationTypeDeclaration> types = node.types();
+ if (!types.isEmpty()) {
+ if (!imports.isEmpty())
+ this.tm.firstTokenIn(types.get(0), -1).putLineBreaksBefore(this.options.blank_lines_after_imports + 1);
+ for (int i = 1; i < types.size(); i++) {
+ this.tm.firstTokenIn(types.get(i), -1).putLineBreaksBefore(
+ this.options.blank_lines_between_type_declarations + 1);
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(PackageDeclaration node) {
+ int blanks = this.options.blank_lines_before_package;
+ if (blanks > 0) {
+ List<Annotation> annotations = node.annotations();
+ int firstTokenIndex = annotations.isEmpty() ? this.tm.firstIndexBefore(node.getName(), TokenNamepackage)
+ : this.tm.firstIndexIn(annotations.get(0), -1);
+ this.tm.get(firstTokenIndex).putLineBreaksBefore(blanks + 1);
+ }
+ this.tm.lastTokenIn(node, TokenNameSEMICOLON).putLineBreaksAfter(this.options.blank_lines_after_package + 1);
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(ImportDeclaration node) {
+ breakLineBefore(node);
+ return true;
+ }
+
+ public boolean visit(TypeDeclaration node) {
+ handleBodyDeclarations(node.bodyDeclarations());
+
+ if (node.getName().getStartPosition() == -1)
+ return true; // this is a fake type created by parsing in class body mode
+
+ breakLineBefore(node);
+
+ handleBracedCode(node, node.getName(), this.options.brace_position_for_type_declaration,
+ this.options.indent_body_declarations_compare_to_type_header,
+ this.options.insert_new_line_in_empty_type_declaration);
+
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ private void handleBodyDeclarations(List<BodyDeclaration> bodyDeclarations) {
+ BodyDeclaration previous = null;
+ for (BodyDeclaration bodyDeclaration : bodyDeclarations) {
+ if (previous == null) {
+ this.tm.firstTokenIn(bodyDeclaration, -1).putLineBreaksBefore(
+ this.options.blank_lines_before_first_class_body_declaration + 1);
+ } else {
+ int blankLines;
+ if (bodyDeclaration instanceof FieldDeclaration)
+ blankLines = this.options.blank_lines_before_field;
+ else if (bodyDeclaration instanceof AbstractTypeDeclaration)
+ blankLines = this.options.blank_lines_before_member_type;
+ else
+ blankLines = this.options.blank_lines_before_method;
+
+ if (!sameChunk(previous, bodyDeclaration))
+ blankLines = Math.max(blankLines, this.options.blank_lines_before_new_chunk);
+
+ this.tm.firstTokenIn(bodyDeclaration, -1).putLineBreaksBefore(blankLines + 1);
+ }
+ previous = bodyDeclaration;
+ }
+ }
+
+ private boolean sameChunk(BodyDeclaration bd1, BodyDeclaration bd2) {
+ if (bd1.getClass().equals(bd2.getClass()))
+ return true;
+ if (bd1 instanceof AbstractTypeDeclaration && bd2 instanceof AbstractTypeDeclaration)
+ return true;
+ if ((bd1 instanceof MethodDeclaration || bd1 instanceof Initializer)
+ && (bd2 instanceof MethodDeclaration || bd2 instanceof Initializer))
+ return true;
+ return false;
+ }
+
+ @Override
+ public boolean visit(EnumDeclaration node) {
+ handleBracedCode(node, node.getName(), this.options.brace_position_for_enum_declaration,
+ this.options.indent_body_declarations_compare_to_enum_declaration_header,
+ this.options.insert_new_line_in_empty_enum_declaration);
+ handleBodyDeclarations(node.bodyDeclarations());
+
+ List<EnumConstantDeclaration> enumConstants = node.enumConstants();
+ for (int i = 0; i < enumConstants.size() - 1; i++) {
+ EnumConstantDeclaration declaration = enumConstants.get(i);
+ if (declaration.getAnonymousClassDeclaration() != null)
+ this.tm.firstTokenAfter(declaration, TokenNameCOMMA).breakAfter();
+ }
+
+ // put breaks after semicolons
+ int index = enumConstants.isEmpty() ? this.tm.firstIndexAfter(node.getName(), TokenNameLBRACE) + 1
+ : this.tm.firstIndexAfter(enumConstants.get(enumConstants.size() - 1), -1);
+ for (;; index++) {
+ Token token = this.tm.get(index);
+ if (token.isComment())
+ continue;
+ if (token.tokenType == TokenNameSEMICOLON)
+ token.breakAfter();
+ else
+ break;
+ }
+
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(AnnotationTypeDeclaration node) {
+ handleBracedCode(node, node.getName(), this.options.brace_position_for_annotation_type_declaration,
+ this.options.indent_body_declarations_compare_to_annotation_declaration_header,
+ this.options.insert_new_line_in_empty_annotation_declaration);
+
+ handleBodyDeclarations(node.bodyDeclarations());
+ if (node.getModifiers() == 0)
+ this.tm.firstTokenBefore(node.getName(), TokenNameAT).breakBefore();
+
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(AnonymousClassDeclaration node) {
+ if (node.getParent() instanceof EnumConstantDeclaration) {
+ handleBracedCode(node, null, this.options.brace_position_for_enum_constant,
+ this.options.indent_body_declarations_compare_to_enum_constant_header,
+ this.options.insert_new_line_in_empty_enum_constant);
+ } else {
+ handleBracedCode(node, null, this.options.brace_position_for_anonymous_type_declaration,
+ this.options.indent_body_declarations_compare_to_type_header,
+ this.options.insert_new_line_in_empty_anonymous_type_declaration);
+ }
+ handleBodyDeclarations(node.bodyDeclarations());
+ return true;
+ }
+
+ @Override
+ public boolean visit(MethodDeclaration node) {
+ if (node.isConstructor()) {
+ handleBracedCode(node.getBody(), null, this.options.brace_position_for_constructor_declaration,
+ this.options.indent_statements_compare_to_body,
+ this.options.insert_new_line_in_empty_method_body);
+ } else if (node.getBody() != null) {
+ handleBracedCode(node.getBody(), null, this.options.brace_position_for_method_declaration,
+ this.options.indent_statements_compare_to_body,
+ this.options.insert_new_line_in_empty_method_body);
+ Token openBrace = this.tm.firstTokenIn(node.getBody(), TokenNameLBRACE);
+ if (openBrace.getLineBreaksAfter() > 0) // if not, these are empty braces
+ openBrace.putLineBreaksAfter(this.options.blank_lines_at_beginning_of_method_body + 1);
+ }
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(Block node) {
+ if (this.options.keep_guardian_clause_on_one_line && this.tm.isGuardClause(node))
+ return true;
+
+ List<Statement> statements = node.statements();
+ for (Statement statement : statements) {
+ if (this.options.put_empty_statement_on_new_line || !(statement instanceof EmptyStatement))
+ breakLineBefore(statement);
+ }
+ if (node.getParent().getLength() == 0)
+ return true; // this is a fake block created by parsing in statements mode
+
+ ASTNode parent = node.getParent();
+ if (parent instanceof MethodDeclaration)
+ return true; // braces have been handled in #visit(MethodDeclaration)
+
+ String bracePosition = this.options.brace_position_for_block;
+ if (parent instanceof SwitchStatement) {
+ List<Statement> siblings = ((SwitchStatement) parent).statements();
+ int blockPosition = siblings.indexOf(node);
+ boolean isFirstInCase = blockPosition > 0 && (siblings.get(blockPosition - 1) instanceof SwitchCase);
+ if (isFirstInCase)
+ bracePosition = this.options.brace_position_for_block_in_case;
+ } else if (parent instanceof LambdaExpression) {
+ bracePosition = this.options.brace_position_for_lambda_body;
+ }
+ handleBracedCode(node, null, bracePosition, this.options.indent_statements_compare_to_block,
+ this.options.insert_new_line_in_empty_block);
+
+ return true;
+ }
+
+ @Override
+ public boolean visit(SwitchStatement node) {
+ handleBracedCode(node, node.getExpression(), this.options.brace_position_for_switch,
+ this.options.indent_switchstatements_compare_to_switch, true);
+
+ List<Statement> statements = node.statements();
+ if (this.options.indent_switchstatements_compare_to_cases) {
+ int nonBreakStatementEnd = -1;
+ for (Statement statement : statements) {
+ if (statement instanceof SwitchCase) {
+ if (nonBreakStatementEnd >= 0) {
+ // indent only comments between previous and current statement
+ this.tm.get(nonBreakStatementEnd + 1).indent();
+ this.tm.firstTokenIn(statement, -1).unindent();
+ }
+ } else if (!(statement instanceof BreakStatement || statement instanceof Block)) {
+ indent(statement);
+ }
+ nonBreakStatementEnd = (statement instanceof BreakStatement || statement instanceof ReturnStatement)
+ ? -1 : this.tm.lastIndexIn(statement, -1);
+ }
+ if (nonBreakStatementEnd >= 0) {
+ // indent comments between last statement and closing brace
+ this.tm.get(nonBreakStatementEnd + 1).indent();
+ this.tm.lastTokenIn(node, TokenNameRBRACE).unindent();
+ }
+ }
+ if (this.options.indent_breaks_compare_to_cases) {
+ for (Statement statement : statements) {
+ if (statement instanceof BreakStatement)
+ indent(statement);
+ }
+ }
+
+ for (Statement statement : statements) {
+ if (statement instanceof Block)
+ continue; // will add break in visit(Block) if necessary
+ if (this.options.put_empty_statement_on_new_line || !(statement instanceof EmptyStatement))
+ breakLineBefore(statement);
+ }
+
+ return true;
+ }
+
+ @Override
+ public boolean visit(DoStatement node) {
+ Statement body = node.getBody();
+ handleLoopBody(body);
+ if (this.options.insert_new_line_before_while_in_do_statement
+ || (!(body instanceof Block) && !(body instanceof EmptyStatement))) {
+ Token whileToken = this.tm.firstTokenBefore(node.getExpression(), TokenNamewhile);
+ whileToken.breakBefore();
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(LabeledStatement node) {
+ if (this.options.insert_new_line_after_label)
+ this.tm.firstTokenIn(node, TokenNameCOLON).breakAfter();
+ return true;
+ }
+
+ @Override
+ public boolean visit(ArrayInitializer node) {
+ int openBraceIndex = this.tm.firstIndexIn(node, TokenNameLBRACE);
+ Token afterOpenBraceToken = this.tm.get(openBraceIndex + 1);
+ boolean isEmpty = afterOpenBraceToken.tokenType == TokenNameRBRACE;
+ if (isEmpty && this.options.keep_empty_array_initializer_on_one_line)
+ return true;
+
+ Token openBraceToken = this.tm.get(openBraceIndex);
+ int closeBraceIndex = this.tm.lastIndexIn(node, TokenNameRBRACE);
+ handleBracePosition(openBraceToken, closeBraceIndex, this.options.brace_position_for_array_initializer);
+
+ if (!isEmpty) {
+ Token closeBraceToken = this.tm.get(closeBraceIndex);
+ if (this.options.insert_new_line_after_opening_brace_in_array_initializer)
+ openBraceToken.breakAfter();
+ if (this.options.insert_new_line_before_closing_brace_in_array_initializer)
+ closeBraceToken.breakBefore();
+ if (!(node.getParent() instanceof ArrayInitializer)) {
+ for (int i = 0; i < this.options.continuation_indentation_for_array_initializer; i++) {
+ afterOpenBraceToken.indent();
+ closeBraceToken.unindent();
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(NormalAnnotation node) {
+ handleAnnotation(node);
+ return true;
+ }
+
+ @Override
+ public boolean visit(SingleMemberAnnotation node) {
+ handleAnnotation(node);
+ return true;
+ }
+
+ @Override
+ public boolean visit(MarkerAnnotation node) {
+ handleAnnotation(node);
+ return true;
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationStatement node) {
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(SingleVariableDeclaration node) {
+ this.declarationModifierVisited = false;
+ if (node.getParent() instanceof MethodDeclaration) {
+ // special case: annotations on parameters without modifiers should not be treated as type annotations
+ this.declarationModifierVisited = (node.getModifiers() == 0);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationExpression node) {
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(FieldDeclaration node) {
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(AnnotationTypeMemberDeclaration node) {
+ this.declarationModifierVisited = false;
+ return true;
+ }
+
+ @Override
+ public boolean visit(Modifier node) {
+ this.declarationModifierVisited = true;
+ return true;
+ }
+
+ private void handleAnnotation(Annotation node) {
+ ASTNode parentNode = node.getParent();
+ boolean breakAfter = false;
+ boolean isTypeAnnotation = this.declarationModifierVisited;
+ if (isTypeAnnotation) {
+ breakAfter = this.options.insert_new_line_after_type_annotation;
+ } else if (parentNode instanceof PackageDeclaration) {
+ breakAfter = this.options.insert_new_line_after_annotation_on_package;
+ } else if (parentNode instanceof AbstractTypeDeclaration) {
+ breakAfter = this.options.insert_new_line_after_annotation_on_type;
+ } else if (parentNode instanceof FieldDeclaration) {
+ breakAfter = this.options.insert_new_line_after_annotation_on_field;
+ } else if (parentNode instanceof MethodDeclaration
+ || parentNode instanceof AnnotationTypeMemberDeclaration) {
+ breakAfter = this.options.insert_new_line_after_annotation_on_method;
+ } else if (parentNode instanceof VariableDeclarationStatement
+ || parentNode instanceof VariableDeclarationExpression) {
+ breakAfter = this.options.insert_new_line_after_annotation_on_local_variable;
+ } else if (parentNode instanceof SingleVariableDeclaration) {
+ breakAfter = this.options.insert_new_line_after_annotation_on_parameter;
+ if ((parentNode.getParent()) instanceof EnhancedForStatement)
+ breakAfter = this.options.insert_new_line_after_annotation_on_local_variable;
+ }
+ if (breakAfter)
+ this.tm.lastTokenIn(node, -1).breakAfter();
+ }
+
+ @Override
+ public boolean visit(WhileStatement node) {
+ handleLoopBody(node.getBody());
+ return true;
+ }
+
+ @Override
+ public boolean visit(ForStatement node) {
+ handleLoopBody(node.getBody());
+ return true;
+ }
+
+ @Override
+ public boolean visit(EnhancedForStatement node) {
+ handleLoopBody(node.getBody());
+ return true;
+ }
+
+ private void handleLoopBody(Statement body) {
+ if (!(body instanceof Block)
+ && !(body instanceof EmptyStatement && !this.options.put_empty_statement_on_new_line)) {
+ breakLineBefore(body);
+ indent(body);
+ }
+ }
+
+ @Override
+ public boolean visit(IfStatement node) {
+ Statement elseNode = node.getElseStatement();
+ Statement thenNode = node.getThenStatement();
+ if (elseNode != null) {
+ if (this.options.insert_new_line_before_else_in_if_statement || !(thenNode instanceof Block))
+ this.tm.firstTokenBefore(elseNode, TokenNameelse).breakBefore();
+
+ boolean keepElseOnSameLine = (elseNode instanceof Block)
+ || (this.options.keep_else_statement_on_same_line)
+ || (this.options.compact_else_if && (elseNode instanceof IfStatement));
+ if (!keepElseOnSameLine) {
+ breakLineBefore(elseNode);
+ indent(elseNode);
+ }
+ }
+
+ boolean keepThenOnSameLine = this.options.keep_then_statement_on_same_line
+ || (this.options.keep_simple_if_on_one_line && elseNode == null);
+ if (!keepThenOnSameLine && !(thenNode instanceof Block)) {
+ breakLineBefore(thenNode);
+ indent(thenNode);
+ }
+
+ return true;
+ }
+
+ @Override
+ public boolean visit(TryStatement node) {
+ if (node.getFinally() != null && this.options.insert_new_line_before_finally_in_try_statement) {
+ this.tm.firstTokenBefore(node.getFinally(), TokenNamefinally).breakBefore();
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(CatchClause node) {
+ if (this.options.insert_new_line_before_catch_in_try_statement)
+ breakLineBefore(node);
+ return true;
+ }
+
+ private void breakLineBefore(ASTNode node) {
+ this.tm.firstTokenIn(node, -1).breakBefore();
+ }
+
+ private void handleBracedCode(ASTNode node, ASTNode nodeBeforeOpenBrace, String bracePosition, boolean indentBody,
+ boolean newLineInEmpty) {
+ int openBraceIndex = nodeBeforeOpenBrace == null
+ ? this.tm.firstIndexIn(node, TokenNameLBRACE)
+ : this.tm.firstIndexAfter(nodeBeforeOpenBrace, TokenNameLBRACE);
+ int closeBraceIndex = this.tm.lastIndexIn(node, TokenNameRBRACE);
+ Token openBraceToken = this.tm.get(openBraceIndex);
+ handleBracePosition(openBraceToken, closeBraceIndex, bracePosition);
+
+ boolean isEmpty = true;
+ for (int i = openBraceIndex + 1; i < closeBraceIndex; i++) {
+ if (!this.tm.get(i).isComment()) {
+ isEmpty = false;
+ break;
+ }
+ }
+ if (!isEmpty || newLineInEmpty) {
+ openBraceToken.breakAfter();
+ this.tm.get(closeBraceIndex).breakBefore();
+ }
+ if (indentBody) {
+ this.tm.get(openBraceIndex + 1).indent();
+ this.tm.get(closeBraceIndex).unindent();
+ }
+ }
+
+ private void handleBracePosition(Token openBraceToken, int closeBraceIndex, String bracePosition) {
+ if (bracePosition.equals(DefaultCodeFormatterConstants.NEXT_LINE)) {
+ openBraceToken.breakBefore();
+ } else if (bracePosition.equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED)) {
+ openBraceToken.breakBefore();
+ openBraceToken.indent();
+ if (closeBraceIndex + 1 < this.tm.size())
+ this.tm.get(closeBraceIndex + 1).unindent();
+ } else if (bracePosition.equals(DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP)) {
+ openBraceToken.setNextLineOnWrap();
+ }
+ }
+
+ private void indent(ASTNode node) {
+ int startIndex = this.tm.firstIndexIn(node, -1);
+ while (startIndex > 0 && this.tm.get(startIndex - 1).isComment())
+ startIndex--;
+ this.tm.get(startIndex).indent();
+ int lastIndex = this.tm.lastIndexIn(node, -1);
+ if (lastIndex + 1 < this.tm.size())
+ this.tm.get(lastIndex + 1).unindent();
+ }
+
+ public void finishUp() {
+ // the visits only noted where indents increase and decrease,
+ // now prepare actual indent values
+ int currentIndent = this.options.initial_indentation_level;
+ for (Token token : this.tm) {
+ currentIndent += token.getIndent();
+ token.setIndent(currentIndent * this.options.indentation_size);
+ }
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Location.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Location.java
deleted file mode 100644
index 77269dc..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Location.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-/**
- * A location maintains positional information both in original source and in the output source.
- * It remembers source offsets, line/column and indentation level.
- * @since 2.1
- */
-public class Location {
-
- public int inputOffset;
- /** deprecated */
- public int inputColumn;
- public int outputLine;
- public int outputColumn;
- public int outputIndentationLevel;
- public boolean needSpace;
- public boolean pendingSpace;
- public int nlsTagCounter;
- public int lastLocalDeclarationSourceStart;
- public int numberOfIndentations;
-
- // chunk management
- public int lastNumberOfNewLines;
-
- // edits management
- int editsIndex;
- OptimizedReplaceEdit textEdit;
-
- public Location(Scribe scribe, int sourceRestart){
- update(scribe, sourceRestart);
- }
-
- public void update(Scribe scribe, int sourceRestart){
- this.outputColumn = scribe.column;
- this.outputLine = scribe.line;
- this.inputOffset = sourceRestart;
- this.inputColumn = scribe.getCurrentIndentation(sourceRestart) + 1;
- this.outputIndentationLevel = scribe.indentationLevel;
- this.lastNumberOfNewLines = scribe.lastNumberOfNewLines;
- this.needSpace = scribe.needSpace;
- this.pendingSpace = scribe.pendingSpace;
- this.editsIndex = scribe.editsIndex;
- this.nlsTagCounter = scribe.nlsTagCounter;
- this.numberOfIndentations = scribe.numberOfIndentations;
- this.textEdit = scribe.getLastEdit();
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("output (column="+this.outputColumn); //$NON-NLS-1$
- buffer.append(", line="+this.outputLine); //$NON-NLS-1$
- buffer.append(", indentation level="+this.outputIndentationLevel); //$NON-NLS-1$
- buffer.append(") input (offset="+this.inputOffset); //$NON-NLS-1$
- buffer.append(", column="+this.inputColumn); //$NON-NLS-1$
- buffer.append(')');
- return buffer.toString();
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/OptimizedReplaceEdit.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/OptimizedReplaceEdit.java
deleted file mode 100644
index cb5c3f1..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/OptimizedReplaceEdit.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-public class OptimizedReplaceEdit {
-
- int offset;
- int length;
- String replacement;
-
- public OptimizedReplaceEdit(int offset, int length, String replacement) {
- this.offset = offset;
- this.length = length;
- this.replacement = replacement;
- }
-
- public String toString() {
- return (this.offset < 0 ? "(" : "X(") + this.offset + ", length " + this.length + " :>" + this.replacement + "<"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ //$NON-NLS-5$
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe.java
deleted file mode 100644
index a637ed9..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Scribe.java
+++ /dev/null
@@ -1,5160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Ray V. (voidstar@gmail.com) - Contribution for bug 282988
- * Jesper S Moller - Contribution for bug 402892
- * Contribution for bug 402818
- * Robin Stocker - Bug 49619 - [formatting] comment formatter leaves whitespace in comments
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Map;
-
-import org.aspectj.org.eclipse.jdt.core.JavaCore;
-import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
-import org.aspectj.org.eclipse.jdt.core.compiler.InvalidInputException;
-import org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
-import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
-import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
-import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
-import org.aspectj.org.eclipse.jdt.internal.compiler.util.Util;
-import org.aspectj.org.eclipse.jdt.internal.core.util.CodeSnippetParsingUtil;
-import org.aspectj.org.eclipse.jdt.internal.core.util.RecordedParsingInformation;
-import org.aspectj.org.eclipse.jdt.internal.formatter.align.Alignment;
-import org.aspectj.org.eclipse.jdt.internal.formatter.align.AlignmentException;
-import org.aspectj.org.eclipse.jdt.internal.formatter.comment.CommentFormatterUtil;
-import org.aspectj.org.eclipse.jdt.internal.formatter.comment.HTMLEntity2JavaReader;
-import org.aspectj.org.eclipse.jdt.internal.formatter.comment.IJavaDocTagConstants;
-import org.aspectj.org.eclipse.jdt.internal.formatter.comment.Java2HTMLEntityReader;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * This class is responsible for dumping formatted source
- * @since 2.1
- */
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public class Scribe implements IJavaDocTagConstants {
-
- private static final int INITIAL_SIZE = 100;
-
- private boolean checkLineWrapping;
- /** one-based column */
- public int column;
- private int[][] commentPositions;
-
- // Most specific alignment.
- public Alignment currentAlignment;
- public int currentToken;
-
- // edits management
- private OptimizedReplaceEdit[] edits;
- public int editsIndex;
-
- public CodeFormatterVisitor formatter;
- public int indentationLevel;
- public int lastNumberOfNewLines;
- private boolean preserveLineBreakIndentation = false;
- public int line;
-
- private int[] lineEnds;
- private int maxLines;
- public Alignment memberAlignment;
- public boolean needSpace = false;
-
- // Line separator infos
- final private String lineSeparator;
- final private String lineSeparatorAndSpace;
- final private char firstLS;
- final private int lsLength;
-
- public int nlsTagCounter;
- public int pageWidth;
- public boolean pendingSpace = false;
-
- public Scanner scanner;
- public int scannerEndPosition;
- public int tabLength;
- public int indentationSize;
- private final IRegion[] regions;
- private IRegion[] adaptedRegions;
- public int tabChar;
- public int numberOfIndentations;
- private boolean useTabsOnlyForLeadingIndents;
-
- /** empty lines*/
- private final boolean indentEmptyLines;
- int blank_lines_between_import_groups = -1;
-
- // Preserve empty lines constants
- public static final int DO_NOT_PRESERVE_EMPTY_LINES = -1;
- public static final int PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION = 1;
- public static final int PRESERVE_EMPTY_LINES_IN_FORMAT_LEFT_CURLY_BRACE = 2;
- public static final int PRESERVE_EMPTY_LINES_IN_STRING_LITERAL_CONCATENATION = 3;
- public static final int PRESERVE_EMPTY_LINES_IN_CLOSING_ARRAY_INITIALIZER = 4;
- public static final int PRESERVE_EMPTY_LINES_IN_FORMAT_OPENING_BRACE = 5;
- public static final int PRESERVE_EMPTY_LINES_IN_BINARY_EXPRESSION = 6;
- public static final int PRESERVE_EMPTY_LINES_IN_EQUALITY_EXPRESSION = 7;
- public static final int PRESERVE_EMPTY_LINES_BEFORE_ELSE = 8;
- public static final int PRESERVE_EMPTY_LINES_IN_SWITCH_CASE = 9;
- public static final int PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION = 10;
- public static final int PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK = 11;
- final static int PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION = -1;
- final static int PRESERVE_EMPTY_LINES_USE_CURRENT_INDENTATION = 0;
- final static int PRESERVE_EMPTY_LINES_USE_TEMPORARY_INDENTATION = 1;
-
- /** disabling */
- boolean editsEnabled;
- boolean useTags;
- int tagsKind;
-
- /* Comments formatting */
- private static final int INCLUDE_BLOCK_COMMENTS = CodeFormatter.F_INCLUDE_COMMENTS | CodeFormatter.K_MULTI_LINE_COMMENT;
- private static final int INCLUDE_JAVA_DOC = CodeFormatter.F_INCLUDE_COMMENTS | CodeFormatter.K_JAVA_DOC;
- private static final int INCLUDE_LINE_COMMENTS = CodeFormatter.F_INCLUDE_COMMENTS | CodeFormatter.K_SINGLE_LINE_COMMENT;
- private static final int SKIP_FIRST_WHITESPACE_TOKEN = -2;
- private static final int INVALID_TOKEN = 2000;
- static final int NO_TRAILING_COMMENT = 0x0000;
- static final int BASIC_TRAILING_COMMENT = 0x0100;
- static final int COMPLEX_TRAILING_COMMENT = 0x0200;
- static final int IMPORT_TRAILING_COMMENT = COMPLEX_TRAILING_COMMENT | 0x0001;
- static final int UNMODIFIABLE_TRAILING_COMMENT = 0x0400;
- private int formatComments = 0;
- private int headerEndPosition = -1;
- String commentIndentation; // indentation requested in comments (usually in javadoc root tags description)
-
- // Class to store previous line comment information
- static class LineComment {
- boolean contiguous = false;
- int currentIndentation, indentation;
- int lines;
- char[] leadingSpaces;
- }
- final LineComment lastLineComment = new LineComment();
-
- // New way to format javadoc
- private FormatterCommentParser formatterCommentParser; // specialized parser to format comments
-
- // Disabling and enabling tags
- OptimizedReplaceEdit previousDisabledEdit;
- private char[] disablingTag, enablingTag;
-
- // Well know strings
- private String[] newEmptyLines = new String[10];
- private static String[] COMMENT_INDENTATIONS = new String[20];
-
- // final string buffers
- private final StringBuffer tempBuffer= new StringBuffer();
- private final StringBuffer blockCommentBuffer = new StringBuffer();
- private final StringBuffer blockCommentTokensBuffer = new StringBuffer();
- private final StringBuffer codeSnippetBuffer = new StringBuffer();
- private final StringBuffer javadocBlockRefBuffer= new StringBuffer();
- private final StringBuffer javadocGapLinesBuffer = new StringBuffer();
- private StringBuffer[] javadocHtmlTagBuffers = new StringBuffer[5];
- private final StringBuffer javadocTextBuffer = new StringBuffer();
- private final StringBuffer javadocTokensBuffer = new StringBuffer();
-
- Scribe(CodeFormatterVisitor formatter, long sourceLevel, IRegion[] regions, CodeSnippetParsingUtil codeSnippetParsingUtil, boolean includeComments) {
- initializeScanner(sourceLevel, formatter.preferences);
- this.formatter = formatter;
- this.pageWidth = formatter.preferences.page_width;
- this.tabLength = formatter.preferences.tab_size;
- this.indentationLevel= 0; // initialize properly
- this.numberOfIndentations = 0;
- this.useTabsOnlyForLeadingIndents = formatter.preferences.use_tabs_only_for_leading_indentations;
- this.indentEmptyLines = formatter.preferences.indent_empty_lines;
- this.tabChar = formatter.preferences.tab_char;
- if (this.tabChar == DefaultCodeFormatterOptions.MIXED) {
- this.indentationSize = formatter.preferences.indentation_size;
- } else {
- this.indentationSize = this.tabLength;
- }
- this.lineSeparator = formatter.preferences.line_separator;
- this.lineSeparatorAndSpace = this.lineSeparator+' ';
- this.firstLS = this.lineSeparator.charAt(0);
- this.lsLength = this.lineSeparator.length();
- this.indentationLevel = formatter.preferences.initial_indentation_level * this.indentationSize;
- this.regions= regions;
- if (codeSnippetParsingUtil != null) {
- final RecordedParsingInformation information = codeSnippetParsingUtil.recordedParsingInformation;
- if (information != null) {
- this.lineEnds = information.lineEnds;
- this.commentPositions = information.commentPositions;
- }
- }
- if (formatter.preferences.comment_format_line_comment) this.formatComments |= CodeFormatter.K_SINGLE_LINE_COMMENT;
- if (formatter.preferences.comment_format_block_comment) this.formatComments |= CodeFormatter.K_MULTI_LINE_COMMENT;
- if (formatter.preferences.comment_format_javadoc_comment) this.formatComments |= CodeFormatter.K_JAVA_DOC;
- if (includeComments) this.formatComments |= CodeFormatter.F_INCLUDE_COMMENTS;
- reset();
- }
-
- /**
- * This method will adapt the selected regions if needed.
- * If a region should be adapted (see isAdaptableRegion(IRegion))
- * retrieve correct upper and lower bounds and replace the region.
- */
- private void adaptRegions() {
- int max = this.regions.length;
- if (max == 1) {
- // It's not necessary to adapt the single region which covers all the source
- if (this.regions[0].getOffset() == 0 && this.regions[0].getLength() == this.scannerEndPosition) {
- this.adaptedRegions = this.regions;
- return;
- }
- }
- this.adaptedRegions = new IRegion[max];
- int commentIndex = 0;
- for (int i = 0; i < max; i++) {
- IRegion aRegion = this.regions[i];
- int offset = aRegion.getOffset();
- int length = aRegion.getLength();
-
- // First look if the region starts or ends inside a comment
- int index = getCommentIndex(commentIndex, offset);
- int adaptedOffset = offset;
- int adaptedLength = length;
- if (index >= 0) {
- // the offset of the region is inside a comment => restart the region from the comment start
- adaptedOffset = this.commentPositions[index][0];
- if (adaptedOffset >= 0) {
- // adapt only javadoc or block comments. Since fix for bug
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=238210
- // edits in line comments only concerns whitespaces hence can be
- // treated as edits in code
- adaptedLength = length + offset - adaptedOffset;
- commentIndex = index;
- }
- }
- index = getCommentIndex(commentIndex, offset+length-1);
- if (index >= 0 && this.commentPositions[index][0] >= 0) { // only javadoc or block comment
- // the region end is inside a comment => set the region end at the comment end
- int commentEnd = this.commentPositions[index][1];
- if (commentEnd < 0) commentEnd = -commentEnd;
- adaptedLength = commentEnd - adaptedOffset;
- commentIndex = index;
- }
- if (adaptedLength != length) {
- // adapt the region and jump to next one
- this.adaptedRegions[i] = new Region(adaptedOffset, adaptedLength);
- } else {
- this.adaptedRegions[i] = aRegion;
- }
- }
- }
-
- /*
- * Adapt edits to regions.
- *
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583"
- * for more details
- */
- private void adaptEdits() {
-
- // See if adapting edits is really necessary
- int max = this.regions.length;
- if (max == 1) {
- if (this.regions[0].getOffset() == 0 && this.regions[0].getLength() == this.scannerEndPosition) {
- // No need to adapt as the regions covers the whole source
- return;
- }
- }
-
- // Sort edits
- OptimizedReplaceEdit[] sortedEdits = new OptimizedReplaceEdit[this.editsIndex];
- System.arraycopy(this.edits, 0, sortedEdits, 0, this.editsIndex);
- Arrays.sort(sortedEdits, new Comparator() {
- public int compare(Object o1, Object o2) {
- OptimizedReplaceEdit edit1 = (OptimizedReplaceEdit) o1;
- OptimizedReplaceEdit edit2 = (OptimizedReplaceEdit) o2;
- return edit1.offset - edit2.offset;
- }
- });
-
- // Adapt overlapping edits
- int currentEdit = -1;
- for (int i = 0; i < max; i++) {
- IRegion region = this.adaptedRegions[i];
- int offset = region.getOffset();
- int length = region.getLength();
-
- // modify overlapping edits on the region (if any)
- int index = adaptEdit(sortedEdits, currentEdit, offset, offset+length);
- if (index != -1) {
- currentEdit = index;
- }
- }
-
- // Set invalid all edits outside the region
- if (currentEdit != -1) {
- int length = sortedEdits.length;
- for (int e=currentEdit; e<length; e++) {
- sortedEdits[e].offset = -1;
- }
- }
- }
-
- /*
- * Search whether a region overlap edit(s) at its start and/or at its end.
- * If so, modify the concerned edits to keep only the modifications which are
- * inside the given region.
- *
- * The edit modification is done as follow:
- * 1) start it from the region start if it overlaps the region's start
- * 2) end it at the region end if it overlaps the region's end
- * 3) remove from the replacement string the number of lines which are outside
- * the region: before when overlapping region's start and after when overlapping
- * region's end. Note that the trailing indentation of the replacement string is not
- * kept when the region's end is overlapped because it's always outside the
- * region.
- */
- private int adaptEdit(OptimizedReplaceEdit[] sortedEdits, int start, int regionStart, int regionEnd) {
- int initialStart = start==-1 ? 0 : start;
- int bottom = initialStart, top = sortedEdits.length - 1;
- int topEnd = top;
- int i = 0;
- OptimizedReplaceEdit edit = null;
- int overlapIndex = -1;
-
- // Look for an edit overlapping the region start
- while (bottom <= top) {
- i = bottom + (top - bottom) /2;
- edit = sortedEdits[i];
- int editStart = edit.offset;
- int editEnd = editStart + edit.length;
- if (editStart > regionStart) { // the edit starts after the region's start => no possible overlap of region's start
- top = i-1;
- if (editStart > regionEnd) { // the edit starts after the region's end => no possible overlap of region's end
- topEnd = top;
- }
- } else {
- if (editEnd < regionStart) { // the edit ends before the region's start => no possible overlap of region's start
- bottom = i+1;
- } else {
- // Count the lines of the edit which are outside the region
- int linesOutside = 0;
- StringBuffer spacesOutside = new StringBuffer();
- this.scanner.resetTo(editStart, editEnd-1);
- while (this.scanner.currentPosition < regionStart && !this.scanner.atEnd()) {
- char ch = (char) this.scanner.getNextChar();
- switch (ch) {
- case '\n':
- linesOutside++;
- spacesOutside.setLength(0);
- break;
- case '\r':
- break;
- default:
- spacesOutside.append(ch);
- break;
- }
- }
-
- // Restart the edit at the beginning of the line where the region start
- edit.offset = regionStart;
- int editLength = edit.length;
- edit.length -= edit.offset - editStart;
-
- // Cut replacement string if necessary
- int length = edit.replacement.length();
- if (length > 0) {
-
- // Count the lines in replacement string
- int linesReplaced = 0;
- for (int idx=0; idx < length; idx++) {
- if (edit.replacement.charAt(idx) == '\n') linesReplaced++;
- }
-
- // If the edit was a replacement but become an insertion due to the length reduction
- // and if the edit finishes just before the region starts and if there's no line to replace
- // then there's no replacement to do...
- if (editLength > 0 && edit.length == 0 && editEnd == regionStart && linesReplaced == 0 && linesOutside== 0) {
- edit.offset = -1;
- } else {
-
- // As the edit starts outside the region, remove first lines from edit string if any
- if (linesReplaced > 0) {
- int linesCount = linesOutside >= linesReplaced ? linesReplaced : linesOutside;
- if (linesCount > 0) {
- int idx = 0;
- loop: while (idx < length) {
- char ch = edit.replacement.charAt(idx);
- switch (ch) {
- case '\n':
- linesCount--;
- if (linesCount == 0) {
- idx++;
- break loop;
- }
- break;
- case '\r':
- case ' ':
- case '\t':
- break;
- default:
- break loop;
- }
- idx++;
- }
- // Compare spaces outside the region and the beginning
- // of the replacement string to remove the common part
- int spacesOutsideLength = spacesOutside.length();
- int replacementStart = idx;
- for (int o=0, r=0; o < spacesOutsideLength && r<(length-idx); o++) {
- char rch = edit.replacement.charAt(idx + r);
- char och = spacesOutside.charAt(o);
- if (rch == och) {
- replacementStart++;
- r++;
- } else if (rch == '\t' && (this.tabLength > 0 && och == ' ')) {
- if ((o+1)%this.tabLength == 0) {
- replacementStart++;
- r++;
- }
- } else {
- break;
- }
- }
- // Update the replacement string
- if (replacementStart > length || (replacementStart == length && spacesOutsideLength > 0)) {
- edit.offset = -1;
- } else if (spacesOutsideLength == 0 && replacementStart == length) {
- edit.replacement = ""; //$NON-NLS-1$
- } else {
- edit.replacement = edit.replacement.substring(replacementStart);
- }
- }
- }
- }
- }
- overlapIndex = i;
- break;
- }
- }
- }
- int validIndex = (overlapIndex != -1) ? overlapIndex : bottom;
-
- // Look for an edit overlapping the region end
- if (overlapIndex != -1) bottom = overlapIndex;
- while (bottom <= topEnd) {
- i = bottom + (topEnd - bottom) /2;
- edit = sortedEdits[i];
- int editStart = edit.offset;
- int editEnd = editStart + edit.length;
- if (regionEnd < editStart) { // the edit starts after the region's end => no possible overlap of region's end
- topEnd = i-1;
- } else if (regionEnd == editStart) { // special case when the edit starts just after the region's end...
- // ...we got the last index of the edit inside the region
- topEnd = i - 1;
- // this last edit is valid only if it's an insertion and if it has indentation
- if (edit.length == 0) {
- int nrLength = 0;
- int rLength = edit.replacement.length();
- if (nrLength < rLength) {
- int ch = edit.replacement.charAt(nrLength);
- loop: while (nrLength < rLength) {
- switch (ch) {
- case ' ':
- case '\t':
- nrLength++;
- break;
- default:
- break loop;
- }
- }
- }
- if (nrLength > 0) {
- topEnd++;
- if (nrLength < rLength) {
- edit.replacement = edit.replacement.substring(0, nrLength);
- }
- }
- }
- break;
- } else if (editEnd <= regionEnd) { // the edit ends before the region's end => no possible overlap of region's end
- bottom = i+1;
- } else {
- // Count the lines of the edit which are outside the region
- int linesOutside = 0;
- this.scanner.resetTo(editStart, editEnd-1);
- while (!this.scanner.atEnd()) {
- boolean after = this.scanner.currentPosition >= regionEnd;
- char ch = (char) this.scanner.getNextChar();
- if (ch == '\n' ) {
- if (after) linesOutside++;
- }
- }
-
- // Cut replacement string if necessary
- int length = edit.replacement.length();
- if (length > 0) {
-
- // Count the lines in replacement string
- int linesReplaced = 0;
- for (int idx=0; idx < length; idx++) {
- if (edit.replacement.charAt(idx) == '\n') linesReplaced++;
- }
-
- // Set the replacement string to the number of missing new lines
- // As the end of the edit is out of the region, the possible trailing
- // indentation should not be added...
- if (linesReplaced == 0) {
- edit.replacement = ""; //$NON-NLS-1$
- } else {
- int linesCount = linesReplaced > linesOutside ? linesReplaced - linesOutside : 0;
- if (linesCount == 0) {
- edit.replacement = ""; //$NON-NLS-1$
- } else {
- edit.replacement = getNewLineString(linesCount);
- }
- }
- }
- edit.length = regionEnd - editStart;
-
- // We got the last edit of the regions, give up
- topEnd = i;
- break;
- }
- }
-
- // Set invalid all edits outside the region
- for (int e=initialStart; e<validIndex; e++) {
- sortedEdits[e].offset = -1;
- }
-
- // Return the index of next edit to look at
- return topEnd+1;
- }
-
- private final void addDeleteEdit(int start, int end) {
- if (this.edits.length == this.editsIndex) {
- // resize
- resize();
- }
- addOptimizedReplaceEdit(start, end - start + 1, Util.EMPTY_STRING);
- }
-
- public final void addInsertEdit(int insertPosition, String insertedString) {
- if (this.edits.length == this.editsIndex) {
- // resize
- resize();
- }
- addOptimizedReplaceEdit(insertPosition, 0, insertedString);
- }
-
- private final void addOptimizedReplaceEdit(int offset, int length, String replacement) {
- if (!this.editsEnabled) {
- if (this.previousDisabledEdit != null && this.previousDisabledEdit.offset == offset) {
- replacement = this.previousDisabledEdit.replacement;
- }
- this.previousDisabledEdit = null;
- if (replacement.indexOf(this.lineSeparator) >= 0) {
- if (length == 0 || printNewLinesCharacters(offset, length)) {
- this.previousDisabledEdit = new OptimizedReplaceEdit(offset, length, replacement);
- }
- }
- return;
- }
- if (this.editsIndex > 0) {
- // try to merge last two edits
- final OptimizedReplaceEdit previous = this.edits[this.editsIndex-1];
- final int previousOffset = previous.offset;
- final int previousLength = previous.length;
- final int endOffsetOfPreviousEdit = previousOffset + previousLength;
- final int replacementLength = replacement.length();
- final String previousReplacement = previous.replacement;
- final int previousReplacementLength = previousReplacement.length();
- if (previousOffset == offset && previousLength == length && (replacementLength == 0 || previousReplacementLength == 0)) {
- if (this.currentAlignment != null) {
- final Location location = this.currentAlignment.location;
- if (location.editsIndex == this.editsIndex) {
- location.editsIndex--;
- location.textEdit = previous;
- }
- }
- this.editsIndex--;
- return;
- }
- if (endOffsetOfPreviousEdit == offset) {
- if (length != 0) {
- if (replacementLength != 0) {
- this.edits[this.editsIndex - 1] = new OptimizedReplaceEdit(previousOffset, previousLength + length, previousReplacement + replacement);
- } else if (previousLength + length == previousReplacementLength) {
- // check the characters. If they are identical, we can get rid of the previous edit
- boolean canBeRemoved = true;
- loop: for (int i = previousOffset; i < previousOffset + previousReplacementLength; i++) {
- if (this.scanner.source[i] != previousReplacement.charAt(i - previousOffset)) {
- this.edits[this.editsIndex - 1] = new OptimizedReplaceEdit(previousOffset, previousReplacementLength, previousReplacement);
- canBeRemoved = false;
- break loop;
- }
- }
- if (canBeRemoved) {
- if (this.currentAlignment != null) {
- final Location location = this.currentAlignment.location;
- if (location.editsIndex == this.editsIndex) {
- location.editsIndex--;
- location.textEdit = previous;
- }
- }
- this.editsIndex--;
- }
- } else {
- this.edits[this.editsIndex - 1] = new OptimizedReplaceEdit(previousOffset, previousLength + length, previousReplacement);
- }
- } else {
- if (replacementLength != 0) {
- this.edits[this.editsIndex - 1] = new OptimizedReplaceEdit(previousOffset, previousLength, previousReplacement + replacement);
- }
- }
- } else if ((offset + length == previousOffset) && (previousLength + length == replacementLength + previousReplacementLength)) {
- // check if both edits corresponds to the orignal source code
- boolean canBeRemoved = true;
- String totalReplacement = replacement + previousReplacement;
- loop: for (int i = 0; i < previousLength + length; i++) {
- if (this.scanner.source[i + offset] != totalReplacement.charAt(i)) {
- this.edits[this.editsIndex - 1] = new OptimizedReplaceEdit(offset, previousLength + length, totalReplacement);
- canBeRemoved = false;
- break loop;
- }
- }
- if (canBeRemoved) {
- if (this.currentAlignment != null) {
- final Location location = this.currentAlignment.location;
- if (location.editsIndex == this.editsIndex) {
- location.editsIndex--;
- location.textEdit = previous;
- }
- }
- this.editsIndex--;
- }
- } else {
- this.edits[this.editsIndex++] = new OptimizedReplaceEdit(offset, length, replacement);
- }
- } else {
- this.edits[this.editsIndex++] = new OptimizedReplaceEdit(offset, length, replacement);
- }
- }
-
- public final void addReplaceEdit(int start, int end, String replacement) {
- if (this.edits.length == this.editsIndex) {
- // resize
- resize();
- }
- addOptimizedReplaceEdit(start, end - start + 1, replacement);
- }
-
- public void alignFragment(Alignment alignment, int fragmentIndex){
- alignment.fragmentIndex = fragmentIndex;
- alignment.checkColumn();
- alignment.performFragmentEffect();
- }
-
- public void checkNLSTag(int sourceStart) {
- if (hasNLSTag(sourceStart)) {
- this.nlsTagCounter++;
- }
- }
-
- private int consumeInvalidToken(int end) {
- this.scanner.resetTo(this.scanner.startPosition, end);
- // In case of invalid unicode character, consume the current backslash character before continuing
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=233228
- if (this.scanner.currentCharacter == '\\') {
- this.scanner.currentPosition = this.scanner.startPosition+1;
- }
- int previousPosition = this.scanner.currentPosition;
- char ch = (char) this.scanner.getNextChar();
- if (this.scanner.atEnd()) {
- // avoid infinite loop
- return INVALID_TOKEN;
- }
- while (!this.scanner.atEnd() && ch != '*' && !ScannerHelper.isWhitespace(ch)) {
- previousPosition = this.scanner.currentPosition;
- ch = (char) this.scanner.getNextChar();
- }
- // restore last whitespace
- this.scanner.currentPosition = previousPosition;
- return INVALID_TOKEN;
- }
-
- public Alignment createAlignment(int kind, int mode, int count, int sourceRestart){
- return createAlignment(kind, mode, Alignment.R_INNERMOST, count, sourceRestart);
- }
-
- public Alignment createAlignment(int kind, int mode, int tieBreakRule, int count, int sourceRestart){
- return createAlignment(kind, mode, tieBreakRule, count, sourceRestart, this.formatter.preferences.continuation_indentation, false);
- }
-
- public Alignment createAlignment(int kind, int mode, int count, int sourceRestart, int continuationIndent, boolean adjust){
- return createAlignment(kind, mode, Alignment.R_INNERMOST, count, sourceRestart, continuationIndent, adjust);
- }
-
- public Alignment createAlignment(int kind, int mode, int tieBreakRule, int count, int sourceRestart, int continuationIndent, boolean adjust){
- Alignment alignment = new Alignment(kind, mode, tieBreakRule, this, count, sourceRestart, continuationIndent);
- // specific break indentation for message arguments inside binary expressions
- if ((this.currentAlignment == null && this.formatter.expressionsDepth >= 0) ||
- (this.currentAlignment != null && this.currentAlignment.kind == Alignment.BINARY_EXPRESSION &&
- (this.formatter.expressionsPos & CodeFormatterVisitor.EXPRESSIONS_POS_MASK) == CodeFormatterVisitor.EXPRESSIONS_POS_BETWEEN_TWO)) {
- switch (kind) {
- case Alignment.CONDITIONAL_EXPRESSION:
- case Alignment.MESSAGE_ARGUMENTS:
- case Alignment.MESSAGE_SEND:
- if (this.formatter.lastBinaryExpressionAlignmentBreakIndentation == alignment.breakIndentationLevel) {
- alignment.breakIndentationLevel += this.indentationSize;
- alignment.shiftBreakIndentationLevel += this.indentationSize;
- this.formatter.lastBinaryExpressionAlignmentBreakIndentation = 0;
- }
- break;
- }
- }
- // adjust break indentation
- if (adjust && this.memberAlignment != null) {
- Alignment current = this.memberAlignment;
- while (current.enclosing != null) {
- current = current.enclosing;
- }
- if ((current.mode & Alignment.M_MULTICOLUMN) != 0) {
- final int indentSize = this.indentationSize;
- switch(current.chunkKind) {
- case Alignment.CHUNK_METHOD :
- case Alignment.CHUNK_TYPE :
- if ((mode & Alignment.M_INDENT_BY_ONE) != 0) {
- alignment.breakIndentationLevel = this.indentationLevel + indentSize;
- } else {
- alignment.breakIndentationLevel = this.indentationLevel + continuationIndent * indentSize;
- }
- alignment.update();
- break;
- case Alignment.CHUNK_FIELD :
- if ((mode & Alignment.M_INDENT_BY_ONE) != 0) {
- alignment.breakIndentationLevel = current.originalIndentationLevel + indentSize;
- } else {
- alignment.breakIndentationLevel = current.originalIndentationLevel + continuationIndent * indentSize;
- }
- alignment.update();
- break;
- }
- } else {
- switch(current.mode & Alignment.SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT :
- case Alignment.M_COMPACT_FIRST_BREAK_SPLIT :
- case Alignment.M_NEXT_PER_LINE_SPLIT :
- case Alignment.M_NEXT_SHIFTED_SPLIT :
- case Alignment.M_ONE_PER_LINE_SPLIT :
- final int indentSize = this.indentationSize;
- switch(current.chunkKind) {
- case Alignment.CHUNK_METHOD :
- case Alignment.CHUNK_TYPE :
- if ((mode & Alignment.M_INDENT_BY_ONE) != 0) {
- alignment.breakIndentationLevel = this.indentationLevel + indentSize;
- } else {
- alignment.breakIndentationLevel = this.indentationLevel + continuationIndent * indentSize;
- }
- alignment.update();
- break;
- case Alignment.CHUNK_FIELD :
- if ((mode & Alignment.M_INDENT_BY_ONE) != 0) {
- alignment.breakIndentationLevel = current.originalIndentationLevel + indentSize;
- } else {
- alignment.breakIndentationLevel = current.originalIndentationLevel + continuationIndent * indentSize;
- }
- alignment.update();
- break;
- }
- break;
- }
- }
- }
- return alignment;
- }
-
- public Alignment createMemberAlignment(int kind, int mode, int count, int sourceRestart) {
- Alignment mAlignment = createAlignment(kind, mode, Alignment.R_INNERMOST, count, sourceRestart);
- mAlignment.breakIndentationLevel = this.indentationLevel;
- return mAlignment;
- }
-
- public void enterAlignment(Alignment alignment){
- alignment.enclosing = this.currentAlignment;
- alignment.location.lastLocalDeclarationSourceStart = this.formatter.lastLocalDeclarationSourceStart;
- this.currentAlignment = alignment;
- }
-
- public void enterMemberAlignment(Alignment alignment) {
- alignment.enclosing = this.memberAlignment;
- alignment.location.lastLocalDeclarationSourceStart = this.formatter.lastLocalDeclarationSourceStart;
- this.memberAlignment = alignment;
- }
-
- public void exitAlignment(Alignment alignment, boolean discardAlignment){
- Alignment current = this.currentAlignment;
- while (current != null){
- if (current == alignment) break;
- current = current.enclosing;
- }
- if (current == null) {
- throw new AbortFormatting("could not find matching alignment: "+alignment); //$NON-NLS-1$
- }
- this.indentationLevel = alignment.location.outputIndentationLevel;
- this.numberOfIndentations = alignment.location.numberOfIndentations;
- this.formatter.lastLocalDeclarationSourceStart = alignment.location.lastLocalDeclarationSourceStart;
- if (discardAlignment){
- this.currentAlignment = alignment.enclosing;
- if (this.currentAlignment == null) {
- this.formatter.lastBinaryExpressionAlignmentBreakIndentation = 0;
- }
- }
- }
-
- public void exitMemberAlignment(Alignment alignment){
- Alignment current = this.memberAlignment;
- while (current != null){
- if (current == alignment) break;
- current = current.enclosing;
- }
- if (current == null) {
- throw new AbortFormatting("could not find matching alignment: "+alignment); //$NON-NLS-1$
- }
- this.indentationLevel = current.location.outputIndentationLevel;
- this.numberOfIndentations = current.location.numberOfIndentations;
- this.formatter.lastLocalDeclarationSourceStart = alignment.location.lastLocalDeclarationSourceStart;
- this.memberAlignment = current.enclosing;
- }
-
- /**
- * Answer actual indentation level based on true column position
- * @return int
- */
- public int getColumnIndentationLevel() {
- return this.column - 1;
- }
-
- public final int getCommentIndex(int position) {
- if (this.commentPositions == null)
- return -1;
- int length = this.commentPositions.length;
- if (length == 0) {
- return -1;
- }
- int g = 0, d = length - 1;
- int m = 0;
- while (g <= d) {
- m = g + (d - g) / 2;
- int bound = this.commentPositions[m][1];
- if (bound < 0) {
- bound = -bound;
- }
- if (bound < position) {
- g = m + 1;
- } else if (bound > position) {
- d = m - 1;
- } else {
- return m;
- }
- }
- return -(g + 1);
- }
-
- /*
- * Returns the index of the comment including the given offset position
- * starting the search from the given start index.
- *
- * @param start The start index for the research
- * @param position The position
- * @return The index of the comment if the given position is located inside it, -1 otherwise
- */
- private int getCommentIndex(int start, int position) {
- int commentsLength = this.commentPositions == null ? 0 : this.commentPositions.length;
- if (commentsLength == 0) return -1;
- if (position == 0) {
- if (commentsLength > 0 && this.commentPositions[0][0]== 0) {
- return 0;
- }
- return -1;
- }
- int bottom = start, top = commentsLength - 1;
- int i = 0;
- int[] comment = null;
- while (bottom <= top) {
- i = bottom + (top - bottom) /2;
- comment = this.commentPositions[i];
- int commentStart = comment[0];
- if (commentStart < 0) commentStart = -commentStart;
- if (position < commentStart) {
- top = i-1;
- } else {
- int commentEnd = comment[1];
- if (commentEnd < 0) commentEnd = -commentEnd;
- if (position >= commentEnd) {
- bottom = i+1;
- } else {
- return i;
- }
- }
- }
- return -1;
- }
-
- private int getCurrentCommentIndentation(int start) {
- int linePtr = -Arrays.binarySearch(this.lineEnds, start);
- int indentation = 0;
- int beginningOfLine = getLineEnd(linePtr - 1)+1;
- if (beginningOfLine == -1) {
- beginningOfLine = 0;
- }
- int currentStartPosition = start;
- char[] source = this.scanner.source;
-
- // find the position of the beginning of the line containing the comment
- while (beginningOfLine > currentStartPosition) {
- if (linePtr > 0) {
- beginningOfLine = getLineEnd(--linePtr)+1;
- } else {
- beginningOfLine = 0;
- break;
- }
- }
- for (int i=beginningOfLine; i < currentStartPosition ; i++) {
- char currentCharacter = source[i];
- switch (currentCharacter) {
- case '\t' :
- if (this.tabLength != 0) {
- int reminder = indentation % this.tabLength;
- if (reminder == 0) {
- indentation += this.tabLength;
- } else {
- indentation = ((indentation / this.tabLength) + 1) * this.tabLength;
- }
- }
- break;
- case '\r' :
- case '\n' :
- indentation = 0;
- break;
- default:
- indentation++;
- break;
- }
- }
- return indentation;
- }
-
- int getCurrentIndentation(char[] whitespaces, int offset) {
- if (whitespaces == null) return offset;
- int length = whitespaces.length;
- if (this.tabLength == 0) return length;
- int indentation = offset;
- for (int i=0; i<length; i++) {
- char ch = whitespaces[i];
- switch (ch) {
- case '\t' :
- int reminder = indentation % this.tabLength;
- if (reminder == 0) {
- indentation += this.tabLength;
- } else {
- indentation = ((indentation / this.tabLength) + 1) * this.tabLength;
- }
- break;
- case '\r' :
- case '\n' :
- indentation = 0;
- break;
- default:
- indentation++;
- break;
- }
- }
- return indentation;
- }
-
- int getCurrentIndentation(int start) {
- int linePtr = Arrays.binarySearch(this.lineEnds, start);
- if (linePtr < 0) {
- linePtr = -linePtr - 1;
- }
- int indentation = 0;
- int beginningOfLine = getLineEnd(linePtr)+1;
- if (beginningOfLine == -1) {
- beginningOfLine = 0;
- }
- char[] source = this.scanner.source;
-
- for (int i=beginningOfLine; i<start; i++) {
- char currentCharacter = source[i];
- switch (currentCharacter) {
- case '\t' :
- if (this.tabLength != 0) {
- int reminder = indentation % this.tabLength;
- if (reminder == 0) {
- indentation += this.tabLength;
- } else {
- indentation = ((indentation / this.tabLength) + 1) * this.tabLength;
- }
- }
- break;
- case '\r' :
- case '\n' :
- indentation = 0;
- break;
- case ' ':
- indentation++;
- break;
- default:
- return indentation;
- }
- }
- return indentation;
- }
-
- public String getEmptyLines(int linesNumber) {
- if (this.nlsTagCounter > 0) {
- return Util.EMPTY_STRING;
- }
- String emptyLines;
- if (this.lastNumberOfNewLines == 0) {
- linesNumber++; // add an extra line breaks
- if (this.indentEmptyLines) {
- this.tempBuffer.setLength(0);
- for (int i = 0; i < linesNumber; i++) {
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- }
- emptyLines = this.tempBuffer.toString();
- } else {
- emptyLines = getNewLineString(linesNumber);
- }
- this.lastNumberOfNewLines += linesNumber;
- this.line += linesNumber;
- this.column = 1;
- this.needSpace = false;
- this.pendingSpace = false;
- } else if (this.lastNumberOfNewLines == 1) {
- if (this.indentEmptyLines) {
- this.tempBuffer.setLength(0);
- for (int i = 0; i < linesNumber; i++) {
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- }
- emptyLines = this.tempBuffer.toString();
- } else {
- emptyLines = getNewLineString(linesNumber);
- }
- this.lastNumberOfNewLines += linesNumber;
- this.line += linesNumber;
- this.column = 1;
- this.needSpace = false;
- this.pendingSpace = false;
- } else {
- if ((this.lastNumberOfNewLines - 1) >= linesNumber) {
- // there is no need to add new lines
- return Util.EMPTY_STRING;
- }
- final int realNewLineNumber = linesNumber - this.lastNumberOfNewLines + 1;
- if (this.indentEmptyLines) {
- this.tempBuffer.setLength(0);
- for (int i = 0; i < realNewLineNumber; i++) {
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- }
- emptyLines = this.tempBuffer.toString();
- } else {
- emptyLines = getNewLineString(realNewLineNumber);
- }
- this.lastNumberOfNewLines += realNewLineNumber;
- this.line += realNewLineNumber;
- this.column = 1;
- this.needSpace = false;
- this.pendingSpace = false;
- }
- return emptyLines;
- }
-
- public OptimizedReplaceEdit getLastEdit() {
- if (this.editsIndex > 0) {
- return this.edits[this.editsIndex - 1];
- }
- return null;
- }
-
- public final int getLineEnd(int lineNumber) {
- if (this.lineEnds == null)
- return -1;
- if (lineNumber >= this.lineEnds.length + 1)
- return this.scannerEndPosition;
- if (lineNumber <= 0)
- return -1;
- return this.lineEnds[lineNumber-1]; // next line start one character behind the lineEnd of the previous line
- }
-
- Alignment getMemberAlignment() {
- return this.memberAlignment;
- }
-
- public String getNewLine() {
- if (this.nlsTagCounter > 0) {
- return Util.EMPTY_STRING;
- }
- if (this.lastNumberOfNewLines >= 1) {
- this.column = 1; // ensure that the scribe is at the beginning of a new line
- return Util.EMPTY_STRING;
- }
- this.line++;
- this.lastNumberOfNewLines = 1;
- this.column = 1;
- this.needSpace = false;
- this.pendingSpace = false;
- return this.lineSeparator;
- }
-
- private String getNewLineString(int linesCount) {
- int length = this.newEmptyLines.length;
- if (linesCount > length) {
- System.arraycopy(this.newEmptyLines, 0, this.newEmptyLines = new String[linesCount+10], 0, length);
- }
- String newLineString = Util.EMPTY_STRING;
- if (linesCount > 0) {
- newLineString = this.newEmptyLines[linesCount-1];
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- for (int j=0; j<linesCount; j++) {
- this.tempBuffer.append(this.lineSeparator);
- }
- newLineString = this.tempBuffer.toString();
- this.newEmptyLines[linesCount-1] = newLineString;
- }
- }
- return newLineString;
- }
-
- /**
- * Answer next indentation level based on column estimated position
- * (if column is not indented, then use indentationLevel)
- */
- public int getNextIndentationLevel(int someColumn) {
- int indent = someColumn - 1;
- if (indent == 0)
- return this.indentationLevel;
- if (this.tabChar == DefaultCodeFormatterOptions.TAB) {
- if (this.useTabsOnlyForLeadingIndents) {
- return indent;
- }
- if (this.indentationSize == 0) {
- return indent;
- }
- int rem = indent % this.indentationSize;
- int addition = rem == 0 ? 0 : this.indentationSize - rem; // round to superior
- return indent + addition;
- }
- return indent;
- }
-
- /*
- * Preserve empty lines depending on given count and preferences.
- */
- private String getPreserveEmptyLines(int count, int emptyLinesRules) {
- if (count == 0) {
- int currentIndentationLevel = this.indentationLevel;
- int useAlignmentBreakIndentation = useAlignmentBreakIndentation(emptyLinesRules);
- switch (useAlignmentBreakIndentation) {
- case PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION:
- return Util.EMPTY_STRING;
- default:
- // Return the new indented line
- StringBuffer buffer = new StringBuffer(getNewLine());
- printIndentationIfNecessary(buffer);
- if (useAlignmentBreakIndentation == PRESERVE_EMPTY_LINES_USE_TEMPORARY_INDENTATION) {
- this.indentationLevel = currentIndentationLevel;
- }
- return buffer.toString();
- }
- }
- if (this.blank_lines_between_import_groups >= 0) {
- useAlignmentBreakIndentation(emptyLinesRules);
- return getEmptyLines(this.blank_lines_between_import_groups);
- }
- if (this.formatter.preferences.number_of_empty_lines_to_preserve != 0) {
- useAlignmentBreakIndentation(emptyLinesRules);
- int linesToPreserve = Math.min(count, this.formatter.preferences.number_of_empty_lines_to_preserve);
- return getEmptyLines(linesToPreserve);
- }
- return getNewLine();
- }
- private int useAlignmentBreakIndentation(int emptyLinesRules) {
- // preserve line breaks in wrapping if specified
- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=198074
- boolean specificEmptyLinesRule = emptyLinesRules != PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION;
- if ((this.currentAlignment != null || specificEmptyLinesRule) && !this.formatter.preferences.join_wrapped_lines) {
- // insert a new line only if it has not been already done before
- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=283476
- if (this.lastNumberOfNewLines == 0 || specificEmptyLinesRule || this.formatter.arrayInitializersDepth >= 0) {
-
- // Do not use alignment break indentation in specific circumstances
- boolean useAlignmentBreakIndentation;
- boolean useAlignmentShiftBreakIndentation = false;
- boolean useLastBinaryExpressionAlignmentBreakIndentation = false;
- switch (emptyLinesRules) {
- case DO_NOT_PRESERVE_EMPTY_LINES:
- case PRESERVE_EMPTY_LINES_IN_SWITCH_CASE:
- case PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION:
- case PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK:
- return PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION;
- case PRESERVE_EMPTY_LINES_IN_BINARY_EXPRESSION:
- useAlignmentBreakIndentation = true;
- if ((this.formatter.expressionsPos & CodeFormatterVisitor.EXPRESSIONS_POS_MASK) == CodeFormatterVisitor.EXPRESSIONS_POS_BETWEEN_TWO) {
- // we're just before the left expression, try to use the last
- // binary expression break indentation if any
- useLastBinaryExpressionAlignmentBreakIndentation = true;
- }
- break;
- case PRESERVE_EMPTY_LINES_IN_EQUALITY_EXPRESSION:
- useAlignmentShiftBreakIndentation = this.currentAlignment == null || this.currentAlignment.kind == Alignment.BINARY_EXPRESSION;
- useAlignmentBreakIndentation = !useAlignmentShiftBreakIndentation;
- break;
- case PRESERVE_EMPTY_LINES_IN_FORMAT_OPENING_BRACE:
- useAlignmentBreakIndentation = this.formatter.arrayInitializersDepth <= 1
- && this.currentAlignment != null
- && this.currentAlignment.kind == Alignment.ARRAY_INITIALIZER;
- break;
- case PRESERVE_EMPTY_LINES_IN_FORMAT_LEFT_CURLY_BRACE:
- useAlignmentBreakIndentation = false;
- break;
- default:
- if ((emptyLinesRules & 0xFFFF) == PRESERVE_EMPTY_LINES_IN_CLOSING_ARRAY_INITIALIZER && this.scanner.currentCharacter == '}' ) {
- // last array initializer closing brace
- this.indentationLevel = emptyLinesRules >> 16;
- this.preserveLineBreakIndentation = true;
- return PRESERVE_EMPTY_LINES_USE_CURRENT_INDENTATION;
- }
- useAlignmentBreakIndentation = true;
- break;
- }
-
- // If there's an alignment try to align on its break indentation level
- Alignment alignment = this.currentAlignment;
- if (alignment == null) {
- if (useLastBinaryExpressionAlignmentBreakIndentation) {
- if (this.indentationLevel < this.formatter.lastBinaryExpressionAlignmentBreakIndentation) {
- this.indentationLevel = this.formatter.lastBinaryExpressionAlignmentBreakIndentation;
- }
- }
- if (useAlignmentShiftBreakIndentation && this.memberAlignment != null) {
- if (this.indentationLevel < this.memberAlignment.shiftBreakIndentationLevel) {
- this.indentationLevel = this.memberAlignment.shiftBreakIndentationLevel;
- }
- }
- } else {
- // Use the member alignment break indentation level when
- // it's closer from the wrapped line than the current alignment
- if (this.memberAlignment != null && this.memberAlignment.location.inputOffset > alignment.location.inputOffset) {
- alignment = this.memberAlignment;
- }
-
- // Use the break indentation level if possible...
- if (useLastBinaryExpressionAlignmentBreakIndentation) {
- if (this.indentationLevel < this.formatter.lastBinaryExpressionAlignmentBreakIndentation) {
- this.indentationLevel = this.formatter.lastBinaryExpressionAlignmentBreakIndentation;
- }
- }
- if (useAlignmentBreakIndentation) {
- if (this.indentationLevel < alignment.breakIndentationLevel) {
- this.indentationLevel = alignment.breakIndentationLevel;
- }
- } else if (useAlignmentShiftBreakIndentation) {
- if (this.indentationLevel < alignment.shiftBreakIndentationLevel) {
- this.indentationLevel = alignment.shiftBreakIndentationLevel;
- }
- }
- }
- this.preserveLineBreakIndentation = true;
- if (useLastBinaryExpressionAlignmentBreakIndentation || useAlignmentShiftBreakIndentation) {
- return PRESERVE_EMPTY_LINES_USE_TEMPORARY_INDENTATION;
- }
- return PRESERVE_EMPTY_LINES_USE_CURRENT_INDENTATION;
- }
- }
- return PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION;
- }
-
- public TextEdit getRootEdit() {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=208541
- adaptRegions();
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=234583
- adaptEdits();
-
- MultiTextEdit edit = null;
- int regionsLength = this.adaptedRegions.length;
- int textRegionStart;
- int textRegionEnd;
- if (regionsLength == 1) {
- IRegion lastRegion = this.adaptedRegions[0];
- textRegionStart = lastRegion.getOffset();
- textRegionEnd = textRegionStart + lastRegion.getLength();
- } else {
- textRegionStart = this.adaptedRegions[0].getOffset();
- IRegion lastRegion = this.adaptedRegions[regionsLength - 1];
- textRegionEnd = lastRegion.getOffset() + lastRegion.getLength();
- }
-
- int length = textRegionEnd - textRegionStart + 1;
- if (textRegionStart <= 0) {
- if (length <= 0) {
- edit = new MultiTextEdit(0, 0);
- } else {
- edit = new MultiTextEdit(0, textRegionEnd);
- }
- } else {
- edit = new MultiTextEdit(textRegionStart, length - 1);
- }
- for (int i= 0, max = this.editsIndex; i < max; i++) {
- OptimizedReplaceEdit currentEdit = this.edits[i];
- if (currentEdit.offset >= 0 && currentEdit.offset <= this.scannerEndPosition) {
- if (currentEdit.length == 0 || (currentEdit.offset != this.scannerEndPosition && isMeaningfulEdit(currentEdit))) {
- try {
- edit.addChild(new ReplaceEdit(currentEdit.offset, currentEdit.length, currentEdit.replacement));
- }
- catch (MalformedTreeException ex) {
- // log exception in case of error
- CommentFormatterUtil.log(ex);
- throw ex;
- }
- }
- }
- }
- this.edits = null;
- return edit;
- }
-
- public void handleLineTooLong() {
- if (this.formatter.preferences.wrap_outer_expressions_when_nested) {
- handleLineTooLongSmartly();
- return;
- }
- // search for closest breakable alignment, using tiebreak rules
- // look for outermost breakable one
- int relativeDepth = 0, outerMostDepth = -1;
- Alignment targetAlignment = this.currentAlignment;
- while (targetAlignment != null){
- if (targetAlignment.tieBreakRule == Alignment.R_OUTERMOST && targetAlignment.couldBreak()){
- outerMostDepth = relativeDepth;
- }
- targetAlignment = targetAlignment.enclosing;
- relativeDepth++;
- }
- if (outerMostDepth >= 0) {
- throw new AlignmentException(AlignmentException.LINE_TOO_LONG, outerMostDepth);
- }
- // look for innermost breakable one
- relativeDepth = 0;
- targetAlignment = this.currentAlignment;
- while (targetAlignment != null){
- if (targetAlignment.couldBreak()){
- throw new AlignmentException(AlignmentException.LINE_TOO_LONG, relativeDepth);
- }
- targetAlignment = targetAlignment.enclosing;
- relativeDepth++;
- }
- // did not find any breakable location - proceed
- }
-
- private void handleLineTooLongSmartly() {
- // search for closest breakable alignment, using tiebreak rules
- // look for outermost breakable one
- int relativeDepth = 0, outerMostDepth = -1;
- Alignment targetAlignment = this.currentAlignment;
- int previousKind = -1;
- int insideMessage = 0;
- boolean insideStringConcat = false;
- while (targetAlignment != null){
- boolean couldBreak = targetAlignment.tieBreakRule == Alignment.R_OUTERMOST ||
- (!insideStringConcat &&
- insideMessage > 0 && targetAlignment.kind == Alignment.MESSAGE_ARGUMENTS &&
- (!targetAlignment.wasReset() || previousKind != Alignment.MESSAGE_SEND));
- if (couldBreak && targetAlignment.couldBreak()){
- outerMostDepth = relativeDepth;
- }
- switch (targetAlignment.kind) {
- case Alignment.MESSAGE_ARGUMENTS:
- case Alignment.MESSAGE_SEND:
- insideMessage++;
- break;
- case Alignment.STRING_CONCATENATION:
- insideStringConcat = true;
- break;
- }
- previousKind = targetAlignment.kind;
- targetAlignment = targetAlignment.enclosing;
- relativeDepth++;
- }
- if (outerMostDepth >= 0) {
- throw new AlignmentException(AlignmentException.LINE_TOO_LONG, outerMostDepth);
- }
- // look for innermost breakable one
- relativeDepth = 0;
- targetAlignment = this.currentAlignment;
- AlignmentException alignmentException = null;
- int msgArgsDepth = -1;
- while (targetAlignment != null) {
- if (targetAlignment.kind == Alignment.MESSAGE_ARGUMENTS) {
- msgArgsDepth = relativeDepth;
- }
- if (alignmentException == null) {
- if (targetAlignment.couldBreak()) {
- // do not throw the exception immediately to have a chance to reset
- // previously broken alignments (see bug 203588)
- alignmentException = new AlignmentException(AlignmentException.LINE_TOO_LONG, relativeDepth);
- if (insideStringConcat) throw alignmentException;
- }
- } else if (targetAlignment.wasSplit) {
- // reset the nearest already broken outermost alignment.
- // Note that it's not done twice to avoid infinite loop while raising
- // the exception on an innermost alignment...
- if (!targetAlignment.wasReset()) {
- targetAlignment.reset();
- if (msgArgsDepth > alignmentException.relativeDepth) {
- alignmentException.relativeDepth = msgArgsDepth;
- }
- throw alignmentException;
- }
- }
- targetAlignment = targetAlignment.enclosing;
- relativeDepth++;
- }
- if (alignmentException != null) {
- throw alignmentException;
- }
- // did not find any breakable location - proceed
- if (this.currentAlignment != null) {
- this.currentAlignment.blockAlign = false;
- this.currentAlignment.tooLong = true;
- }
- }
-
- /*
- * Check if there is a NLS tag on this line. If yes, return true, returns false otherwise.
- */
- private boolean hasNLSTag(int sourceStart) {
- // search the last comment where commentEnd < current lineEnd
- if (this.lineEnds == null) return false;
- int index = Arrays.binarySearch(this.lineEnds, sourceStart);
- int currentLineEnd = getLineEnd(-index);
- if (currentLineEnd != -1) {
- int commentIndex = getCommentIndex(currentLineEnd);
- if (commentIndex < 0) {
- commentIndex = -commentIndex - 2;
- }
- if (commentIndex >= 0 && commentIndex < this.commentPositions.length) {
- int start = this.commentPositions[commentIndex][0];
- if (start < 0) {
- start = -start;
- // check that we are on the same line
- int lineIndexForComment = Arrays.binarySearch(this.lineEnds, start);
- if (lineIndexForComment == index) {
- return CharOperation.indexOf(Scanner.TAG_PREFIX, this.scanner.source, true, start, currentLineEnd) != -1;
- }
- }
- }
- }
- return false;
- }
-
- private boolean includesBlockComments() {
- return ((this.formatComments & INCLUDE_BLOCK_COMMENTS) == INCLUDE_BLOCK_COMMENTS && this.headerEndPosition < this.scanner.currentPosition) ||
- (this.formatter.preferences.comment_format_header && this.headerEndPosition >= this.scanner.currentPosition);
- }
-
- private boolean includesJavadocComments() {
- return ((this.formatComments & INCLUDE_JAVA_DOC) == INCLUDE_JAVA_DOC && this.headerEndPosition < this.scanner.currentPosition) ||
- (this.formatter.preferences.comment_format_header && this.headerEndPosition >= this.scanner.currentPosition);
- }
-
- private boolean includesLineComments() {
- return ((this.formatComments & INCLUDE_LINE_COMMENTS) == INCLUDE_LINE_COMMENTS && this.headerEndPosition < this.scanner.currentPosition) ||
- (this.formatter.preferences.comment_format_header && this.headerEndPosition >= this.scanner.currentPosition);
- }
-
- boolean includesComments() {
- return (this.formatComments & CodeFormatter.F_INCLUDE_COMMENTS) != 0;
- }
-
- public void indent() {
- this.indentationLevel += this.indentationSize;
- this.numberOfIndentations++;
- }
-
- void setIndentation(int level, int n) {
- this.indentationLevel = level + n * this.indentationSize;
- this.numberOfIndentations = this.indentationLevel / this.indentationSize;
- }
-
- private void initializeScanner(long sourceLevel, DefaultCodeFormatterOptions preferences) {
- this.useTags = preferences.use_tags;
- this.tagsKind = 0;
- char[][] taskTags = null;
- if (this.useTags) {
- this.disablingTag = preferences.disabling_tag;
- this.enablingTag = preferences.enabling_tag;
- if (this.disablingTag == null) {
- if (this.enablingTag != null) {
- taskTags = new char[][] { this.enablingTag };
- }
- } else if (this.enablingTag == null) {
- taskTags = new char[][] { this.disablingTag };
- } else {
- taskTags = new char[][] { this.disablingTag, this.enablingTag };
- }
- }
- if (taskTags != null) {
- loop: for (int i=0,length=taskTags.length; i<length; i++) {
- if (taskTags[i].length > 2 && taskTags[i][0] == '/') {
- switch (taskTags[i][1]) {
- case '/':
- this.tagsKind = TerminalTokens.TokenNameCOMMENT_LINE;
- break loop;
- case '*':
- if (taskTags[i][2] != '*') {
- this.tagsKind = TerminalTokens.TokenNameCOMMENT_BLOCK;
- break loop;
- }
- break;
- }
- }
- }
- }
- this.scanner = new Scanner(true, true, false/*nls*/, sourceLevel/*sourceLevel*/, taskTags, null/*taskPriorities*/, true/*taskCaseSensitive*/);
- this.editsEnabled = true;
- }
-
- private void initFormatterCommentParser() {
- if (this.formatterCommentParser == null) {
- this.formatterCommentParser = new FormatterCommentParser(this.scanner.sourceLevel);
- }
- this.formatterCommentParser.scanner.setSource(this.scanner.source);
- this.formatterCommentParser.source = this.scanner.source;
- this.formatterCommentParser.scanner.lineEnds = this.lineEnds;
- this.formatterCommentParser.scanner.linePtr = this.maxLines;
- this.formatterCommentParser.parseHtmlTags = this.formatter.preferences.comment_format_html;
- }
-
- private boolean isOnFirstColumn(int start) {
- if (this.lineEnds == null) return start == 0;
- int index = Arrays.binarySearch(this.lineEnds, start);
- // we want the line end of the previous line
- int previousLineEnd = getLineEnd(-index - 1);
- return previousLineEnd != -1 && previousLineEnd == start - 1;
- }
-
- private boolean isMeaningfulEdit(OptimizedReplaceEdit edit) {
- final int editLength= edit.length;
- final int editReplacementLength= edit.replacement.length();
- final int editOffset= edit.offset;
- if (editReplacementLength != 0 && editLength == editReplacementLength) {
- for (int i = editOffset, max = editOffset + editLength; i < max; i++) {
- if (this.scanner.source[i] != edit.replacement.charAt(i - editOffset)) {
- return true;
- }
- }
- return false;
- }
- return true;
- }
-
- private void preserveEmptyLines(int count, int insertPosition) {
- if (count > 0) {
- if (this.blank_lines_between_import_groups >= 0) {
- printEmptyLines(this.blank_lines_between_import_groups, insertPosition);
- } else if (this.formatter.preferences.number_of_empty_lines_to_preserve != 0) {
- int linesToPreserve = Math.min(count, this.formatter.preferences.number_of_empty_lines_to_preserve);
- printEmptyLines(linesToPreserve, insertPosition);
- } else {
- printNewLine(insertPosition);
- }
- }
- }
-
- private void print(int length, boolean considerSpaceIfAny) {
- if (this.checkLineWrapping && length + this.column > this.pageWidth) {
- handleLineTooLong();
- }
- this.lastNumberOfNewLines = 0;
- if (this.indentationLevel != 0) {
- printIndentationIfNecessary();
- }
- if (considerSpaceIfAny) {
- space();
- }
- if (this.pendingSpace) {
- addInsertEdit(this.scanner.getCurrentTokenStartPosition(), " "); //$NON-NLS-1$
- }
- this.pendingSpace = false;
- this.column += length;
- this.needSpace = true;
- }
-
- private void printBlockComment(boolean isJavadoc) {
- int currentTokenStartPosition = this.scanner.getCurrentTokenStartPosition();
- int currentTokenEndPosition = this.scanner.getCurrentTokenEndPosition() + 1;
- boolean includesBlockComments = !isJavadoc && includesBlockComments();
-
- this.scanner.resetTo(currentTokenStartPosition, currentTokenEndPosition - 1);
- int currentCharacter;
- boolean isNewLine = false;
- int start = currentTokenStartPosition;
- int nextCharacterStart = currentTokenStartPosition;
- int previousStart = currentTokenStartPosition;
- boolean onFirstColumn = isOnFirstColumn(start);
-
- boolean indentComment = false;
- if (this.indentationLevel != 0) {
- if (isJavadoc
- || !this.formatter.preferences.never_indent_block_comments_on_first_column
- || !onFirstColumn) {
- indentComment = true;
- printIndentationIfNecessary();
- }
- }
- if (this.pendingSpace) {
- addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$
- }
- this.needSpace = false;
- this.pendingSpace = false;
-
- int commentColumn = this.column;
- if (includesBlockComments) {
- if (printBlockComment(currentTokenStartPosition, currentTokenEndPosition)) {
- return;
- }
- }
-
- int currentIndentationLevel = this.indentationLevel;
- if ((commentColumn-1) > this.indentationLevel) {
- this.indentationLevel = commentColumn-1;
- }
- int currentCommentIndentation = onFirstColumn ? 0 : getCurrentCommentIndentation(start);
- boolean formatComment = (isJavadoc && (this.formatComments & CodeFormatter.K_JAVA_DOC) != 0) || (!isJavadoc && (this.formatComments & CodeFormatter.K_MULTI_LINE_COMMENT) != 0);
-
- try {
- while (nextCharacterStart <= currentTokenEndPosition && (currentCharacter = this.scanner.getNextChar()) != -1) {
- nextCharacterStart = this.scanner.currentPosition;
-
- switch(currentCharacter) {
- case '\r' :
- start = previousStart;
- isNewLine = true;
- if (this.scanner.getNextChar('\n')) {
- currentCharacter = '\n';
- nextCharacterStart = this.scanner.currentPosition;
- }
- break;
- case '\n' :
- start = previousStart;
- isNewLine = true;
- nextCharacterStart = this.scanner.currentPosition;
- break;
- default:
- if (isNewLine) {
- this.column = 1;
- this.line++;
- isNewLine = false;
-
- boolean addSpace = false;
- if (onFirstColumn) {
- if (formatComment) {
- if (ScannerHelper.isWhitespace((char) currentCharacter)) {
- int previousStartPosition = this.scanner.currentPosition;
- while(currentCharacter != -1 && currentCharacter != '\r' && currentCharacter != '\n' && ScannerHelper.isWhitespace((char) currentCharacter)) {
- previousStart = nextCharacterStart;
- previousStartPosition = this.scanner.currentPosition;
- currentCharacter = this.scanner.getNextChar();
- nextCharacterStart = this.scanner.currentPosition;
- }
- if (currentCharacter == '\r' || currentCharacter == '\n') {
- nextCharacterStart = previousStartPosition;
- }
- }
- if (currentCharacter != '\r' && currentCharacter != '\n') {
- addSpace = true;
- }
- }
- } else {
- if (ScannerHelper.isWhitespace((char) currentCharacter)) {
- int previousStartPosition = this.scanner.currentPosition;
- int currentIndentation = 0;
- loop: while(currentCharacter != -1 && currentCharacter != '\r' && currentCharacter != '\n' && ScannerHelper.isWhitespace((char) currentCharacter)) {
- if (currentIndentation >= currentCommentIndentation) {
- break loop;
- }
- previousStart = nextCharacterStart;
- previousStartPosition = this.scanner.currentPosition;
- switch(currentCharacter) {
- case '\t' :
- if (this.tabLength != 0) {
- int reminder = currentIndentation % this.tabLength;
- if (reminder == 0) {
- currentIndentation += this.tabLength;
- } else {
- currentIndentation = ((currentIndentation / this.tabLength) + 1) * this.tabLength;
- }
- }
- break;
- default :
- currentIndentation ++;
- }
- currentCharacter = this.scanner.getNextChar();
- nextCharacterStart = this.scanner.currentPosition;
- }
- if (currentCharacter == '\r' || currentCharacter == '\n') {
- nextCharacterStart = previousStartPosition;
- }
- }
- if (formatComment) {
- int previousStartTemp = previousStart;
- int nextCharacterStartTemp = nextCharacterStart;
- while(currentCharacter != -1 && currentCharacter != '\r' && currentCharacter != '\n' && ScannerHelper.isWhitespace((char) currentCharacter)) {
- previousStart = nextCharacterStart;
- currentCharacter = this.scanner.getNextChar();
- nextCharacterStart = this.scanner.currentPosition;
- }
- if (currentCharacter == '*') {
- addSpace = true;
- } else {
- previousStart = previousStartTemp;
- nextCharacterStart = nextCharacterStartTemp;
- }
- this.scanner.currentPosition = nextCharacterStart;
- }
- }
- String replacement;
- if (indentComment) {
- this.tempBuffer.setLength(0);
- this.tempBuffer.append(this.lineSeparator);
- if (this.indentationLevel > 0) {
- printIndentationIfNecessary(this.tempBuffer);
- }
- if (addSpace) {
- this.tempBuffer.append(' ');
- }
- replacement = this.tempBuffer.toString();
- } else {
- replacement = addSpace ? this.lineSeparatorAndSpace : this.lineSeparator;
- }
- addReplaceEdit(start, previousStart - 1, replacement);
- } else {
- this.column += (nextCharacterStart - previousStart);
- }
- }
- previousStart = nextCharacterStart;
- this.scanner.currentPosition = nextCharacterStart;
- }
- } finally {
- this.indentationLevel = currentIndentationLevel;
- }
- this.lastNumberOfNewLines = 0;
- this.needSpace = false;
- this.scanner.resetTo(currentTokenEndPosition, this.scannerEndPosition - 1);
- }
-
- private boolean printBlockComment(int currentTokenStartPosition, int currentTokenEndPosition) {
-
- // Compute indentation
- int maxColumn = this.formatter.preferences.comment_line_length + 1;
- int indentLevel = this.indentationLevel;
- int indentations = this.numberOfIndentations;
- switch (this.tabChar) {
- case DefaultCodeFormatterOptions.TAB:
- switch (this.tabLength) {
- case 0:
- this.indentationLevel = 0;
- this.column = 1;
- this.numberOfIndentations = 0;
- break;
- case 1:
- this.indentationLevel = this.column - 1;
- this.numberOfIndentations = this.indentationLevel;
- break;
- default:
- this.indentationLevel = (this.column / this.tabLength) * this.tabLength;
- this.column = this.indentationLevel + 1;
- this.numberOfIndentations = this.indentationLevel / this.tabLength;
- }
- break;
- case DefaultCodeFormatterOptions.MIXED:
- if (this.tabLength == 0) {
- this.indentationLevel = 0;
- this.column = 1;
- this.numberOfIndentations = 0;
- } else {
- this.indentationLevel = this.column - 1;
- this.numberOfIndentations = this.indentationLevel / this.tabLength;
- }
- break;
- case DefaultCodeFormatterOptions.SPACE:
- if (this.indentationSize == 0) {
- this.indentationLevel = 0;
- this.column = 1;
- this.numberOfIndentations = 0;
- } else {
- this.indentationLevel = this.column - 1;
- }
- break;
- }
-
- // Consume the comment prefix
- this.blockCommentBuffer.setLength(0);
- this.scanner.getNextChar();
- this.scanner.getNextChar();
- this.column += 2;
- this.scanner.skipComments = true;
- this.blockCommentTokensBuffer.setLength(0);
- int editStart = this.scanner.currentPosition;
- int editEnd = -1;
-
- // Consume text token per token
- int previousToken = -1;
- boolean newLine = false;
- boolean multiLines = false;
- boolean hasMultiLines = false;
- boolean hasTokens = false;
- boolean bufferHasTokens = false;
- boolean bufferHasNewLine = false;
- boolean lineHasTokens = false;
- int hasTextOnFirstLine = 0;
- boolean firstWord = true;
- boolean clearBlankLines = this.formatter.preferences.comment_clear_blank_lines_in_block_comment;
- boolean joinLines = this.formatter.preferences.join_lines_in_comments;
- boolean newLinesAtBoundaries = this.formatter.preferences.comment_new_lines_at_block_boundaries;
- int scannerLine = Util.getLineNumber(this.scanner.currentPosition, this.lineEnds, 0, this.maxLines);
- int firstLine = scannerLine;
- int lineNumber = scannerLine;
- int lastTextLine = -1;
- while (!this.scanner.atEnd()) {
-
- // Consume token
- int token;
- try {
- token = this.scanner.getNextToken();
- } catch (InvalidInputException iie) {
- token = consumeInvalidToken(currentTokenEndPosition-1);
- newLine = false;
- }
-
- // Look at specific tokens
- boolean insertSpace = (previousToken == TerminalTokens.TokenNameWHITESPACE) && (!firstWord || !hasTokens);
- boolean isTokenStar = false;
- switch (token) {
- case TerminalTokens.TokenNameWHITESPACE:
- if (this.blockCommentTokensBuffer.length() > 0) {
- if (hasTextOnFirstLine == 1 && multiLines) {
- printBlockCommentHeaderLine(this.blockCommentBuffer);
- hasTextOnFirstLine = -1;
- }
- this.blockCommentBuffer.append(this.blockCommentTokensBuffer);
- this.column += this.blockCommentTokensBuffer.length();
- this.blockCommentTokensBuffer.setLength(0);
- bufferHasTokens = true;
- bufferHasNewLine = false;
- }
- if (previousToken == -1) {
- // do not remember the first whitespace
- previousToken = SKIP_FIRST_WHITESPACE_TOKEN;
- } else {
- previousToken = token;
- }
- lineNumber = Util.getLineNumber(this.scanner.currentPosition, this.lineEnds, scannerLine>1 ? scannerLine-2 : 0, this.maxLines);
- if (lineNumber > scannerLine) {
- hasMultiLines = true;
- newLine = true;
- }
- scannerLine = lineNumber;
- continue;
- case TerminalTokens.TokenNameMULTIPLY:
- isTokenStar = true;
- lineNumber = Util.getLineNumber(this.scanner.currentPosition, this.lineEnds, scannerLine>1 ? scannerLine-2 : 0, this.maxLines);
- if (lineNumber == firstLine && previousToken == SKIP_FIRST_WHITESPACE_TOKEN) {
- this.blockCommentBuffer.append(' ');
- }
- previousToken = token;
- if (this.scanner.currentCharacter == '/') {
- editEnd = this.scanner.startPosition - 1;
- // Add remaining buffered tokens
- if (this.blockCommentTokensBuffer.length() > 0) {
- this.blockCommentBuffer.append(this.blockCommentTokensBuffer);
- this.column += this.blockCommentTokensBuffer.length();
- }
- // end of comment
- if (newLinesAtBoundaries) {
- if (multiLines || hasMultiLines) {
- this.blockCommentBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.blockCommentBuffer);
- }
- }
- this.blockCommentBuffer.append(' ');
- this.column += BLOCK_FOOTER_LENGTH + 1;
- this.scanner.getNextChar(); // reach the end of scanner
- continue;
- }
- if (newLine) {
- scannerLine = lineNumber;
- newLine = false;
- continue;
- }
- break;
- case TerminalTokens.TokenNameMULTIPLY_EQUAL:
- if (newLine) {
- this.scanner.resetTo(this.scanner.startPosition, currentTokenEndPosition-1);
- this.scanner.getNextChar(); // consume the multiply
- previousToken = TerminalTokens.TokenNameMULTIPLY;
- scannerLine = Util.getLineNumber(this.scanner.currentPosition, this.lineEnds, scannerLine>1 ? scannerLine-2 : 0, this.maxLines);
- continue;
- }
- break;
- case TerminalTokens.TokenNameMINUS:
- case TerminalTokens.TokenNameMINUS_MINUS:
- if (previousToken == -1) {
- // Do not format comment starting with /*-
- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=230944
- this.indentationLevel = indentLevel;
- this.numberOfIndentations = indentations;
- this.lastNumberOfNewLines = 0;
- this.needSpace = false;
- this.scanner.skipComments = false;
- this.scanner.resetTo(currentTokenStartPosition, currentTokenEndPosition - 1);
- return false;
- }
- break;
- default:
- // do nothing
- break;
- }
-
- // Look at gap and insert corresponding lines if necessary
- int linesGap;
- int max;
- lineNumber = Util.getLineNumber(this.scanner.currentPosition, this.lineEnds, scannerLine>1 ? scannerLine-2 : 0, this.maxLines);
- if (lastTextLine == -1) {
- linesGap = newLinesAtBoundaries ? lineNumber - firstLine : 0;
- max = 0;
- } else {
- linesGap = lineNumber - lastTextLine;
- if (token == TerminalTokens.TokenNameAT && linesGap ==1) {
- // insert one blank line before root tags
- linesGap = 2;
- }
- max = joinLines && lineHasTokens ? 1 : 0;
- }
- if (linesGap > max) {
- if (clearBlankLines) {
- // TODO (frederic) see if there's a bug for the unremoved blank line for root tags
- if (token == TerminalTokens.TokenNameAT) {
- linesGap = 1;
- } else {
- linesGap = (max==0 || !joinLines) ? 1 : 0;
- }
- }
- for (int i=0; i<linesGap; i++) {
- // Add remaining buffered tokens
- if (this.blockCommentTokensBuffer.length() > 0) {
- if (hasTextOnFirstLine == 1) {
- printBlockCommentHeaderLine(this.blockCommentBuffer);
- hasTextOnFirstLine = -1;
- }
- this.blockCommentBuffer.append(this.blockCommentTokensBuffer);
- this.blockCommentTokensBuffer.setLength(0);
- bufferHasTokens = true;
- }
- this.blockCommentBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.blockCommentBuffer);
- this.blockCommentBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- firstWord = true;
- multiLines = true;
- bufferHasNewLine = true;
- }
- insertSpace = insertSpace && linesGap == 0;
- }
- if (newLine) lineHasTokens = false;
-
- // Increment column
- int tokenStart = this.scanner.getCurrentTokenStartPosition();
- int tokenLength = (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - tokenStart;
- hasTokens = true;
- if (!isTokenStar) lineHasTokens = true;
- if (hasTextOnFirstLine == 0 && !isTokenStar) {
- if (firstLine == lineNumber) {
- hasTextOnFirstLine = 1;
- this.column++; // include first space
- } else {
- hasTextOnFirstLine = -1;
- }
- }
- int lastColumn = this.column + this.blockCommentTokensBuffer.length() + tokenLength;
- if (insertSpace) lastColumn++;
-
- // Append next token inserting a new line if max line is reached
- if (lineHasTokens && !firstWord && lastColumn > maxColumn) {
- String tokensString = this.blockCommentTokensBuffer.toString().trim();
- int tokensStringLength = tokensString.length();
- // not enough space on the line
- if (hasTextOnFirstLine == 1) {
- printBlockCommentHeaderLine(this.blockCommentBuffer);
- }
- if ((this.indentationLevel+tokensStringLength+tokenLength) > maxColumn) {
- // there won't be enough room even if we break the line before the buffered tokens
- // So add the buffered tokens now
- this.blockCommentBuffer.append(this.blockCommentTokensBuffer);
- this.column += this.blockCommentTokensBuffer.length();
- this.blockCommentTokensBuffer.setLength(0);
- bufferHasNewLine = false;
- bufferHasTokens = true;
- }
- if (bufferHasTokens && !bufferHasNewLine) {
- this.blockCommentBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.blockCommentBuffer);
- this.blockCommentBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- }
- if (this.blockCommentTokensBuffer.length() > 0) {
- this.blockCommentBuffer.append(tokensString);
- this.column += tokensStringLength;
- this.blockCommentTokensBuffer.setLength(0);
- }
- this.blockCommentBuffer.append(this.scanner.source, tokenStart, tokenLength);
- bufferHasTokens = true;
- bufferHasNewLine = false;
- this.column += tokenLength;
- multiLines = true;
- hasTextOnFirstLine = -1;
- } else {
- // append token to the line
- if (insertSpace) {
- this.blockCommentTokensBuffer.append(' ');
- }
- this.blockCommentTokensBuffer.append(this.scanner.source, tokenStart, tokenLength);
- }
- previousToken = token;
- newLine = false;
- firstWord = false;
- scannerLine = lineNumber;
- lastTextLine = lineNumber;
- }
-
- // Replace block comment text
- if (this.nlsTagCounter == 0 || !multiLines) {
- if (hasTokens || multiLines) {
- StringBuffer replacement;
- if (hasTextOnFirstLine == 1) {
- this.blockCommentTokensBuffer.setLength(0);
- replacement = this.blockCommentTokensBuffer;
- if ((hasMultiLines || multiLines)) {
- int col = this.column;
- replacement.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(replacement);
- replacement.append(BLOCK_LINE_PREFIX);
- this.column = col;
- } else if (this.blockCommentBuffer.length()==0 || this.blockCommentBuffer.charAt(0)!=' ') {
- replacement.append(' ');
- }
- replacement.append(this.blockCommentBuffer);
- } else {
- replacement = this.blockCommentBuffer;
- }
- addReplaceEdit(editStart, editEnd, replacement.toString());
- }
- }
-
- // Reset
- this.indentationLevel = indentLevel;
- this.numberOfIndentations = indentations;
- this.lastNumberOfNewLines = 0;
- this.needSpace = false;
- this.scanner.resetTo(currentTokenEndPosition, this.scannerEndPosition - 1);
- this.scanner.skipComments = false;
- return true;
- }
-
- private void printBlockCommentHeaderLine(StringBuffer buffer) {
- if (!this.formatter.preferences.comment_new_lines_at_block_boundaries) {
- buffer.insert(0, ' ');
- this.column++;
- }
- else if (buffer.length() == 0) {
- buffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(buffer);
- buffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- } else {
- this.tempBuffer.setLength(0);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- buffer.insert(0, this.tempBuffer.toString());
- }
- }
-
- public void printEndOfCompilationUnit() {
- try {
- // if we have a space between two tokens we ensure it will be dumped in the formatted string
- int currentTokenStartPosition = this.scanner.currentPosition;
- boolean hasComment = false;
- boolean hasLineComment = false;
- boolean hasWhitespace = false;
- int count = 0;
- while (true) {
- this.currentToken = this.scanner.getNextToken();
- switch(this.currentToken) {
- case TerminalTokens.TokenNameWHITESPACE :
- char[] whiteSpaces = this.scanner.getCurrentTokenSource();
- count = 0;
- for (int i = 0, max = whiteSpaces.length; i < max; i++) {
- switch(whiteSpaces[i]) {
- case '\r' :
- if ((i + 1) < max) {
- if (whiteSpaces[i + 1] == '\n') {
- i++;
- }
- }
- count++;
- break;
- case '\n' :
- count++;
- }
- }
- if (count == 0) {
- hasWhitespace = true;
- addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
- } else if (hasLineComment) {
- preserveEmptyLines(count, this.scanner.getCurrentTokenStartPosition());
- addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
- } else if (hasComment) {
- if (count == 1) {
- this.printNewLine(this.scanner.getCurrentTokenStartPosition());
- } else {
- preserveEmptyLines(count - 1, this.scanner.getCurrentTokenStartPosition());
- }
- addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
- } else {
- addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
- }
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameCOMMENT_LINE :
- if (count >= 1) {
- if (count > 1) {
- preserveEmptyLines(count - 1, this.scanner.getCurrentTokenStartPosition());
- } else if (count == 1) {
- printNewLine(this.scanner.getCurrentTokenStartPosition());
- }
- } else if (hasWhitespace) {
- space();
- }
- hasWhitespace = false;
- printLineComment();
- currentTokenStartPosition = this.scanner.currentPosition;
- hasLineComment = true;
- count = 0;
- break;
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- if (count >= 1) {
- if (count > 1) {
- preserveEmptyLines(count - 1, this.scanner.getCurrentTokenStartPosition());
- } else if (count == 1) {
- printNewLine(this.scanner.getCurrentTokenStartPosition());
- }
- } else if (hasWhitespace) {
- space();
- }
- hasWhitespace = false;
- printBlockComment(false);
- currentTokenStartPosition = this.scanner.currentPosition;
- hasLineComment = false;
- hasComment = true;
- count = 0;
- break;
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- if (count >= 1) {
- if (count > 1) {
- preserveEmptyLines(count - 1, this.scanner.startPosition);
- } else if (count == 1) {
- printNewLine(this.scanner.startPosition);
- }
- } else if (hasWhitespace) {
- space();
- }
- hasWhitespace = false;
- if (includesJavadocComments()) {
- printJavadocComment(this.scanner.startPosition, this.scanner.currentPosition);
- } else {
- printBlockComment(true);
- }
- printNewLine();
- currentTokenStartPosition = this.scanner.currentPosition;
- hasLineComment = false;
- hasComment = true;
- count = 0;
- break;
- case TerminalTokens.TokenNameSEMICOLON :
- print(this.scanner.currentPosition - this.scanner.startPosition, this.formatter.preferences.insert_space_before_semicolon);
- break;
- case TerminalTokens.TokenNameEOF :
- if (count >= 1 || this.formatter.preferences.insert_new_line_at_end_of_file_if_missing) {
- this.printNewLine(this.scannerEndPosition);
- }
- return;
- default :
- // step back one token
- this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
- return;
- }
- }
- } catch (InvalidInputException e) {
- throw new AbortFormatting(e);
- }
- }
-
- /*
- * prints a code snippet
- */
- private void printCodeSnippet(int startPosition, int endPosition, int linesGap) {
- String snippet = new String(this.scanner.source, startPosition, endPosition - startPosition + 1);
-
- // 1 - strip content prefix (@see JavaDocRegion#preprocessCodeSnippet)
- int firstLine = Util.getLineNumber(startPosition, this.lineEnds, 0, this.maxLines) - 1;
- int lastLine = Util.getLineNumber(endPosition, this.lineEnds, firstLine>1 ? firstLine-2 : 0, this.maxLines) - 1;
- this.codeSnippetBuffer.setLength(0);
- if (firstLine == lastLine && linesGap == 0) {
- this.codeSnippetBuffer.append(snippet);
- } else {
- boolean hasCharsAfterStar = false;
- if (linesGap == 0) {
- this.codeSnippetBuffer.append(this.scanner.source, startPosition, this.lineEnds[firstLine]+1-startPosition);
- firstLine++;
- }
- int initialLength = this.codeSnippetBuffer.length();
- for (int currentLine=firstLine; currentLine<=lastLine; currentLine++) {
- this.scanner.resetTo(this.lineEnds[currentLine-1]+1, this.lineEnds[currentLine]);
- int lineStart = this.scanner.currentPosition;
- boolean hasStar = false;
- loop: while (!this.scanner.atEnd()) {
- char ch = (char) this.scanner.getNextChar();
- switch (ch) {
- case ' ':
- case '\t' :
- case '\u000c' :
- break;
- case '\r' :
- case '\n' :
- break loop;
- case '*':
- hasStar = true;
- break loop;
- default:
- if (ScannerHelper.isWhitespace(ch)) {
- break;
- }
- break loop;
- }
- }
- if (hasStar) {
- lineStart = this.scanner.currentPosition;
- if (!hasCharsAfterStar && !this.scanner.atEnd()) {
- char ch = (char) this.scanner.getNextChar();
- boolean atEnd = this.scanner.atEnd();
- switch (ch) {
- case ' ':
- case '\t' :
- case '\u000c' :
- break;
- case '\r' :
- case '\n' :
- atEnd = true;
- break;
- default:
- if (!ScannerHelper.isWhitespace(ch)) {
- if (hasStar) {
- // A non whitespace character is just after the star
- // then we need to restart from the beginning without
- // consuming the space after the star
- hasCharsAfterStar = true;
- currentLine = firstLine-1;
- this.codeSnippetBuffer.setLength(initialLength);
- continue;
- }
- }
- break;
- }
- if (!hasCharsAfterStar && !atEnd) {
- // Until then, there's always a whitespace after each star
- // of the comment, hence we need to consume it as it will
- // be rewritten while reindenting the snippet lines
- lineStart = this.scanner.currentPosition;
- }
- }
- }
- int end = currentLine == lastLine ? endPosition : this.lineEnds[currentLine];
- this.codeSnippetBuffer.append(this.scanner.source, lineStart, end+1-lineStart);
- }
- }
-
- // 2 - convert HTML to Java (@see JavaDocRegion#convertHtml2Java)
- HTMLEntity2JavaReader reader= new HTMLEntity2JavaReader(new StringReader(this.codeSnippetBuffer.toString()));
- char[] buf= new char[this.codeSnippetBuffer.length()]; // html2text never gets longer, only shorter!
- String convertedSnippet;
- try {
- int read= reader.read(buf);
- convertedSnippet = new String(buf, 0, read);
- reader.close();
- } catch (IOException e) {
- // should not happen
- CommentFormatterUtil.log(e);
- return;
- }
-
- // 3 - format snippet (@see JavaDocRegion#formatCodeSnippet)
- // include comments in case of line comments are present in the snippet
- String formattedSnippet = convertedSnippet;
- Map options = this.formatter.preferences.getMap();
- if (this.scanner.sourceLevel > ClassFileConstants.JDK1_3) {
- options.put(JavaCore.COMPILER_SOURCE, CompilerOptions.versionFromJdkLevel(this.scanner.sourceLevel));
- }
- TextEdit edit= CommentFormatterUtil.format2(CodeFormatter.K_UNKNOWN | CodeFormatter.F_INCLUDE_COMMENTS, convertedSnippet, 0, this.lineSeparator, options);
- if (edit == null) {
- // 3.a - not a valid code to format, keep initial buffer
- formattedSnippet = this.codeSnippetBuffer.toString();
- } else {
- // 3.b - valid code formatted
- // 3.b.i - get the result
- formattedSnippet = CommentFormatterUtil.evaluateFormatterEdit(convertedSnippet, edit, null);
-
- // 3.b.ii- convert back to HTML (@see JavaDocRegion#convertJava2Html)
- Java2HTMLEntityReader javaReader= new Java2HTMLEntityReader(new StringReader(formattedSnippet));
- buf= new char[256];
- this.codeSnippetBuffer.setLength(0);
- int l;
- try {
- do {
- l= javaReader.read(buf);
- if (l != -1)
- this.codeSnippetBuffer.append(buf, 0, l);
- } while (l > 0);
- formattedSnippet = this.codeSnippetBuffer.toString();
- javaReader.close();
- } catch (IOException e) {
- // should not happen
- CommentFormatterUtil.log(e);
- return;
- }
- }
-
- // 4 - add the content prefix (@see JavaDocRegion#postprocessCodeSnippet)
- this.codeSnippetBuffer.setLength(0);
- ILineTracker tracker = new DefaultLineTracker();
- this.column = 1;
- printIndentationIfNecessary(this.codeSnippetBuffer); // append indentation
- this.codeSnippetBuffer.append(BLOCK_LINE_PREFIX);
- String linePrefix = this.codeSnippetBuffer.toString();
- this.codeSnippetBuffer.setLength(0);
- String replacement = formattedSnippet;
- tracker.set(formattedSnippet);
- int numberOfLines = tracker.getNumberOfLines();
- if (numberOfLines > 1) {
- int lastLineOffset = -1;
- for (int i=0; i<numberOfLines-1; i++) {
- if (i>0) this.codeSnippetBuffer.append(linePrefix);
- try {
- lastLineOffset = tracker.getLineOffset(i+1);
- this.codeSnippetBuffer.append(formattedSnippet.substring(tracker.getLineOffset(i), lastLineOffset));
- } catch (BadLocationException e) {
- // should not happen
- CommentFormatterUtil.log(e);
- return;
- }
- }
- this.codeSnippetBuffer.append(linePrefix);
- this.codeSnippetBuffer.append(formattedSnippet.substring(lastLineOffset));
- replacement = this.codeSnippetBuffer.toString();
- }
-
- // 5 - replace old text with the formatted snippet
- addReplaceEdit(startPosition, endPosition, replacement);
- }
-
- void printComment() {
- printComment(CodeFormatter.K_UNKNOWN, NO_TRAILING_COMMENT, PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION);
- }
-
- void printComment(int emptyLinesRules) {
- printComment(CodeFormatter.K_UNKNOWN, NO_TRAILING_COMMENT, emptyLinesRules);
- }
-
- void printComment(int kind, int trailing) {
- printComment(kind, trailing, PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION);
- }
-
- /*
- * Main method to print and format comments (javadoc, block and single line comments)
- */
- void printComment(int kind, int trailing, int emptyLinesRules) {
- final boolean rejectLineComment = kind == CodeFormatter.K_MULTI_LINE_COMMENT || kind == CodeFormatter.K_JAVA_DOC;
- final boolean rejectBlockComment = kind == CodeFormatter.K_SINGLE_LINE_COMMENT || kind == CodeFormatter.K_JAVA_DOC;
- final boolean rejectJavadocComment = kind == CodeFormatter.K_SINGLE_LINE_COMMENT || kind == CodeFormatter.K_MULTI_LINE_COMMENT;
- try {
- // if we have a space between two tokens we ensure it will be dumped in the formatted string
- int currentTokenStartPosition = this.scanner.currentPosition;
- boolean hasComment = false;
- boolean hasLineComment = false;
- boolean hasWhitespaces = false;
- int lines = 0;
- while ((this.currentToken = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- int foundTaskCount = this.scanner.foundTaskCount;
- int tokenStartPosition = this.scanner.getCurrentTokenStartPosition();
- switch(this.currentToken) {
- case TerminalTokens.TokenNameWHITESPACE :
- char[] whiteSpaces = this.scanner.getCurrentTokenSource();
- int whitespacesEndPosition = this.scanner.getCurrentTokenEndPosition();
- lines = 0;
- for (int i = 0, max = whiteSpaces.length; i < max; i++) {
- switch(whiteSpaces[i]) {
- case '\r' :
- if ((i + 1) < max) {
- if (whiteSpaces[i + 1] == '\n') {
- i++;
- }
- }
- lines++;
- break;
- case '\n' :
- lines++;
- }
- }
- // If following token is a line comment on the same line or the line just after,
- // then it might be not really formatted as a trailing comment
- boolean realTrailing = trailing > NO_TRAILING_COMMENT;
- if (realTrailing && this.scanner.currentCharacter == '/' && (lines == 0 || (lines == 1 && !hasLineComment && trailing == IMPORT_TRAILING_COMMENT))) {
- // sometimes changing the trailing may not be the best idea
- // for complex trailing comment, it's basically a good idea
- boolean canChangeTrailing = (trailing & COMPLEX_TRAILING_COMMENT) != 0;
- // for basic trailing comment preceded by a line comment, then it depends on the comments relative position
- // when following comment column (after having been rounded) is below the preceding one,
- // then it becomes not a good idea to change the trailing flag
- if (trailing == BASIC_TRAILING_COMMENT && hasLineComment) {
- int currentCommentIndentation = getCurrentIndentation(whiteSpaces, 0);
- int relativeIndentation = currentCommentIndentation - this.lastLineComment.currentIndentation;
- if (this.tabLength == 0) {
- canChangeTrailing = relativeIndentation == 0;
- } else {
- canChangeTrailing = relativeIndentation > -this.tabLength;
- }
- }
- // if the trailing can be change, then look at the following tokens
- if (canChangeTrailing) {
- int currentPosition = this.scanner.currentPosition;
- if (this.scanner.getNextToken() == TerminalTokens.TokenNameCOMMENT_LINE) {
- realTrailing = !hasLineComment;
- switch (this.scanner.getNextToken()) {
- case TerminalTokens.TokenNameCOMMENT_LINE:
- // at least two contiguous line comments
- // the formatter should not consider comments as trailing ones
- realTrailing = false;
- break;
- case TerminalTokens.TokenNameWHITESPACE:
- if (this.scanner.getNextToken() == TerminalTokens.TokenNameCOMMENT_LINE) {
- // at least two contiguous line comments
- // the formatter should not consider comments as trailing ones
- realTrailing = false;
- }
- break;
- }
- }
- this.scanner.resetTo(currentPosition, this.scanner.eofPosition - 1);
- }
- }
- // Look whether comments line may be contiguous or not
- // Note that when preceding token is a comment line, then only one line
- // is enough to have an empty line as the line end is included in the comment line...
- // If comments are contiguous, store the white spaces to be able to compute the current comment indentation
- if (lines > 1 || (lines == 1 && hasLineComment)) {
- this.lastLineComment.contiguous = false;
- }
- this.lastLineComment.leadingSpaces = whiteSpaces;
- this.lastLineComment.lines = lines;
- // Strategy to consume spaces and eventually leave at this stage
- // depends on the fact that a trailing comment is expected or not
- if (realTrailing) {
- // if a line comment is consumed, no other comment can be on the same line after
- if (hasLineComment) {
- if (lines >= 1) {
- currentTokenStartPosition = tokenStartPosition;
- preserveEmptyLines(lines, currentTokenStartPosition);
- addDeleteEdit(currentTokenStartPosition, whitespacesEndPosition);
- this.scanner.resetTo(this.scanner.currentPosition, this.scannerEndPosition - 1);
- return;
- }
- this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
- return;
- }
- // if one or several new lines are consumed, following comments cannot be considered as trailing ones
- if (lines >= 1) {
- if (hasComment) {
- this.printNewLine(tokenStartPosition);
- }
- this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
- return;
- }
- // delete consumed white spaces
- hasWhitespaces = true;
- currentTokenStartPosition = this.scanner.currentPosition;
- addDeleteEdit(tokenStartPosition, whitespacesEndPosition);
- } else {
- if (lines == 0) {
- hasWhitespaces = true;
- if (hasLineComment && emptyLinesRules != PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION) {
- addReplaceEdit(tokenStartPosition, whitespacesEndPosition, getPreserveEmptyLines(0, emptyLinesRules));
- } else {
- addDeleteEdit(tokenStartPosition, whitespacesEndPosition);
- }
- } else if (hasLineComment) {
- useAlignmentBreakIndentation(emptyLinesRules);
- currentTokenStartPosition = tokenStartPosition;
- preserveEmptyLines(lines, currentTokenStartPosition);
- addDeleteEdit(currentTokenStartPosition, whitespacesEndPosition);
- } else if (hasComment) {
- useAlignmentBreakIndentation(emptyLinesRules);
- if (lines == 1) {
- this.printNewLine(tokenStartPosition);
- } else {
- preserveEmptyLines(lines - 1, tokenStartPosition);
- }
- addDeleteEdit(tokenStartPosition, whitespacesEndPosition);
- } else if (lines != 0 && (!this.formatter.preferences.join_wrapped_lines || this.formatter.preferences.number_of_empty_lines_to_preserve != 0 || this.blank_lines_between_import_groups > 0)) {
- addReplaceEdit(tokenStartPosition, whitespacesEndPosition, getPreserveEmptyLines(lines-1, emptyLinesRules));
- } else {
- useAlignmentBreakIndentation(emptyLinesRules);
- addDeleteEdit(tokenStartPosition, whitespacesEndPosition);
- }
- }
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameCOMMENT_LINE :
- if (this.useTags && this.editsEnabled) {
- boolean turnOff = false;
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- turnOff = true;
- } else if (this.tagsKind == this.currentToken
- && CharOperation.fragmentEquals(this.disablingTag, this.scanner.source, tokenStartPosition, true)) {
- this.editsEnabled = false;
- turnOff = true;
- }
- if (turnOff) {
- if (!this.editsEnabled && this.editsIndex > 1) {
- OptimizedReplaceEdit currentEdit = this.edits[this.editsIndex-1];
- if (this.scanner.startPosition == currentEdit.offset+currentEdit.length) {
- printNewLinesBeforeDisablingComment();
- }
- }
- }
- }
- if (rejectLineComment) break;
- if (lines >= 1) {
- if (lines > 1) {
- preserveEmptyLines(lines - 1, this.scanner.getCurrentTokenStartPosition());
- } else if (lines == 1) {
- printNewLine(this.scanner.getCurrentTokenStartPosition());
- }
- } else if (hasWhitespaces) {
- space();
- }
- hasWhitespaces = false;
- printLineComment();
- currentTokenStartPosition = this.scanner.currentPosition;
- hasLineComment = true;
- lines = 0;
- if (this.useTags && !this.editsEnabled) {
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- } else if (this.tagsKind == this.currentToken) {
- this.editsEnabled = CharOperation.fragmentEquals(this.enablingTag, this.scanner.source, tokenStartPosition, true);
- }
- }
- break;
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- if (this.useTags && this.editsEnabled) {
- boolean turnOff = false;
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- turnOff = true;
- } else if (this.tagsKind == this.currentToken
- && CharOperation.fragmentEquals(this.disablingTag, this.scanner.source, tokenStartPosition, true)) {
- this.editsEnabled = false;
- turnOff = true;
- }
- if (turnOff) {
- if (!this.editsEnabled && this.editsIndex > 1) {
- OptimizedReplaceEdit currentEdit = this.edits[this.editsIndex-1];
- if (this.scanner.startPosition == currentEdit.offset+currentEdit.length) {
- printNewLinesBeforeDisablingComment();
- }
- }
- }
- }
- if (trailing > NO_TRAILING_COMMENT && lines >= 1) {
- // a block comment on next line means that there's no trailing comment
- this.scanner.resetTo(this.scanner.getCurrentTokenStartPosition(), this.scannerEndPosition - 1);
- return;
- }
- this.lastLineComment.contiguous = false;
- if (rejectBlockComment) break;
- if (lines >= 1) {
- if (lines > 1) {
- preserveEmptyLines(lines - 1, this.scanner.getCurrentTokenStartPosition());
- } else if (lines == 1) {
- printNewLine(this.scanner.getCurrentTokenStartPosition());
- }
- } else if (hasWhitespaces) {
- space();
- }
- hasWhitespaces = false;
- printBlockComment(false);
- currentTokenStartPosition = this.scanner.currentPosition;
- hasLineComment = false;
- hasComment = true;
- lines = 0;
- if (this.useTags && !this.editsEnabled) {
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- } else if (this.tagsKind == this.currentToken) {
- this.editsEnabled = CharOperation.fragmentEquals(this.enablingTag, this.scanner.source, tokenStartPosition, true);
- }
- }
- break;
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- if (this.useTags && this.editsEnabled && foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- if (!this.editsEnabled && this.editsIndex > 1) {
- OptimizedReplaceEdit currentEdit = this.edits[this.editsIndex-1];
- if (this.scanner.startPosition == currentEdit.offset+currentEdit.length) {
- printNewLinesBeforeDisablingComment();
- }
- }
- }
- if (trailing > NO_TRAILING_COMMENT) {
- // a javadoc comment should not be considered as a trailing comment
- this.scanner.resetTo(this.scanner.getCurrentTokenStartPosition(), this.scannerEndPosition - 1);
- return;
- }
- this.lastLineComment.contiguous = false;
- if (rejectJavadocComment) break;
- if (lines >= 1) {
- if (lines > 1) {
- preserveEmptyLines(lines - 1, this.scanner.getCurrentTokenStartPosition());
- } else if (lines == 1) {
- printNewLine(this.scanner.getCurrentTokenStartPosition());
- }
- } else if (hasWhitespaces) {
- space();
- }
- hasWhitespaces = false;
- if (includesJavadocComments()) {
- printJavadocComment(this.scanner.startPosition, this.scanner.currentPosition);
- } else {
- printBlockComment(true);
- }
- if (this.useTags && !this.editsEnabled && foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- }
- printNewLine();
- currentTokenStartPosition = this.scanner.currentPosition;
- hasLineComment = false;
- hasComment = true;
- lines = 0;
- break;
- default :
- this.lastLineComment.contiguous = false;
- // step back one token
- this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
- return;
- }
- }
- } catch (InvalidInputException e) {
- throw new AbortFormatting(e);
- }
- }
-
- void printComment(int kind, String source, int start, int end, int level) {
-
- // Set scanner
- resetScanner(source.toCharArray());
- this.scanner.resetTo(start, end);
- // Put back 3.4RC2 code => comment following line as it has an impact on Linux tests
- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234336
- // TODO (frederic) Need more investigations and a better fix in
- // isAdaptableRegion(int) and adaptRegions()
- // this.scannerEndPosition = end;
-
- // Set indentation level
- this.numberOfIndentations = level;
- this.indentationLevel = level * this.indentationSize;
- this.column = this.indentationLevel + 1;
-
- // Print corresponding comment
- switch (kind) {
- case CodeFormatter.K_SINGLE_LINE_COMMENT:
- printComment(kind, NO_TRAILING_COMMENT);
- break;
- case CodeFormatter.K_MULTI_LINE_COMMENT:
- printComment(kind, NO_TRAILING_COMMENT);
- break;
- case CodeFormatter.K_JAVA_DOC:
- printJavadocComment(start, end);
- break;
- }
- }
-
- private void printLineComment() {
- int currentTokenStartPosition = this.scanner.getCurrentTokenStartPosition();
- int currentTokenEndPosition = this.scanner.getCurrentTokenEndPosition() + 1;
- boolean includesLineComments = includesLineComments();
- boolean isNlsTag = false;
- if (CharOperation.indexOf(Scanner.TAG_PREFIX, this.scanner.source, true, currentTokenStartPosition, currentTokenEndPosition) != -1) {
- this.nlsTagCounter = 0;
- isNlsTag = true;
- }
- this.scanner.resetTo(currentTokenStartPosition, currentTokenEndPosition - 1);
- int currentCharacter;
- int start = currentTokenStartPosition;
- int nextCharacterStart = currentTokenStartPosition;
-
- // Print comment line indentation
- int commentIndentationLevel;
- boolean onFirstColumn = isOnFirstColumn(start);
- if (this.indentationLevel == 0) {
- commentIndentationLevel = this.column - 1;
- } else {
- if (onFirstColumn &&
- ((includesLineComments && !this.formatter.preferences.comment_format_line_comment_starting_on_first_column) ||
- this.formatter.preferences.never_indent_line_comments_on_first_column)
- ) {
- commentIndentationLevel = this.column - 1;
- } else {
- // Indentation may be specific for contiguous comment
- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=293300
- if (this.lastLineComment.contiguous) {
- // The leading spaces have been set while looping in the printComment(int) method
- int currentCommentIndentation = getCurrentIndentation(this.lastLineComment.leadingSpaces, 0);
- // Keep the current comment indentation when over the previous contiguous line comment
- // and the previous comment has not been reindented
- int relativeIndentation = currentCommentIndentation - this.lastLineComment.currentIndentation;
- boolean similarCommentsIndentation = false;
- if (this.tabLength == 0) {
- similarCommentsIndentation = relativeIndentation == 0;
- } else if (relativeIndentation > -this.tabLength) {
- similarCommentsIndentation = relativeIndentation == 0 || currentCommentIndentation != 0 && this.lastLineComment.currentIndentation != 0;
- }
- if (similarCommentsIndentation && this.lastLineComment.indentation != this.indentationLevel) {
- int currentIndentationLevel = this.indentationLevel;
- this.indentationLevel = this.lastLineComment.indentation ;
- printIndentationIfNecessary();
- this.indentationLevel = currentIndentationLevel;
- commentIndentationLevel = this.lastLineComment.indentation ;
- } else {
- printIndentationIfNecessary();
- commentIndentationLevel = this.column - 1;
- }
- } else {
- if (this.currentAlignment != null && this.currentAlignment.kind == Alignment.ARRAY_INITIALIZER &&
- this.currentAlignment.fragmentCount > 0 &&
- this.indentationLevel < this.currentAlignment.breakIndentationLevel &&
- this.lastLineComment.lines > 0)
- {
- int currentIndentationLevel = this.indentationLevel;
- this.indentationLevel = this.currentAlignment.breakIndentationLevel;
- printIndentationIfNecessary();
- this.indentationLevel = currentIndentationLevel;
- commentIndentationLevel = this.currentAlignment.breakIndentationLevel;
- } else {
- printIndentationIfNecessary();
- commentIndentationLevel = this.column - 1;
- }
- }
- }
- }
-
- // Store line comment information
- this.lastLineComment.contiguous = true;
- this.lastLineComment.currentIndentation = getCurrentCommentIndentation(currentTokenStartPosition);
- this.lastLineComment.indentation = commentIndentationLevel;
-
- // Add pending space if necessary
- if (this.pendingSpace) {
- if (this.formatter.preferences.comment_preserve_white_space_between_code_and_line_comments) {
- addInsertEdit(currentTokenStartPosition, new String(this.lastLineComment.leadingSpaces));
- } else {
- addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$
- }
- }
- this.needSpace = false;
- this.pendingSpace = false;
- int previousStart = currentTokenStartPosition;
-
- if (!isNlsTag && includesLineComments && (!onFirstColumn || this.formatter.preferences.comment_format_line_comment_starting_on_first_column)) {
- printLineComment(currentTokenStartPosition, currentTokenEndPosition-1);
- } else {
- // do nothing!?
- loop: while (nextCharacterStart <= currentTokenEndPosition && (currentCharacter = this.scanner.getNextChar()) != -1) {
- nextCharacterStart = this.scanner.currentPosition;
-
- switch(currentCharacter) {
- case '\r' :
- start = previousStart;
- break loop;
- case '\n' :
- start = previousStart;
- break loop;
- }
- previousStart = nextCharacterStart;
- }
- if (start != currentTokenStartPosition) {
- // this means that the line comment doesn't end the file
- addReplaceEdit(start, currentTokenEndPosition - 1, this.lineSeparator);
- this.line++;
- this.column = 1;
- this.lastNumberOfNewLines = 1;
- }
- }
- this.needSpace = false;
- this.pendingSpace = false;
- // realign to the proper value
- if (this.currentAlignment != null) {
- if (this.memberAlignment != null) {
- // select the last alignment
- if (this.currentAlignment.location.inputOffset > this.memberAlignment.location.inputOffset) {
- if (this.currentAlignment.couldBreak() && this.currentAlignment.wasSplit) {
- this.currentAlignment.performFragmentEffect();
- }
- } else {
- this.indentationLevel = Math.max(this.indentationLevel, this.memberAlignment.breakIndentationLevel);
- }
- } else if (this.currentAlignment.couldBreak() && this.currentAlignment.wasSplit) {
- this.currentAlignment.performFragmentEffect();
- }
- if (this.currentAlignment.kind == Alignment.BINARY_EXPRESSION &&
- this.currentAlignment.enclosing != null &&
- this.currentAlignment.enclosing.kind == Alignment.BINARY_EXPRESSION &&
- this.indentationLevel < this.currentAlignment.breakIndentationLevel)
- {
- this.indentationLevel = this.currentAlignment.breakIndentationLevel;
- }
- }
- this.scanner.resetTo(currentTokenEndPosition, this.scannerEndPosition - 1);
- }
-
- private void printLineComment(int commentStart, int commentEnd) {
-
- // Compute indentation
- int firstColumn = this.column;
- int indentLevel = this.indentationLevel;
- int indentations = this.numberOfIndentations;
- this.indentationLevel = getNextIndentationLevel(firstColumn);
- if (this.indentationSize != 0) {
- this.numberOfIndentations = this.indentationLevel / this.indentationSize;
- }
- else{
- this.numberOfIndentations = 0;
- }
-
- // Consume the comment prefix
- this.scanner.resetTo(commentStart, commentEnd);
- this.scanner.getNextChar();
- this.scanner.getNextChar();
- this.column += 2;
-
- // Scan the text token per token to compact it and size it the max line length
- int maxColumn = this.formatter.preferences.comment_line_length + 1;
- int previousToken = -1;
- int lastTokenEndPosition = commentStart;
- int spaceStartPosition = -1;
- int spaceEndPosition = -1;
- this.scanner.skipComments = true;
- String newLineString = null;
- this.commentIndentation = null;
-
- // Consume text token per token
- while (!this.scanner.atEnd()) {
- int token;
- try {
- token = this.scanner.getNextToken();
- } catch (InvalidInputException iie) {
- token = consumeInvalidToken(commentEnd);
- }
- switch (token) {
- case TerminalTokens.TokenNameWHITESPACE:
- if (previousToken == -1) {
- // do not remember the first whitespace
- previousToken = SKIP_FIRST_WHITESPACE_TOKEN;
- } else {
- previousToken = token;
- }
- // Remember space position
- spaceStartPosition = this.scanner.getCurrentTokenStartPosition();
- spaceEndPosition = this.scanner.getCurrentTokenEndPosition();
- continue;
- case TerminalTokens.TokenNameEOF:
- continue;
- case TerminalTokens.TokenNameIdentifier:
- if (previousToken == -1 || previousToken == SKIP_FIRST_WHITESPACE_TOKEN) {
- char[] identifier = this.scanner.getCurrentTokenSource();
- int startPosition = this.scanner.getCurrentTokenStartPosition();
- int restartPosition = this.scanner.currentPosition;
- if (CharOperation.equals(identifier, Parser.FALL_THROUGH_TAG, 0, 5/*length of string "$FALL"*/) && this.scanner.currentCharacter == '-') {
- try {
- this.scanner.getNextToken(); // consume the '-'
- token = this.scanner.getNextToken(); // consume the "THROUGH"
- if (token == TerminalTokens.TokenNameIdentifier) {
- identifier = this.scanner.getCurrentTokenSource();
- if (CharOperation.endsWith(Parser.FALL_THROUGH_TAG, identifier)) {
- // the comment starts with a fall through
- if (previousToken == SKIP_FIRST_WHITESPACE_TOKEN) {
- addReplaceEdit(spaceStartPosition, startPosition-1, " "); //$NON-NLS-1$
- }
- this.scanner.startPosition = startPosition;
- previousToken = token;
- break;
- }
- }
- } catch (InvalidInputException iie) {
- // skip
- }
- }
- // this was not a valid fall-through tag, hence continue to process the comment normally
- this.scanner.startPosition = startPosition;
- this.scanner.currentPosition = restartPosition;
- }
- break;
- }
- int tokenStart = this.scanner.getCurrentTokenStartPosition();
- int tokenLength = (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - tokenStart;
-
- // insert space at the beginning if not present
- if (previousToken == -1 ) {
- addInsertEdit(this.scanner.startPosition, " "); //$NON-NLS-1$
- this.column++;
- }
- // replace space at the beginning if present
- else if (previousToken == SKIP_FIRST_WHITESPACE_TOKEN) {
- addReplaceEdit(spaceStartPosition, this.scanner.startPosition-1, " "); //$NON-NLS-1$
- this.column++;
- spaceStartPosition = -1; // do not use this position to split the comment
- } else {
- // not on the first token
- boolean insertSpace = previousToken == TerminalTokens.TokenNameWHITESPACE;
- if (insertSpace) {
- // count inserted space if any in token length
- tokenLength++;
- }
- // insert new line if max line width is reached and a space was previously encountered
- if (spaceStartPosition > 0 && (this.column+tokenLength) > maxColumn) {
- this.lastNumberOfNewLines++;
- this.line++;
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- if (!this.formatter.preferences.never_indent_line_comments_on_first_column) {
- printIndentationIfNecessary(this.tempBuffer);
- }
- this.tempBuffer.append(LINE_COMMENT_PREFIX);
- this.column += LINE_COMMENT_PREFIX_LENGTH;
- newLineString = this.tempBuffer.toString();
- firstColumn = this.column;
- } else {
- this.column = firstColumn;
- }
- if (lastTokenEndPosition > spaceEndPosition) {
- this.column += lastTokenEndPosition - (spaceEndPosition + 1); // add all previous tokens lengths since last space
- }
- if (this.edits[this.editsIndex-1].offset == spaceStartPosition) {
- // previous space was already edited, so remove it
- this.editsIndex--;
- }
- addReplaceEdit(spaceStartPosition, spaceEndPosition, newLineString);
- spaceStartPosition = -1;
- if (insertSpace) {
- tokenLength--; // reduce token length as the space will be replaced by the new line
- }
- }
- // replace space if needed
- else if (insertSpace) {
- addReplaceEdit(spaceStartPosition, this.scanner.startPosition-1, " "); //$NON-NLS-1$
- }
- }
- // update column position and store info of the current token
- this.column += tokenLength;
- previousToken = token;
- lastTokenEndPosition = this.scanner.currentPosition;
- }
- this.scanner.skipComments = false;
-
- // Skip separator if the comment is not at the end of file
- this.indentationLevel = indentLevel;
- this.numberOfIndentations = indentations;
- this.lastNumberOfNewLines = 0;
- this.scanner.resetTo(lastTokenEndPosition, commentEnd);
- while (!this.scanner.atEnd()) {
- spaceEndPosition = this.scanner.currentPosition;
- this.scanner.getNextChar();
- if (this.scanner.currentCharacter == '\n' || this.scanner.currentCharacter == '\r') {
- // line comment is normally ended with new line
- this.column = 1;
- this.line++;
- this.lastNumberOfNewLines++;
- break;
- }
- }
-
- // Replace the line separator at the end of the comment if any...
- int startReplace = previousToken == SKIP_FIRST_WHITESPACE_TOKEN ? spaceStartPosition : lastTokenEndPosition;
- if (this.column == 1 && commentEnd >= startReplace) {
- addReplaceEdit(startReplace, commentEnd, this.formatter.preferences.line_separator);
- }
- }
-
- public void printEmptyLines(int linesNumber) {
- this.printEmptyLines(linesNumber, this.scanner.getCurrentTokenEndPosition() + 1);
- }
-
- private void printEmptyLines(int linesNumber, int insertPosition) {
- final String buffer = getEmptyLines(linesNumber);
- if (Util.EMPTY_STRING == buffer) return;
- addInsertEdit(insertPosition, buffer);
- }
-
- void printIndentationIfNecessary() {
- this.tempBuffer.setLength(0);
- printIndentationIfNecessary(this.tempBuffer);
- if (this.tempBuffer.length() > 0) {
- addInsertEdit(this.scanner.getCurrentTokenStartPosition(), this.tempBuffer.toString());
- this.pendingSpace = false;
- }
- }
-
- private void printIndentationIfNecessary(StringBuffer buffer) {
- switch(this.tabChar) {
- case DefaultCodeFormatterOptions.TAB :
- boolean useTabsForLeadingIndents = this.useTabsOnlyForLeadingIndents;
- int numberOfLeadingIndents = this.numberOfIndentations;
- int indentationsAsTab = 0;
- if (useTabsForLeadingIndents) {
- while (this.column <= this.indentationLevel) {
- if (this.tabLength > 0 && indentationsAsTab < numberOfLeadingIndents) {
- if (buffer != null) buffer.append('\t');
- indentationsAsTab++;
- int complement = this.tabLength - ((this.column - 1) % this.tabLength); // amount of space
- this.column += complement;
- } else {
- if (buffer != null) buffer.append(' ');
- this.column++;
- }
- this.needSpace = false;
- }
- } else if (this.tabLength > 0) {
- while (this.column <= this.indentationLevel) {
- if (buffer != null) buffer.append('\t');
- int complement = this.tabLength - ((this.column - 1) % this.tabLength); // amount of space
- this.column += complement;
- this.needSpace = false;
- }
- }
- break;
- case DefaultCodeFormatterOptions.SPACE :
- while (this.column <= this.indentationLevel) {
- if (buffer != null) buffer.append(' ');
- this.column++;
- this.needSpace = false;
- }
- break;
- case DefaultCodeFormatterOptions.MIXED :
- useTabsForLeadingIndents = this.useTabsOnlyForLeadingIndents;
- numberOfLeadingIndents = this.numberOfIndentations;
- indentationsAsTab = 0;
- if (useTabsForLeadingIndents) {
- final int columnForLeadingIndents = numberOfLeadingIndents * this.indentationSize;
- while (this.column <= this.indentationLevel) {
- if (this.column <= columnForLeadingIndents) {
- if (this.tabLength > 0 && (this.column - 1 + this.tabLength) <= this.indentationLevel) {
- if (buffer != null) buffer.append('\t');
- this.column += this.tabLength;
- } else if ((this.column - 1 + this.indentationSize) <= this.indentationLevel) {
- // print one indentation
- // note that this.indentationSize > 0 when entering in the following loop
- // hence this.column will be incremented and then avoid endless loop (see bug 290905)
- for (int i = 0, max = this.indentationSize; i < max; i++) {
- if (buffer != null) buffer.append(' ');
- this.column++;
- }
- } else {
- if (buffer != null) buffer.append(' ');
- this.column++;
- }
- } else {
- for (int i = this.column, max = this.indentationLevel; i <= max; i++) {
- if (buffer != null) buffer.append(' ');
- this.column++;
- }
- }
- this.needSpace = false;
- }
- } else {
- while (this.column <= this.indentationLevel) {
- if (this.tabLength > 0 && (this.column - 1 + this.tabLength) <= this.indentationLevel) {
- if (buffer != null) buffer.append('\t');
- this.column += this.tabLength;
- } else if (this.indentationSize > 0 && (this.column - 1 + this.indentationSize) <= this.indentationLevel) {
- // print one indentation
- for (int i = 0, max = this.indentationSize; i < max; i++) {
- if (buffer != null) buffer.append(' ');
- this.column++;
- }
- } else {
- if (buffer != null) buffer.append(' ');
- this.column++;
- }
- this.needSpace = false;
- }
- }
- break;
- }
- }
-
- private void printJavadocBlock(FormatJavadocBlock block) {
- if( block == null) return;
-
- // Init positions
- int previousEnd = block.tagEnd;
- int maxNodes = block.nodesPtr;
-
- // Compute indentation
- boolean headerLine = block.isHeaderLine() && this.lastNumberOfNewLines == 0;
- int maxColumn = this.formatter.preferences.comment_line_length + 1;
- if (headerLine) {
- maxColumn++;
- }
-
- // format tag section if necessary
- if (!block.isInlined()) {
- this.lastNumberOfNewLines = 0;
- }
- if (block.isDescription()) {
- if (!block.isInlined()) {
- this.commentIndentation = null;
- }
- } else {
- int tagLength = previousEnd - block.sourceStart + 1;
- this.column += tagLength;
- if (!block.isInlined()) {
- boolean indentRootTags = this.formatter.preferences.comment_indent_root_tags && !block.isInDescription();
- int commentIndentationLevel = 0;
- if (indentRootTags) {
- commentIndentationLevel = tagLength + 1;
- boolean indentParamTag = this.formatter.preferences.comment_indent_parameter_description && block.isInParamTag();
- if (indentParamTag) {
- commentIndentationLevel += this.indentationSize;
- }
- }
- setCommentIndentation(commentIndentationLevel);
- }
- FormatJavadocReference reference= block.reference;
- if (reference != null) {
- // format reference
- printJavadocBlockReference(block, reference);
- previousEnd = reference.sourceEnd;
- }
-
- // Nothing else to do if the tag has no node
- if (maxNodes < 0) {
- if (block.isInlined()) {
- this.column++;
- }
- return;
- }
- }
-
- // tag section: iterate through the blocks composing this tag but the last one
- int previousLine = Util.getLineNumber(previousEnd, this.lineEnds, 0, this.maxLines);
- boolean clearBlankLines = this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment;
- boolean joinLines = this.formatter.preferences.join_lines_in_comments;
- for (int i=0; i<=maxNodes; i++) {
- FormatJavadocNode node = block.nodes[i];
- int nodeStart = node.sourceStart;
-
- // Print empty lines before the node
- int newLines;
- if (i == 0) {
- newLines = this.formatter.preferences.comment_insert_new_line_for_parameter && block.isParamTag() ? 1 : 0;
- if (nodeStart > (previousEnd+1)) {
- if (!clearBlankLines || !joinLines) {
- int startLine = Util.getLineNumber(nodeStart, this.lineEnds, previousLine-1, this.maxLines);
- int gapLine = previousLine;
- if (joinLines) gapLine++; // if not preserving line break then gap must be at least of one line
- if (startLine > gapLine) {
- newLines = startLine - previousLine;
- }
- if (clearBlankLines) {
- // clearing blank lines in this block means that break lines should be preserved, hence only keep one new line
- if (newLines > 0) newLines = 1;
- }
- }
- if (newLines == 0 && (!node.isImmutable() || block.reference != null)) {
- newLines = printJavadocBlockNodesNewLines(block, node, previousEnd);
- }
- if (block.isImmutable()) {
- printJavadocGapLinesForImmutableBlock(block);
- } else {
- printJavadocGapLines(previousEnd+1, nodeStart-1, newLines, clearBlankLines, false, null);
- }
- } else {
- this.tempBuffer.setLength(0);
- if (newLines > 0) {
- for (int j=0; j<newLines; j++) {
- printJavadocNewLine(this.tempBuffer);
- }
- addInsertEdit(nodeStart, this.tempBuffer.toString());
- }
- }
- } else {
- newLines = this.column > maxColumn ? 1 : 0;
- if (!clearBlankLines && node.lineStart > (previousLine+1)) newLines = node.lineStart - previousLine;
- if (newLines < node.linesBefore) newLines = node.linesBefore;
- if (newLines == 0) {
- newLines = printJavadocBlockNodesNewLines(block, node, previousEnd);
- }
- if (newLines > 0 || nodeStart > (previousEnd+1)) {
- printJavadocGapLines(previousEnd+1, nodeStart-1, newLines, clearBlankLines, false, null);
- }
- }
- if (headerLine && newLines > 0) {
- headerLine = false;
- maxColumn--;
- }
-
- // Print node
- if (node.isText()) {
- FormatJavadocText text = (FormatJavadocText) node;
- if (text.isImmutable()) {
- // Indent if new line was added
- if (text.isImmutableHtmlTag() && newLines > 0 && this.commentIndentation != null) {
- addInsertEdit(node.sourceStart, this.commentIndentation);
- this.column += this.commentIndentation.length();
- }
- printJavadocImmutableText(text, block, newLines > 0);
- this.column += getTextLength(block, text);
- } else if (text.isHtmlTag()) {
- printJavadocHtmlTag(text, block, newLines>0);
- } else {
- printJavadocText(text, block, newLines>0);
- }
- } else {
- if (newLines > 0 && this.commentIndentation != null) {
- addInsertEdit(node.sourceStart, this.commentIndentation);
- this.column += this.commentIndentation.length();
- }
- printJavadocBlock((FormatJavadocBlock)node);
- }
-
- // Print empty lines before the node
- previousEnd = node.sourceEnd;
- previousLine = Util.getLineNumber(previousEnd, this.lineEnds, node.lineStart > 1 ? node.lineStart-2 : 0, this.maxLines);
- }
- this.lastNumberOfNewLines = 0;
- }
-
- private int printJavadocBlockNodesNewLines(FormatJavadocBlock block, FormatJavadocNode node, int previousEnd) {
- int maxColumn = this.formatter.preferences.comment_line_length+1;
- int nodeStart = node.sourceStart;
- try {
- this.scanner.resetTo(nodeStart , node.sourceEnd);
- int length = 0;
- boolean newLine = false;
- boolean headerLine = block.isHeaderLine() && this.lastNumberOfNewLines == 0;
- int firstColumn = 1 + this.indentationLevel + BLOCK_LINE_PREFIX_LENGTH;
- if (this.commentIndentation != null) firstColumn += this.commentIndentation.length();
- if (headerLine) maxColumn++;
- FormatJavadocText text = null;
- boolean isImmutableNode = node.isImmutable();
- boolean nodeIsText = node.isText();
- if (nodeIsText) {
- text = (FormatJavadocText)node;
- } else {
- FormatJavadocBlock inlinedBlock = (FormatJavadocBlock)node;
- if (isImmutableNode) {
- text = (FormatJavadocText) inlinedBlock.getLastNode();
- if (text != null) {
- length += inlinedBlock.tagEnd - inlinedBlock.sourceStart + 1; // tag length
- if (nodeStart > (previousEnd+1)) {
- length++; // include space between nodes
- }
- this.scanner.resetTo(text.sourceStart , node.sourceEnd);
- }
- }
- }
- if (text != null) {
- if (isImmutableNode) {
- if (nodeStart > (previousEnd+1)) {
- length++; // include space between nodes
- }
- int lastColumn = this.column + length;
- while (!this.scanner.atEnd()) {
- try {
- int token = this.scanner.getNextToken();
- switch (token) {
- case TerminalTokens.TokenNameWHITESPACE:
- if (CharOperation.indexOf('\n', this.scanner.source, this.scanner.startPosition, this.scanner.currentPosition) >= 0) {
- return 0;
- }
- lastColumn = getCurrentIndentation(this.scanner.getCurrentTokenSource(), lastColumn);
- break;
- case TerminalTokens.TokenNameMULTIPLY:
- if (newLine) {
- newLine = false;
- continue;
- }
- lastColumn++;
- break;
- default:
- lastColumn += (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- break;
- }
- }
- catch (InvalidInputException iie) {
- // maybe an unterminated string or comment
- lastColumn += (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- }
- if (lastColumn > maxColumn) {
- return 1;
- }
- }
- return 0;
- }
- if (text.isHtmlTag()) {
- if (text.getHtmlTagID() == JAVADOC_SINGLE_BREAK_TAG_ID) {
- // never break before single break tag
- return 0;
- }
- // read the html tag
- this.scanner.getNextToken();
- if (this.scanner.getNextToken() == TerminalTokens.TokenNameDIVIDE) {
- length++;
- this.scanner.getNextToken();
- }
- length += (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- this.scanner.getNextToken(); // '>'
- length++;
- } else {
- while (true) {
- int token = this.scanner.getNextToken();
- if (token == TerminalTokens.TokenNameWHITESPACE || token == TerminalTokens.TokenNameEOF) break;
- int tokenLength = (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- length += tokenLength;
- if ((this.column + length) >= maxColumn) {
- break;
- }
- }
- }
- } else {
- FormatJavadocBlock inlinedBlock = (FormatJavadocBlock) node;
- length += inlinedBlock.tagEnd - inlinedBlock.sourceStart + 1; // tag length
- if (inlinedBlock.reference != null) {
- length++; // space between tag and reference
- this.scanner.resetTo(inlinedBlock.reference.sourceStart, inlinedBlock.reference.sourceEnd);
- int previousToken = -1;
- loop: while (!this.scanner.atEnd()) {
- int token = this.scanner.getNextToken();
- int tokenLength = (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- switch (token) {
- case TerminalTokens.TokenNameWHITESPACE:
- if (previousToken == TerminalTokens.TokenNameCOMMA) { // space between method arguments
- length++;
- }
- break;
- case TerminalTokens.TokenNameMULTIPLY:
- break;
- default:
- length += tokenLength;
- if ((this.column+length) > maxColumn) {
- break loop;
- }
- break;
- }
- previousToken = token;
- }
- }
- length++; // one more for closing brace
- }
- if (nodeStart > (previousEnd+1)) {
- length++; // include space between nodes
- }
- if ((firstColumn + length) >= maxColumn && node == block.nodes[0]) {
- // Do not split in this peculiar case as length would be also over the max
- // length on next line
- return 0;
- }
- if ((this.column + length) > maxColumn) {
- return 1;
- }
- } catch (InvalidInputException iie) {
- // Assume length is one
- int tokenLength = 1;
- if (nodeStart > (previousEnd+1)) {
- tokenLength++; // include space between nodes
- }
- if ((this.column + tokenLength) > maxColumn) {
- return 1;
- }
- }
- return 0;
- }
-
- private void printJavadocBlockReference(FormatJavadocBlock block, FormatJavadocReference reference) {
- int maxColumn = this.formatter.preferences.comment_line_length + 1;
- boolean headerLine = block.isHeaderLine();
- boolean inlined = block.isInlined();
- if (headerLine) maxColumn++;
-
- // First we need to know what is the indentation
- this.scanner.resetTo(block.tagEnd+1, reference.sourceEnd);
- this.javadocBlockRefBuffer.setLength(0);
- boolean needFormat = false;
- int previousToken = -1;
- int spacePosition = -1;
- String newLineString = null;
- int firstColumn = -1;
- while (!this.scanner.atEnd()) {
- int token;
- try {
- token = this.scanner.getNextToken();
- int tokenLength = (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- switch (token) {
- case TerminalTokens.TokenNameWHITESPACE:
- if (previousToken != -1 || tokenLength > 1 || this.scanner.currentCharacter != ' ') needFormat = true;
- switch (previousToken) {
- case TerminalTokens.TokenNameMULTIPLY :
- case TerminalTokens.TokenNameLPAREN:
- break;
- default: // space between method arguments
- spacePosition = this.javadocBlockRefBuffer.length();
- // $FALL-THROUGH$ - fall through next case
- case -1:
- this.javadocBlockRefBuffer.append(' ');
- this.column++;
- break;
- }
- break;
- case TerminalTokens.TokenNameMULTIPLY:
- break;
- default:
- if (!inlined && spacePosition > 0 && (this.column+tokenLength) > maxColumn) {
- // not enough space on the line
- this.lastNumberOfNewLines++;
- this.line++;
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- if (this.commentIndentation != null) {
- this.tempBuffer.append(this.commentIndentation);
- this.column += this.commentIndentation.length();
- }
- newLineString = this.tempBuffer.substring(0, this.tempBuffer.length()-1); // remove last space as buffer will be inserted before a space
- firstColumn = this.column;
- } else {
- this.column = firstColumn;
- }
- this.column = firstColumn + this.javadocBlockRefBuffer.length() - spacePosition - 1;
- this.javadocBlockRefBuffer.insert(spacePosition, newLineString);
- if (headerLine) {
- headerLine = false;
- maxColumn--;
- }
- spacePosition = -1;
- }
- this.javadocBlockRefBuffer.append(this.scanner.source, this.scanner.startPosition, tokenLength);
- this.column += tokenLength;
- break;
- }
- previousToken = token;
- } catch (InvalidInputException iie) {
- // does not happen as syntax is correct
- }
- }
- if (needFormat) {
- addReplaceEdit(block.tagEnd+1, reference.sourceEnd, this.javadocBlockRefBuffer.toString());
- }
- }
-
- private int getTextLength(FormatJavadocBlock block, FormatJavadocText text) {
-
- // Special case for immutable tags
- if (text.isImmutable()) {
- this.scanner.resetTo(text.sourceStart , text.sourceEnd);
- int textLength = 0;
- while (!this.scanner.atEnd()) {
- try {
- int token = this.scanner.getNextToken();
- if (token == TerminalTokens.TokenNameWHITESPACE) {
- if (CharOperation.indexOf('\n', this.scanner.source, this.scanner.startPosition, this.scanner.currentPosition) >= 0) {
- textLength = 0;
- this.scanner.getNextChar();
- if (this.scanner.currentCharacter == '*') {
- this.scanner.getNextChar();
- if (this.scanner.currentCharacter != ' ') {
- textLength++;
- }
- } else {
- textLength++;
- }
- continue;
- }
- }
- textLength += (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- } catch (InvalidInputException e) {
- // maybe an unterminated string or comment
- textLength += (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - this.scanner.startPosition;
- }
- }
- return textLength;
- }
-
- // Simple for one line tags
- if (block.isOneLineTag()) {
- return text.sourceEnd - text.sourceStart + 1;
- }
-
- // Find last line
- int startLine = Util.getLineNumber(text.sourceStart, this.lineEnds, 0, this.maxLines);
- int endLine = startLine;
- int previousEnd = -1;
- for (int i=0; i<=text.separatorsPtr; i++) {
- int end = (int) (text.separators[i] >>> 32);
- endLine = Util.getLineNumber(end, this.lineEnds, endLine-1, this.maxLines);
- if (endLine > startLine) {
- return previousEnd - text.sourceStart + 1;
- }
- previousEnd = end;
- }
-
- // This was a one line text
- return text.sourceEnd - text.sourceStart + 1;
- }
-
- /*
- * Print and formats a javadoc comments
- */
- void printJavadocComment(int start, int end) {
- int lastIndentationLevel = this.indentationLevel;
- try {
- // parse the comment on the fly
- this.scanner.resetTo(start, end-1);
- if (! this.formatterCommentParser.parse(start, end-1)) {
- // problem occurred while parsing the javadoc, early abort formatting
- return;
- }
-
- FormatJavadoc javadoc = (FormatJavadoc) this.formatterCommentParser.docComment;
-
- // handle indentation
- if (this.indentationLevel != 0) {
- printIndentationIfNecessary();
- }
-
- // handle pending space if any
- if (this.pendingSpace) {
- addInsertEdit(start, " "); //$NON-NLS-1$
- }
-
- if (javadoc.blocks == null) {
- // no FormatJavadocTags in this this javadoc
- return;
- }
-
- // init properly
- this.needSpace = false;
- this.pendingSpace = false;
- int length = javadoc.blocks.length;
-
- // format empty lines between before the first block
- FormatJavadocBlock previousBlock = javadoc.blocks[0];
- this.lastNumberOfNewLines = 0;
- int currentLine = this.line;
- int firstBlockStart = previousBlock.sourceStart;
- printIndentationIfNecessary(null);
- this.column += JAVADOC_HEADER_LENGTH; // consider that the header is already scanned
-
- // If there are several blocks in the javadoc
- int index = 1;
- if (length > 1) {
- // format the description if any
- if (previousBlock.isDescription()) {
- printJavadocBlock(previousBlock);
- FormatJavadocBlock block = javadoc.blocks[index++];
- int newLines = this.formatter.preferences.comment_insert_empty_line_before_root_tags ? 2 : 1;
- printJavadocGapLines(previousBlock.sourceEnd+1, block.sourceStart-1, newLines, this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment, false, null);
- previousBlock = block;
- }
-
- // format all tags but the last one composing this comment
- while (index < length) {
- printJavadocBlock(previousBlock);
- FormatJavadocBlock block = javadoc.blocks[index++];
- printJavadocGapLines(previousBlock.sourceEnd+1, block.sourceStart-1, 1, this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment, false, null);
- previousBlock = block;
- }
- }
-
- // format the last block
- printJavadocBlock(previousBlock);
-
- // format the header and footer empty spaces
- int newLines = (this.formatter.preferences.comment_new_lines_at_javadoc_boundaries && (this.line > currentLine || javadoc.isMultiLine())) ? 1 : 0;
- printJavadocGapLines(javadoc.textStart, firstBlockStart-1, newLines, this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment, false, null);
- printJavadocGapLines(previousBlock.sourceEnd+1, javadoc.textEnd, newLines, this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment, true, null);
- }
- finally {
- // reset the scanner
- this.scanner.resetTo(end, this.scannerEndPosition - 1);
- this.needSpace = false;
- this.indentationLevel = lastIndentationLevel;
- this.lastNumberOfNewLines = 0;
- }
- }
-
- /*
- * prints the empty javadoc line between the 2 given positions.
- * May insert new '*' before each new line
- */
- private void printJavadocGapLines(int textStartPosition, int textEndPosition, int newLines, boolean clearBlankLines, boolean footer, StringBuffer output) {
- try {
- // If no lines to set in the gap then just insert a space if there's enough room to
- if (newLines == 0) {
- if (output == null) {
- addReplaceEdit(textStartPosition, textEndPosition, " "); //$NON-NLS-1$
- } else {
- output.append(' ');
- }
- this.column++;
- return;
- }
-
- // if there's no enough room to replace text, then insert the gap
- if (textStartPosition > textEndPosition) {
- if (newLines > 0) {
- this.javadocGapLinesBuffer.setLength(0);
- for (int i=0; i<newLines; i++) {
- this.javadocGapLinesBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.javadocGapLinesBuffer);
- if (footer) {
- this.javadocGapLinesBuffer.append(' ');
- this.column++;
- } else {
- this.javadocGapLinesBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- }
- }
- if (output == null) {
- addInsertEdit(textStartPosition, this.javadocGapLinesBuffer.toString());
- } else {
- output.append(this.javadocGapLinesBuffer);
- }
- }
- return;
- }
-
- // There's enough room and some lines to set...
- // Skip the text token per token to keep existing stars when possible
- this.scanner.resetTo(textStartPosition, textEndPosition);
- this.scanner.recordLineSeparator = true;
- this.scanner.linePtr = Util.getLineNumber(textStartPosition, this.lineEnds, 0, this.maxLines) - 2;
- int linePtr = this.scanner.linePtr;
- int lineCount = 0;
- int start = textStartPosition;
- boolean endsOnMultiply = false;
- while (!this.scanner.atEnd()) {
- switch (this.scanner.getNextToken()) {
- case TerminalTokens.TokenNameMULTIPLY:
- // we just need to replace each lines between '*' with the javadoc formatted ones
- int linesGap = this.scanner.linePtr - linePtr;
- if (linesGap > 0) {
- this.javadocGapLinesBuffer.setLength(0);
- if (lineCount > 0) {
- // only add trailing space if one was there before (bug 49619)
- if (this.scanner.source[start] == ' ') {
- this.javadocGapLinesBuffer.append(' ');
- }
- }
- for (int i = 0; i < linesGap ; i++) {
- if (clearBlankLines && lineCount >= newLines) {
- // leave as the required new lines have been inserted
- // so remove any remaining blanks and leave
- if (textEndPosition >= start) {
- if (output == null) {
- addReplaceEdit(start, textEndPosition, " "); //$NON-NLS-1$
- } else {
- output.append(' ');
- }
- }
- return;
- }
- this.javadocGapLinesBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.javadocGapLinesBuffer);
- if (i == (linesGap-1)) {
- this.javadocGapLinesBuffer.append(' ');
- this.column++;
- } else {
- this.javadocGapLinesBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- }
- lineCount++;
- }
- int currentTokenStartPosition = this.scanner.getCurrentTokenStartPosition();
- int tokenLength = this.scanner.currentPosition - currentTokenStartPosition;
- if (output == null) {
- addReplaceEdit(start, currentTokenStartPosition-1, this.javadocGapLinesBuffer.toString());
- } else {
- output.append(this.javadocGapLinesBuffer);
- output.append(this.scanner.source, currentTokenStartPosition, tokenLength);
- }
- this.column += tokenLength;
- if (footer && clearBlankLines && lineCount == newLines) {
- if (textEndPosition >= currentTokenStartPosition) {
- if (output == null) {
- addDeleteEdit(currentTokenStartPosition, textEndPosition);
- }
- }
- return;
- }
- }
- // next start is just after the current token
- start = this.scanner.currentPosition;
- linePtr = this.scanner.linePtr;
- endsOnMultiply = true;
- break;
- default:
- endsOnMultiply = false;
- break;
- }
- }
-
- // Format the last whitespaces
- if (lineCount < newLines) {
- // Insert new lines as not enough was encountered while scanning the whitespaces
- this.javadocGapLinesBuffer.setLength(0);
- if (lineCount > 0) {
- // only add trailing space if one was there before (bug 49619)
- if (this.scanner.source[start] == ' ') {
- this.javadocGapLinesBuffer.append(' ');
- }
- }
- for (int i = lineCount; i < newLines-1; i++) {
- printJavadocNewLine(this.javadocGapLinesBuffer);
- }
- this.javadocGapLinesBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.javadocGapLinesBuffer);
- if (footer) {
- this.javadocGapLinesBuffer.append(' ');
- this.column++;
- } else {
- this.javadocGapLinesBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- }
- if (output == null) {
- if (textEndPosition >= start) {
- addReplaceEdit(start, textEndPosition, this.javadocGapLinesBuffer.toString());
- } else {
- addInsertEdit(textEndPosition+1, this.javadocGapLinesBuffer.toString());
- }
- } else {
- output.append(this.javadocGapLinesBuffer);
- }
- } else {
- // Replace all remaining whitespaces by a single space
- if (textEndPosition >= start) {
- this.javadocGapLinesBuffer.setLength(0);
- if (this.scanner.linePtr > linePtr) {
- if (lineCount > 0) {
- // only add trailing space if one was there before (bug 49619)
- if (this.scanner.source[start] == ' ') {
- this.javadocGapLinesBuffer.append(' ');
- }
- }
- this.javadocGapLinesBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.javadocGapLinesBuffer);
- }
- this.javadocGapLinesBuffer.append(' ');
- if (output == null) {
- addReplaceEdit(start, textEndPosition, this.javadocGapLinesBuffer.toString());
- } else {
- output.append(this.javadocGapLinesBuffer);
- }
- this.needSpace = false;
- } else if (endsOnMultiply) {
- if (output == null) {
- addInsertEdit(textEndPosition+1, " "); //$NON-NLS-1$
- } else {
- output.append(' ');
- }
- this.needSpace = false;
- }
- this.column++;
- }
- }
- catch (InvalidInputException iie) {
- // there's nothing to do if this exception happens
- }
- finally {
- this.scanner.recordLineSeparator = false;
- this.needSpace = false;
- this.scanner.resetTo(textEndPosition+1, this.scannerEndPosition - 1);
- this.lastNumberOfNewLines += newLines;
- this.line += newLines;
- }
- }
-
- private void printJavadocImmutableText(FormatJavadocText text, FormatJavadocBlock block, boolean textOnNewLine) {
-
- try {
- // Iterate on text line separators
- int textLineStart = text.lineStart;
- this.scanner.tokenizeWhiteSpace = false;
- String newLineString = null;
- for (int idx=0, max=text.separatorsPtr; idx<=max ; idx++) {
- int start = (int) text.separators[idx];
- int lineStart = Util.getLineNumber(start, this.lineEnds, textLineStart-1, this.maxLines);
- while (textLineStart < lineStart) {
- int end = this.lineEnds[textLineStart-1];
- this.scanner.resetTo(end, start);
- int token = this.scanner.getNextToken();
- switch (token) {
- case TerminalTokens.TokenNameMULTIPLY:
- case TerminalTokens.TokenNameMULTIPLY_EQUAL:
- break;
- default:
- return;
- }
- if (this.scanner.currentCharacter == ' ') {
- this.scanner.getNextChar();
- }
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- newLineString = this.tempBuffer.toString();
- }
- addReplaceEdit(end+1, this.scanner.getCurrentTokenEndPosition(), newLineString);
- textLineStart = Util.getLineNumber(this.scanner.currentPosition-1, this.lineEnds, textLineStart, this.maxLines);
- }
- }
- }
- catch (InvalidInputException iie) {
- // leave
- }
- finally {
- // Reset
- this.needSpace = false;
- this.scanner.tokenizeWhiteSpace = true;
- this.scanner.resetTo(text.sourceEnd+1, this.scannerEndPosition - 1);
- }
- }
-
- /*
- * Print the gap lines for an immutable block.
- * That's needed to be specific as the formatter needs to keep white spaces
- * if possible except those which are indentation ones.
- * Note that in the peculiar case of a two lines immutable tag (multi lines block),
- * the formatter will join the two lines.
- */
- private void printJavadocGapLinesForImmutableBlock(FormatJavadocBlock block) {
-
- // Init
- int firstLineEnd = -1; // not initialized
- int newLineStart = -1; // not initialized
- int secondLineStart = -1; // not initialized
- int starPosition = -1; // not initialized
- int offset = 0;
- int start = block.tagEnd + 1;
- int end = block.nodes[0].sourceStart-1;
- this.scanner.resetTo(start, end);
- int lineStart = block.lineStart;
- int lineEnd = Util.getLineNumber(block.nodes[0].sourceEnd, this.lineEnds, lineStart-1, this.maxLines);
- boolean multiLinesBlock = lineEnd > (lineStart+1);
- int previousPosition = this.scanner.currentPosition;
- String newLineString = null;
- int indentationColumn = 0;
- int leadingSpaces = -1;
-
- // Scan the existing gap
- while (!this.scanner.atEnd()) {
- char ch = (char) this.scanner.getNextChar();
- switch (ch) {
- case '\t' :
- // increase the corresponding counter from the appropriate tab value
- if (secondLineStart > 0 || firstLineEnd < 0) {
- int reminder = this.tabLength == 0 ? 0 : offset % this.tabLength;
- if (reminder == 0) {
- offset += this.tabLength;
- } else {
- offset = ((offset / this.tabLength) + 1) * this.tabLength;
- }
- } else if (leadingSpaces >= 0) {
- int reminder = this.tabLength == 0 ? 0 : offset % this.tabLength;
- if (reminder == 0) {
- leadingSpaces += this.tabLength;
- } else {
- leadingSpaces = ((offset / this.tabLength) + 1) * this.tabLength;
- }
- }
- break;
- case '\r' :
- case '\n' :
- // new line, store the end of the first one
- if (firstLineEnd < 0) {
- firstLineEnd = previousPosition;
- }
- // print indentation if there were spaces without any star on the line
- if (leadingSpaces > 0 && multiLinesBlock) {
- if (newLineString == null) {
- this.column = 1;
- this.tempBuffer.setLength(0);
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- newLineString = this.tempBuffer.toString();
- indentationColumn = this.column;
- } else {
- this.column = indentationColumn;
- }
- addReplaceEdit(newLineStart, newLineStart+indentationColumn-2, newLineString);
- }
- // store line start and reset positions
- newLineStart = this.scanner.currentPosition;
- leadingSpaces = 0;
- starPosition = -1;
- if (multiLinesBlock) {
- offset = 0;
- secondLineStart = -1;
- }
- break;
- case '*' :
- // store line start position if this is the first star of the line
- if (starPosition < 0 && firstLineEnd > 0) {
- secondLineStart = this.scanner.currentPosition;
- starPosition = this.scanner.currentPosition;
- leadingSpaces = -1;
- }
- break;
- default :
- // increment offset if line has started
- if (secondLineStart > 0) {
- // skip first white space after the first '*'
- if (secondLineStart == starPosition) {
- secondLineStart = this.scanner.currentPosition;
- } else {
- // print indentation before the following characters
- if (offset == 0 && multiLinesBlock) {
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- indentationColumn = this.column;
- newLineString = this.tempBuffer.toString();
- } else {
- this.column = indentationColumn;
- }
- addReplaceEdit(newLineStart, secondLineStart-1, newLineString);
- }
- offset++;
- }
- } else if (firstLineEnd < 0) {
- // no new line yet, increment the offset
- offset++;
- } else if (leadingSpaces >= 0) {
- // no star yet, increment the leading spaces
- leadingSpaces++;
- }
- break;
- }
- previousPosition = this.scanner.currentPosition;
- }
-
- // Increment the columns from the numbers of characters counted on the line
- if (multiLinesBlock) {
- this.column += offset;
- } else {
- this.column++;
- }
-
- // Replace the new line with a single space when there's only one separator
- // or, if necessary, print the indentation on the last line
- if (!multiLinesBlock) {
- if (firstLineEnd > 0) {
- addReplaceEdit(firstLineEnd, end, " "); //$NON-NLS-1$
- }
- }
- else if (secondLineStart > 0) {
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- newLineString = this.tempBuffer.toString();
- indentationColumn = this.column;
- } else {
- this.column = indentationColumn;
- }
- addReplaceEdit(newLineStart, secondLineStart-1, newLineString);
- }
- else if (leadingSpaces > 0) {
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- newLineString = this.tempBuffer.toString();
- indentationColumn = this.column;
- } else {
- this.column = indentationColumn;
- }
- addReplaceEdit(newLineStart, newLineStart+indentationColumn-2, newLineString);
- }
-
- // Reset
- this.needSpace = false;
- this.scanner.resetTo(end+1, this.scannerEndPosition - 1);
- }
-
- private int printJavadocHtmlTag(FormatJavadocText text, FormatJavadocBlock block, boolean textOnNewLine) {
-
- // Compute indentation if necessary
- boolean clearBlankLines = this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment;
-
- // Local variables init
- int textStart = text.sourceStart;
- int nextStart = textStart;
- int startLine = Util.getLineNumber(textStart, this.lineEnds, 0, this.maxLines);
- int htmlTagID = text.getHtmlTagID();
- if (text.depth >= this.javadocHtmlTagBuffers.length) {
- int length = this.javadocHtmlTagBuffers.length;
- System.arraycopy(this.javadocHtmlTagBuffers, 0, this.javadocHtmlTagBuffers = new StringBuffer[text.depth+6], 0, length);
- }
- StringBuffer buffer = this.javadocHtmlTagBuffers[text.depth];
- if (buffer == null) {
- buffer = new StringBuffer();
- this.javadocHtmlTagBuffers[text.depth] = buffer;
- } else {
- buffer.setLength(0);
- }
-
- // New line will be added before next node
- int max = text.separatorsPtr;
- int linesAfter = 0;
- int previousEnd = -1;
- boolean isHtmlBreakTag = htmlTagID == JAVADOC_SINGLE_BREAK_TAG_ID;
- boolean isHtmlSeparatorTag = htmlTagID == JAVADOC_SEPARATOR_TAGS_ID;
- if (isHtmlBreakTag) {
- return 1;
- }
-
- // Iterate on text line separators
- boolean isCode = htmlTagID == JAVADOC_CODE_TAGS_ID;
- for (int idx=0, ptr=0; idx<=max || (text.htmlNodesPtr != -1 && ptr <= text.htmlNodesPtr); idx++) {
-
- // append text to buffer realigning with the line length
- int end = (idx > max) ? text.sourceEnd : (int) (text.separators[idx] >>> 32);
- int nodeKind = 0; // text break
- if (text.htmlNodesPtr >= 0 && ptr <= text.htmlNodesPtr && end > text.htmlNodes[ptr].sourceStart) {
- FormatJavadocNode node = text.htmlNodes[ptr];
- FormatJavadocText htmlTag = node.isText() ? (FormatJavadocText) node : null;
- int newLines = htmlTag == null ? 0 : htmlTag.linesBefore;
- if (linesAfter > newLines) {
- newLines = linesAfter;
- if (newLines > 1 && clearBlankLines) {
- if (idx < 2 || (text.htmlIndexes[idx-2] & JAVADOC_TAGS_ID_MASK) != JAVADOC_CODE_TAGS_ID) {
- newLines = 1;
- }
- }
- }
- if (textStart < previousEnd) {
- addReplaceEdit(textStart, previousEnd, buffer.toString());
- }
- boolean immutable = node.isImmutable();
- if (newLines == 0) {
- newLines = printJavadocBlockNodesNewLines(block, node, previousEnd);
- }
- int nodeStart = node.sourceStart;
- if (newLines > 0 || (idx > 1 && nodeStart > (previousEnd+1))) {
- printJavadocGapLines(previousEnd+1, nodeStart-1, newLines, clearBlankLines, false, null);
- }
- if (newLines > 0) textOnNewLine = true;
- buffer.setLength(0);
- if (node.isText()) {
- if (immutable) {
- // do not change immutable tags, just increment column
- if (textOnNewLine && this.commentIndentation != null) {
- addInsertEdit(node.sourceStart, this.commentIndentation);
- this.column += this.commentIndentation.length();
- }
- printJavadocImmutableText(htmlTag, block, textOnNewLine);
- this.column += getTextLength(block, htmlTag);
- linesAfter = 0;
- } else {
- linesAfter = printJavadocHtmlTag(htmlTag, block, textOnNewLine);
- }
- nodeKind = 1; // text
- } else {
- if (textOnNewLine && this.commentIndentation != null) {
- addInsertEdit(node.sourceStart, this.commentIndentation);
- this.column += this.commentIndentation.length();
- }
- printJavadocBlock((FormatJavadocBlock)node);
- linesAfter = 0;
- nodeKind = 2; // block
- }
- textStart = node.sourceEnd+1;
- ptr++;
- if (idx > max) {
- return linesAfter;
- }
- } else {
- if (idx > 0 && linesAfter > 0) {
- printJavadocGapLines(previousEnd+1, nextStart-1, linesAfter, clearBlankLines, false, buffer);
- textOnNewLine = true;
- }
- boolean needIndentation = textOnNewLine;
- if (idx > 0) {
- if (!needIndentation && text.isTextAfterHtmlSeparatorTag(idx-1)) {
- needIndentation = true;
- }
- }
- this.needSpace = idx > 1 && (previousEnd+1) < nextStart; // There's no space between text and html tag or inline block => do not insert space a the beginning of the text
- printJavadocTextLine(buffer, nextStart, end, block, idx==0, needIndentation, idx==0/* opening html tag?*/ || text.htmlIndexes[idx-1] != -1);
- linesAfter = 0;
- if (idx==0) {
- if (isHtmlSeparatorTag) {
- linesAfter = 1;
- }
- } else if (text.htmlIndexes[idx-1] == JAVADOC_SINGLE_BREAK_TAG_ID) {
- linesAfter = 1;
- }
- }
-
- // Replace with current buffer if there are several empty lines between text lines
- nextStart = (int) text.separators[idx];
- int endLine = Util.getLineNumber(end, this.lineEnds, startLine-1, this.maxLines);
- startLine = Util.getLineNumber(nextStart, this.lineEnds, endLine-1, this.maxLines);
- int linesGap = startLine - endLine;
- if (linesGap > 0) {
- if (clearBlankLines) {
- // keep previously computed lines after
- } else {
- if (idx==0 || linesGap > 1 || (idx < max && nodeKind==1 && (text.htmlIndexes[idx-1] & JAVADOC_TAGS_ID_MASK) != JAVADOC_IMMUTABLE_TAGS_ID)) {
- if (linesAfter < linesGap) {
- linesAfter = linesGap;
- }
- }
- }
- }
- textOnNewLine = linesAfter > 0;
-
- // print <pre> tag
- if (isCode) {
- int codeEnd = (int) (text.separators[max] >>> 32);
- if (codeEnd > end) {
- if (this.formatter.preferences.comment_format_source) {
- if (textStart < end) addReplaceEdit(textStart, end, buffer.toString());
- // See whether there's a space before the code
- if (linesGap > 0) {
- int lineStart = this.scanner.getLineStart(startLine);
- if (nextStart > lineStart) { // if code starts at the line, then no leading space is needed
- this.scanner.resetTo(lineStart, nextStart-1);
- try {
- int token = this.scanner.getNextToken();
- if (token == TerminalTokens.TokenNameWHITESPACE) {
- // skip indentation
- token = this.scanner.getNextToken();
- }
- if (token == TerminalTokens.TokenNameMULTIPLY) {
- nextStart = this.scanner.currentPosition;
- }
- }
- catch (InvalidInputException iie) {
- // skip
- }
- }
- }
- // Format gap lines before code
- int newLines = linesGap;
- if (newLines == 0) newLines=1;
- this.needSpace = false;
- printJavadocGapLines(end+1, nextStart-1, newLines, false/* clear first blank lines inside <pre> tag as done by old formatter */, false, null);
- // Format the code
- printCodeSnippet(nextStart, codeEnd, linesGap);
- // Format the gap lines after the code
- nextStart = (int) text.separators[max];
- printJavadocGapLines(codeEnd+1, nextStart-1, 1, false/* clear blank lines inside <pre> tag as done by old formatter */, false, null);
- return 2;
- }
- } else {
- nextStart = (int) text.separators[max];
- if ((nextStart-1) > (end+1)) {
- int line1 = Util.getLineNumber(end+1, this.lineEnds, startLine-1, this.maxLines);
- int line2 = Util.getLineNumber(nextStart-1, this.lineEnds, line1-1, this.maxLines);
- int gapLines = line2-line1-1;
- printJavadocGapLines(end+1, nextStart-1, gapLines, false/* never clear blank lines inside <pre> tag*/, false, null);
- if (gapLines > 0) textOnNewLine = true;
- }
- }
- return 1;
- }
-
- // store previous end
- previousEnd = end;
- }
-
- // Insert last gap
- boolean closingTag = isHtmlBreakTag || (text.htmlIndexes != null && (text.htmlIndexes[max] & JAVADOC_TAGS_ID_MASK) == htmlTagID);
- boolean isValidHtmlSeparatorTag = max > 0 && isHtmlSeparatorTag && closingTag;
- if (previousEnd != -1) {
- if (isValidHtmlSeparatorTag) {
- if (linesAfter == 0) linesAfter = 1;
- }
- if (linesAfter > 0) {
- printJavadocGapLines(previousEnd+1, nextStart-1, linesAfter, clearBlankLines, false, buffer);
- textOnNewLine = linesAfter > 0;
- }
- }
-
- // Print closing tag
- boolean needIndentation = textOnNewLine;
- if (!needIndentation && !isHtmlBreakTag && text.htmlIndexes != null && text.isTextAfterHtmlSeparatorTag(max)) {
- needIndentation = true;
- }
- this.needSpace = !closingTag && max > 0 // not a single or not closed tag (e.g. <br>)
- && (previousEnd+1) < nextStart; // There's no space between text and html tag or inline block => do not insert space a the beginning of the text
- printJavadocTextLine(buffer, nextStart, text.sourceEnd, block, max <= 0, needIndentation, closingTag/* closing html tag*/);
- if (textStart < text.sourceEnd) {
- addReplaceEdit(textStart, text.sourceEnd, buffer.toString());
- }
-
- // Reset
- this.needSpace = false;
- this.scanner.resetTo(text.sourceEnd+1, this.scannerEndPosition - 1);
-
- // Return the new lines to insert after
- return isValidHtmlSeparatorTag ? 1 : 0;
- }
-
- private void printJavadocNewLine(StringBuffer buffer) {
- buffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(buffer);
- buffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- this.line++;
- this.lastNumberOfNewLines++;
- }
-
- private void printJavadocText(FormatJavadocText text, FormatJavadocBlock block, boolean textOnNewLine) {
-
- boolean clearBlankLines = this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment;
- boolean joinLines = this.formatter.preferences.join_lines_in_comments;
- this.javadocTextBuffer.setLength(0);
- int textStart = text.sourceStart;
- int nextStart = textStart;
- int startLine = Util.getLineNumber(textStart, this.lineEnds, 0, this.maxLines);
-
- // Iterate on text line separators
- for (int idx=0, max=text.separatorsPtr; idx<=max ; idx++) {
-
- // append text to buffer realigning with the line length
- int end = (int) (text.separators[idx] >>> 32);
- boolean needIndentation = textOnNewLine;
- if (idx > 0) {
- if (!needIndentation && text.isTextAfterHtmlSeparatorTag(idx-1)) {
- needIndentation = true;
- }
- }
- this.needSpace = idx > 0;
- printJavadocTextLine(this.javadocTextBuffer, nextStart, end, block, idx==0 || (!joinLines && textOnNewLine)/*first text?*/, needIndentation, false /*not an html tag*/);
- textOnNewLine = false;
-
- // Replace with current buffer if there are several empty lines between text lines
- nextStart = (int) text.separators[idx];
- if (!clearBlankLines || !joinLines) {
- int endLine = Util.getLineNumber(end, this.lineEnds, startLine-1, this.maxLines);
- startLine = Util.getLineNumber(nextStart, this.lineEnds, endLine-1, this.maxLines);
- int gapLine = endLine;
- if (joinLines) gapLine++; // if not preserving line break then gap must be at least of one line
- if (startLine > gapLine) {
- addReplaceEdit(textStart, end, this.javadocTextBuffer.toString());
- textStart = nextStart;
- this.javadocTextBuffer.setLength(0);
- int newLines = startLine - endLine;
- if (clearBlankLines) newLines = 1;
- printJavadocGapLines(end+1, nextStart-1, newLines, this.formatter.preferences.comment_clear_blank_lines_in_javadoc_comment, false, null);
- textOnNewLine = true;
- }
- else if (startLine > endLine) {
- textOnNewLine = !joinLines;
- }
- }
- }
-
- // Replace remaining line
- boolean needIndentation = textOnNewLine;
- this.needSpace = text.separatorsPtr >= 0;
- printJavadocTextLine(this.javadocTextBuffer, nextStart, text.sourceEnd, block, text.separatorsPtr==-1 /* first text?*/, needIndentation, false /*not an html tag*/);
- // TODO Bring back following optimization
- // if (lastNewLines != this.lastNumberOfNewLines || (this.column - currentColumn) != (text.sourceEnd - text.sourceStart + 1)) {
- addReplaceEdit(textStart, text.sourceEnd, this.javadocTextBuffer.toString());
- // }
-
- // Reset
- this.needSpace = false;
- this.scanner.resetTo(text.sourceEnd+1, this.scannerEndPosition - 1);
- }
-
- /*
- * Returns whether the text has been modified or not.
- */
- private void printJavadocTextLine(StringBuffer buffer, int textStart, int textEnd, FormatJavadocBlock block, boolean firstText, boolean needIndentation, boolean isHtmlTag) {
-
- boolean headerLine = block.isHeaderLine() && this.lastNumberOfNewLines == 0;
-
- // First we need to know what is the indentation
- this.javadocTokensBuffer.setLength(0);
- int firstColumn = 1 + this.indentationLevel + BLOCK_LINE_PREFIX_LENGTH;
- int maxColumn = this.formatter.preferences.comment_line_length + 1;
- if (headerLine) {
- firstColumn++;
- maxColumn++;
- }
- if (needIndentation && this.commentIndentation != null) {
- buffer.append(this.commentIndentation);
- this.column += this.commentIndentation.length();
- firstColumn += this.commentIndentation.length();
- }
- if (this.column < firstColumn) {
- this.column = firstColumn;
- }
-
- // Scan the text token per token to compact it and size it the max line length
- String newLineString = null;
- try {
- this.scanner.resetTo(textStart, textEnd);
- this.scanner.skipComments = true;
- int previousToken = -1;
- boolean textOnNewLine = needIndentation;
-
- // Consume text token per token
- while (!this.scanner.atEnd()) {
- int token;
- try {
- token = this.scanner.getNextToken();
- } catch (InvalidInputException iie) {
- token = consumeInvalidToken(textEnd);
- }
- int tokensBufferLength = this.javadocTokensBuffer.length();
- int tokenStart = this.scanner.getCurrentTokenStartPosition();
- int tokenLength = (this.scanner.atEnd() ? this.scanner.eofPosition : this.scanner.currentPosition) - tokenStart;
- boolean insertSpace = (previousToken == TerminalTokens.TokenNameWHITESPACE || this.needSpace) && !textOnNewLine;
- String tokensBufferString = this.javadocTokensBuffer.toString().trim();
- switch (token) {
- case TerminalTokens.TokenNameWHITESPACE:
- if (tokensBufferLength > 0) {
- boolean shouldSplit = (this.column+tokensBufferLength) > maxColumn // the max length is reached
- && !isHtmlTag
- && (insertSpace || tokensBufferLength > 1) // allow to split at the beginning only when starting with an identifier or a token with a length > 1
- && tokensBufferString.charAt(0) != '@'; // avoid to split just before a '@'
- if (shouldSplit) {
- this.lastNumberOfNewLines++;
- this.line++;
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- if (this.commentIndentation != null) {
- this.tempBuffer.append(this.commentIndentation);
- this.column += this.commentIndentation.length();
- }
- firstColumn = this.column;
- newLineString = this.tempBuffer.toString();
- } else {
- this.column = firstColumn;
- }
- buffer.append(newLineString);
- buffer.append(tokensBufferString);
- this.column += tokensBufferString.length();
- if (headerLine) {
- firstColumn--;
- maxColumn--;
- headerLine = false;
- }
- } else {
- buffer.append(this.javadocTokensBuffer);
- this.column += tokensBufferLength;
- }
- this.javadocTokensBuffer.setLength(0);
- }
- textOnNewLine = false;
- previousToken = token;
- continue;
- case TerminalTokens.TokenNameCharacterLiteral:
- if (this.scanner.currentPosition > this.scanner.eofPosition) {
- this.scanner.resetTo(this.scanner.startPosition, textEnd);
- this.scanner.getNextChar();
- token = 1;
- }
- break;
- }
- int lastColumn = this.column + tokensBufferLength + tokenLength;
- if (insertSpace) lastColumn++;
- boolean shouldSplit = lastColumn > maxColumn // the max length is reached
- && (!isHtmlTag || previousToken == -1) // not an html tag or just at the beginning of it
- && token != TerminalTokens.TokenNameAT && (tokensBufferLength == 0 || this.javadocTokensBuffer.charAt(tokensBufferLength-1) != '@'); // avoid to split just before a '@'
- if (shouldSplit) {
- // not enough space on the line
- if ((tokensBufferLength > 0 || tokenLength < maxColumn) && !isHtmlTag && tokensBufferLength > 0 && (firstColumn+tokensBufferLength+tokenLength) >= maxColumn) {
- // there won't be enough room even if we break the line before the buffered tokens
- // So add the buffered tokens now
- buffer.append(this.javadocTokensBuffer);
- this.column += tokensBufferLength;
- this.javadocTokensBuffer.setLength(0);
- tokensBufferLength = 0;
- textOnNewLine = false;
- }
- if ((tokensBufferLength > 0 || /*(firstColumn+tokenLength) < maxColumn || (insertSpace &&*/ this.column > firstColumn) && (!textOnNewLine || !firstText)) {
- this.lastNumberOfNewLines++;
- this.line++;
- if (newLineString == null) {
- this.tempBuffer.setLength(0);
- this.tempBuffer.append(this.lineSeparator);
- this.column = 1;
- printIndentationIfNecessary(this.tempBuffer);
- this.tempBuffer.append(BLOCK_LINE_PREFIX);
- this.column += BLOCK_LINE_PREFIX_LENGTH;
- if (this.commentIndentation != null) {
- this.tempBuffer.append(this.commentIndentation);
- this.column += this.commentIndentation.length();
- }
- firstColumn = this.column;
- newLineString = this.tempBuffer.toString();
- } else {
- this.column = firstColumn;
- }
- buffer.append(newLineString);
- }
- if (tokensBufferLength > 0) {
- String tokensString = tokensBufferString;
- buffer.append(tokensString);
- this.column += tokensString.length();
- this.javadocTokensBuffer.setLength(0);
- tokensBufferLength = 0;
- }
- buffer.append(this.scanner.source, tokenStart, tokenLength);
- this.column += tokenLength;
- textOnNewLine = false;
- if (headerLine) {
- firstColumn--;
- maxColumn--;
- headerLine = false;
- }
- } else {
- // append token to the line
- if (insertSpace) {
- this.javadocTokensBuffer.append(' ');
- }
- this.javadocTokensBuffer.append(this.scanner.source, tokenStart, tokenLength);
- }
- previousToken = token;
- this.needSpace = false;
- if (headerLine && lastColumn == maxColumn && this.scanner.atEnd()) {
- this.lastNumberOfNewLines++;
- this.line++;
- }
- }
- }
- finally {
- this.scanner.skipComments = false;
- // Add remaining buffered tokens
- if (this.javadocTokensBuffer.length() > 0) {
- buffer.append(this.javadocTokensBuffer);
- this.column += this.javadocTokensBuffer.length();
- }
- }
- }
-
- public void printModifiers(Annotation[] annotations, ASTVisitor visitor, int annotationSourceKind) {
- printModifiers(annotations, visitor, annotationSourceKind, false);
- }
-
- public void printModifiers(Annotation[] annotations, ASTVisitor visitor, int annotationSourceKind, boolean firstIsTypeAnnotation) {
- try {
- int annotationsLength = annotations != null ? annotations.length : 0;
- int annotationsIndex = 0;
- boolean isFirstModifier = true;
- int currentTokenStartPosition = this.scanner.currentPosition;
- boolean hasComment = false;
- boolean hasModifiers = false;
- boolean treatNextAsTypeAnnotation = firstIsTypeAnnotation;
- while ((this.currentToken = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
- int foundTaskCount = this.scanner.foundTaskCount;
- int tokenStartPosition = this.scanner.getCurrentTokenStartPosition();
- int tokenEndPosition = this.scanner.getCurrentTokenEndPosition();
- switch(this.currentToken) {
- case TerminalTokens.TokenNamedefault :
- case TerminalTokens.TokenNamepublic :
- case TerminalTokens.TokenNameprotected :
- case TerminalTokens.TokenNameprivate :
- case TerminalTokens.TokenNamestatic :
- case TerminalTokens.TokenNameabstract :
- case TerminalTokens.TokenNamefinal :
- case TerminalTokens.TokenNamenative :
- case TerminalTokens.TokenNamesynchronized :
- case TerminalTokens.TokenNametransient :
- case TerminalTokens.TokenNamevolatile :
- case TerminalTokens.TokenNamestrictfp :
- hasModifiers = true;
- treatNextAsTypeAnnotation = true;
- print(this.scanner.currentPosition - this.scanner.startPosition, !isFirstModifier);
- isFirstModifier = false;
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameAT :
- hasModifiers = true;
- if (!isFirstModifier) {
- space();
- }
- this.scanner.resetTo(this.scanner.getCurrentTokenStartPosition(), this.scannerEndPosition - 1);
- if (annotationsIndex < annotationsLength) {
- boolean insertSpaceBeforeBrace = this.formatter.preferences.insert_space_before_opening_brace_in_array_initializer;
- this.formatter.preferences.insert_space_before_opening_brace_in_array_initializer = false;
- try {
- annotations[annotationsIndex++].traverse(visitor, (BlockScope) null);
- }
- finally {
- this.formatter.preferences.insert_space_before_opening_brace_in_array_initializer = insertSpaceBeforeBrace;
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
- boolean shouldAddNewLine = false;
- switch (annotationSourceKind) {
- case ICodeFormatterConstants.ANNOTATION_ON_TYPE :
- shouldAddNewLine = treatNextAsTypeAnnotation
- ? this.formatter.preferences.insert_new_line_after_type_annotation
- : this.formatter.preferences.insert_new_line_after_annotation_on_type;
- break;
- case ICodeFormatterConstants.ANNOTATION_ON_FIELD :
- shouldAddNewLine = treatNextAsTypeAnnotation
- ? this.formatter.preferences.insert_new_line_after_type_annotation
- : this.formatter.preferences.insert_new_line_after_annotation_on_field;
- break;
- case ICodeFormatterConstants.ANNOTATION_ON_METHOD :
- shouldAddNewLine = treatNextAsTypeAnnotation
- ? this.formatter.preferences.insert_new_line_after_type_annotation
- : this.formatter.preferences.insert_new_line_after_annotation_on_method;
- break;
- case ICodeFormatterConstants.ANNOTATION_ON_PACKAGE :
- shouldAddNewLine = treatNextAsTypeAnnotation
- ? this.formatter.preferences.insert_new_line_after_type_annotation
- : this.formatter.preferences.insert_new_line_after_annotation_on_package;
- break;
- case ICodeFormatterConstants.ANNOTATION_ON_PARAMETER :
- shouldAddNewLine = treatNextAsTypeAnnotation
- ? this.formatter.preferences.insert_new_line_after_type_annotation
- : this.formatter.preferences.insert_new_line_after_annotation_on_parameter;
- break;
- case ICodeFormatterConstants.ANNOTATION_ON_LOCAL_VARIABLE :
- shouldAddNewLine = treatNextAsTypeAnnotation
- ? this.formatter.preferences.insert_new_line_after_type_annotation
- : this.formatter.preferences.insert_new_line_after_annotation_on_local_variable;
- break;
- default:
- // do nothing when no annotation formatting option specified
- }
- if (shouldAddNewLine) {
- this.printNewLine();
- }
- } else {
- return;
- }
- isFirstModifier = false;
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- if (this.useTags && this.editsEnabled) {
- boolean turnOff = false;
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- turnOff = true;
- } else if (this.tagsKind == this.currentToken
- && CharOperation.equals(this.disablingTag, this.scanner.source, tokenStartPosition, tokenEndPosition+1)) {
- this.editsEnabled = false;
- turnOff = true;
- }
- if (turnOff) {
- if (!this.editsEnabled && this.editsIndex > 1) {
- OptimizedReplaceEdit currentEdit = this.edits[this.editsIndex-1];
- if (this.scanner.startPosition == currentEdit.offset+currentEdit.length) {
- printNewLinesBeforeDisablingComment();
- }
- }
- }
- }
- printBlockComment(this.currentToken == TerminalTokens.TokenNameCOMMENT_JAVADOC);
- if (this.useTags && !this.editsEnabled) {
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- } else if (this.tagsKind == this.currentToken) {
- this.editsEnabled = CharOperation.equals(this.enablingTag, this.scanner.source, tokenStartPosition, tokenEndPosition+1);
- }
- }
- currentTokenStartPosition = this.scanner.currentPosition;
- hasComment = true;
- break;
- case TerminalTokens.TokenNameCOMMENT_LINE :
- tokenEndPosition = -this.scanner.commentStops[this.scanner.commentPtr];
- if (this.useTags && this.editsEnabled) {
- boolean turnOff = false;
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- turnOff = true;
- } else if (this.tagsKind == this.currentToken
- && CharOperation.equals(this.disablingTag, this.scanner.source, tokenStartPosition, tokenEndPosition)) {
- this.editsEnabled = false;
- turnOff = true;
- }
- if (turnOff) {
- if (!this.editsEnabled && this.editsIndex > 1) {
- OptimizedReplaceEdit currentEdit = this.edits[this.editsIndex-1];
- if (this.scanner.startPosition == currentEdit.offset+currentEdit.length) {
- printNewLinesBeforeDisablingComment();
- }
- }
- }
- }
- printLineComment();
- if (this.useTags && !this.editsEnabled) {
- if (foundTaskCount > 0) {
- setEditsEnabled(foundTaskCount);
- } else if (this.tagsKind == this.currentToken) {
- this.editsEnabled = CharOperation.equals(this.enablingTag, this.scanner.source, tokenStartPosition, tokenEndPosition);
- }
- }
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameWHITESPACE :
- addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
- int count = 0;
- char[] whiteSpaces = this.scanner.getCurrentTokenSource();
- for (int i = 0, max = whiteSpaces.length; i < max; i++) {
- switch(whiteSpaces[i]) {
- case '\r' :
- if ((i + 1) < max) {
- if (whiteSpaces[i + 1] == '\n') {
- i++;
- }
- }
- count++;
- break;
- case '\n' :
- count++;
- }
- }
- if (count >= 1 && hasComment) {
- printNewLine();
- }
- currentTokenStartPosition = this.scanner.currentPosition;
- hasComment = false;
- break;
- default:
- if (hasModifiers) {
- space();
- }
- // step back one token
- this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
- return;
- }
- }
- } catch (InvalidInputException e) {
- throw new AbortFormatting(e);
- }
- }
-
- public void printNewLine() {
- this.printNewLine(this.scanner.getCurrentTokenEndPosition() + 1);
- }
-
- public void printNewLine(int insertPosition) {
- if (this.nlsTagCounter > 0) {
- return;
- }
- if (this.lastNumberOfNewLines >= 1) {
- // ensure that the scribe is at the beginning of a new line
- // only if no specific indentation has been previously set
- if (!this.preserveLineBreakIndentation) {
- this.column = 1;
- }
- this.preserveLineBreakIndentation = false;
- return;
- }
- addInsertEdit(insertPosition, this.lineSeparator);
- this.line++;
- this.lastNumberOfNewLines = 1;
- this.column = 1;
- this.needSpace = false;
- this.pendingSpace = false;
- this.preserveLineBreakIndentation = false;
- this.lastLineComment.contiguous = false;
- }
-
- /*
- * Print the indentation of a disabling comment
- */
- private void printNewLinesBeforeDisablingComment() {
-
- // Get the beginning of comment line
- int linePtr = Arrays.binarySearch(this.lineEnds, this.scanner.startPosition);
- if (linePtr < 0) {
- linePtr = -linePtr - 1;
- }
- int indentation = 0;
- int beginningOfLine = getLineEnd(linePtr)+1;
- if (beginningOfLine == -1) {
- beginningOfLine = 0;
- }
-
- // If the comment is in the middle of the line, then there's nothing to do
- OptimizedReplaceEdit currentEdit = this.edits[this.editsIndex-1];
- int offset = currentEdit.offset;
- if (offset >= beginningOfLine) return;
-
- // Compute the comment indentation
- int scannerStartPosition = this.scanner.startPosition;
- int scannerEofPosition = this.scanner.eofPosition;
- int scannerCurrentPosition = this.scanner.currentPosition;
- char scannerCurrentChar = this.scanner.currentCharacter;
- int length = currentEdit.length;
- this.scanner.resetTo(beginningOfLine, offset+length-1);
- try {
- while (!this.scanner.atEnd()) {
- char ch = (char) this.scanner.getNextChar();
- switch (ch) {
- case '\t' :
- if (this.tabLength != 0) {
- int reminder = indentation % this.tabLength;
- if (reminder == 0) {
- indentation += this.tabLength;
- } else {
- indentation = ((indentation / this.tabLength) + 1) * this.tabLength;
- }
- }
- break;
- case ' ':
- indentation++;
- break;
- default:
- // Should not happen as the offset of the edit is before the beginning of line
- return;
- }
- }
-
- // Split the existing edit to keep the change before the beginning of the last line
- // but change the indentation after. Note that at this stage, the add*Edit methods
- // cannot be longer used as the edits are disabled
- String indentationString;
- int currentIndentation = getCurrentIndentation(this.scanner.currentPosition);
- if (currentIndentation > 0 && this.indentationLevel > 0) {
- int col = this.column;
- this.tempBuffer.setLength(0);
- printIndentationIfNecessary(this.tempBuffer);
- indentationString = this.tempBuffer.toString();
- this.column = col;
- } else {
- indentationString = Util.EMPTY_STRING;
- }
- String replacement = currentEdit.replacement;
- if (replacement.length() == 0) {
- // previous edit was a delete, as we're sure to have a new line before
- // the comment, then the edit needs to be either replaced entirely with
- // the expected indentation
- this.edits[this.editsIndex-1] = new OptimizedReplaceEdit(beginningOfLine, offset+length-beginningOfLine, indentationString);
- } else {
- int idx = replacement.lastIndexOf(this.lineSeparator);
- if (idx >= 0) {
- // replace current edit if it contains a line separator
- int start = idx + this.lsLength;
- this.tempBuffer.setLength(0);
- this.tempBuffer.append(replacement.substring(0, start));
- if (indentationString != Util.EMPTY_STRING) {
- this.tempBuffer.append(indentationString);
- }
- this.edits[this.editsIndex-1] = new OptimizedReplaceEdit(offset, length, this.tempBuffer.toString());
- }
- }
- }
- finally {
- this.scanner.startPosition = scannerStartPosition;
- this.scanner.eofPosition = scannerEofPosition;
- this.scanner.currentPosition = scannerCurrentPosition;
- this.scanner.currentCharacter = scannerCurrentChar;
- }
- }
-
- /*
- * Print new lines characters when the edits are disabled. In this case, only
- * the line separator is replaced if necessary, the other white spaces are untouched.
- */
- private boolean printNewLinesCharacters(int offset, int length) {
- boolean foundNewLine = false;
- int scannerStartPosition = this.scanner.startPosition;
- int scannerEofPosition = this.scanner.eofPosition;
- int scannerCurrentPosition = this.scanner.currentPosition;
- char scannerCurrentChar = this.scanner.currentCharacter;
- this.scanner.resetTo(offset, offset+length-1);
- try {
- while (!this.scanner.atEnd()) {
- int start = this.scanner.currentPosition;
- char ch = (char) this.scanner.getNextChar();
- boolean needReplace = ch != this.firstLS;
- switch (ch) {
- case '\r':
- if (this.scanner.atEnd()) break;
- ch = (char) this.scanner.getNextChar();
- if (ch != '\n') break;
- needReplace = needReplace || this.lsLength != 2;
- //$FALL-THROUGH$
- case '\n':
- if (needReplace) {
- if (this.editsIndex == 0 || this.edits[this.editsIndex-1].offset != start) {
- this.edits[this.editsIndex++] = new OptimizedReplaceEdit(start, this.scanner.currentPosition-start, this.lineSeparator);
- }
- }
- foundNewLine = true;
- break;
- }
- }
- }
- finally {
- this.scanner.startPosition = scannerStartPosition;
- this.scanner.eofPosition = scannerEofPosition;
- this.scanner.currentPosition = scannerCurrentPosition;
- this.scanner.currentCharacter = scannerCurrentChar;
- }
- return foundNewLine;
- }
-
- public void printNextToken(int expectedTokenType){
- printNextToken(expectedTokenType, false);
- }
-
- public void printNextToken(int expectedTokenType, boolean considerSpaceIfAny) {
- printNextToken(expectedTokenType, considerSpaceIfAny, PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION);
- }
-
- public void printNextToken(int expectedTokenType, boolean considerSpaceIfAny, int emptyLineRules) {
- // Set brace flag, it's useful for the scribe while preserving line breaks
- printComment(CodeFormatter.K_UNKNOWN, NO_TRAILING_COMMENT, emptyLineRules);
- try {
- this.currentToken = this.scanner.getNextToken();
- if (expectedTokenType != this.currentToken) {
- throw new AbortFormatting("unexpected token type, expecting:"+expectedTokenType+", actual:"+this.currentToken);//$NON-NLS-1$//$NON-NLS-2$
- }
- print(this.scanner.currentPosition - this.scanner.startPosition, considerSpaceIfAny);
- } catch (InvalidInputException e) {
- throw new AbortFormatting(e);
- }
- }
-
- public void printNextToken(int[] expectedTokenTypes) {
- printNextToken(expectedTokenTypes, false);
- }
-
- public void printNextToken(int[] expectedTokenTypes, boolean considerSpaceIfAny){
- printComment(CodeFormatter.K_UNKNOWN, NO_TRAILING_COMMENT);
- try {
- this.currentToken = this.scanner.getNextToken();
- if (Arrays.binarySearch(expectedTokenTypes, this.currentToken) < 0) {
- StringBuffer expectations = new StringBuffer(5);
- for (int i = 0; i < expectedTokenTypes.length; i++){
- if (i > 0) {
- expectations.append(',');
- }
- expectations.append(expectedTokenTypes[i]);
- }
- throw new AbortFormatting("unexpected token type, expecting:["+expectations.toString()+"], actual:"+this.currentToken);//$NON-NLS-1$//$NON-NLS-2$
- }
- print(this.scanner.currentPosition - this.scanner.startPosition, considerSpaceIfAny);
- } catch (InvalidInputException e) {
- throw new AbortFormatting(e);
- }
- }
-
- public void printQualifiedReference(int sourceEnd, boolean expectParenthesis) {
- int currentTokenStartPosition = this.scanner.currentPosition;
- try {
- do {
- printComment(CodeFormatter.K_UNKNOWN, NO_TRAILING_COMMENT);
- switch(this.currentToken = this.scanner.getNextToken()) {
- case TerminalTokens.TokenNameEOF :
- return;
- case TerminalTokens.TokenNameWHITESPACE :
- addDeleteEdit(this.scanner.getCurrentTokenStartPosition(), this.scanner.getCurrentTokenEndPosition());
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameCOMMENT_BLOCK :
- case TerminalTokens.TokenNameCOMMENT_JAVADOC :
- printBlockComment(false);
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameCOMMENT_LINE :
- printLineComment();
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameIdentifier :
- case TerminalTokens.TokenNameDOT :
- print(this.scanner.currentPosition - this.scanner.startPosition, false);
- currentTokenStartPosition = this.scanner.currentPosition;
- break;
- case TerminalTokens.TokenNameRPAREN:
- if (expectParenthesis) {
- currentTokenStartPosition = this.scanner.startPosition;
- }
- // $FALL-THROUGH$ - fall through default case...
- default:
- this.scanner.resetTo(currentTokenStartPosition, this.scannerEndPosition - 1);
- return;
- }
- } while (this.scanner.currentPosition <= sourceEnd);
- } catch(InvalidInputException e) {
- throw new AbortFormatting(e);
- }
- }
-
- private void printRule(StringBuffer stringBuffer) {
- // only called if this.tabLength > 0
- for (int i = 0; i < this.pageWidth; i++){
- if ((i % this.tabLength) == 0) {
- stringBuffer.append('+');
- } else {
- stringBuffer.append('-');
- }
- }
- stringBuffer.append(this.lineSeparator);
-
- for (int i = 0; i < (this.pageWidth / this.tabLength); i++) {
- stringBuffer.append(i);
- stringBuffer.append('\t');
- }
- }
-
- void redoAlignment(AlignmentException e){
- if (e.relativeDepth > 0) { // if exception targets a distinct context
- e.relativeDepth--; // record fact that current context got traversed
- this.currentAlignment = this.currentAlignment.enclosing; // pop currentLocation
- throw e; // rethrow
- }
- // reset scribe/scanner to restart at this given location
- resetAt(this.currentAlignment.location);
- this.scanner.resetTo(this.currentAlignment.location.inputOffset, this.scanner.eofPosition - 1);
- // clean alignment chunkKind so it will think it is a new chunk again
- this.currentAlignment.chunkKind = 0;
- }
-
- void redoMemberAlignment(AlignmentException e){
- // reset scribe/scanner to restart at this given location
- resetAt(this.memberAlignment.location);
- this.scanner.resetTo(this.memberAlignment.location.inputOffset, this.scanner.eofPosition - 1);
- // clean alignment chunkKind so it will think it is a new chunk again
- this.memberAlignment.chunkKind = 0;
- }
-
- public void reset() {
- this.checkLineWrapping = true;
- this.line = 0;
- this.column = 1;
- this.editsIndex = 0;
- this.nlsTagCounter = 0;
- }
-
- private void resetAt(Location location) {
- this.line = location.outputLine;
- this.column = location.outputColumn;
- this.indentationLevel = location.outputIndentationLevel;
- this.numberOfIndentations = location.numberOfIndentations;
- this.lastNumberOfNewLines = location.lastNumberOfNewLines;
- this.needSpace = location.needSpace;
- this.pendingSpace = location.pendingSpace;
- this.editsIndex = location.editsIndex;
- this.nlsTagCounter = location.nlsTagCounter;
- if (this.editsIndex > 0) {
- this.edits[this.editsIndex - 1] = location.textEdit;
- }
- this.formatter.lastLocalDeclarationSourceStart = location.lastLocalDeclarationSourceStart;
- }
-
- /**
- * @param compilationUnitSource
- */
- public void resetScanner(char[] compilationUnitSource) {
- this.scanner.setSource(compilationUnitSource);
- this.scannerEndPosition = compilationUnitSource.length;
- this.scanner.resetTo(0, this.scannerEndPosition - 1);
- this.edits = new OptimizedReplaceEdit[INITIAL_SIZE];
- this.maxLines = this.lineEnds == null ? -1 : this.lineEnds.length - 1;
- this.scanner.lineEnds = this.lineEnds;
- this.scanner.linePtr = this.maxLines;
- initFormatterCommentParser();
- }
-
- private void resize() {
- System.arraycopy(this.edits, 0, (this.edits = new OptimizedReplaceEdit[this.editsIndex * 2]), 0, this.editsIndex);
- }
-
- private void setCommentIndentation(int commentIndentationLevel) {
- if (commentIndentationLevel == 0) {
- this.commentIndentation = null;
- } else {
- int length = COMMENT_INDENTATIONS.length;
- if (commentIndentationLevel > length) {
- System.arraycopy(COMMENT_INDENTATIONS, 0, COMMENT_INDENTATIONS = new String[commentIndentationLevel+10], 0, length);
- }
- this.commentIndentation = COMMENT_INDENTATIONS[commentIndentationLevel-1];
- if (this.commentIndentation == null) {
- this.tempBuffer.setLength(0);
- for (int i=0; i<commentIndentationLevel; i++) {
- this.tempBuffer.append(' ');
- }
- this.commentIndentation = this.tempBuffer.toString();
- COMMENT_INDENTATIONS[commentIndentationLevel-1] = this.commentIndentation;
- }
- }
- }
-
- /*
- * Look for the tags identified by the scanner to see whether some of them
- * may change the status of the edition for the formatter.
- * Do not return as soon as a match is found, as there may have several
- * disabling/enabling tags in a comment, hence the last one will be the one really
- * changing the formatter behavior...
- */
- private void setEditsEnabled(int count) {
- for (int i=0; i<count; i++) {
- if (this.disablingTag != null && CharOperation.equals(this.scanner.foundTaskTags[i], this.disablingTag)) {
- this.editsEnabled = false;
- }
- if (this.enablingTag != null && CharOperation.equals(this.scanner.foundTaskTags[i], this.enablingTag)) {
- this.editsEnabled = true;
- }
- }
- }
-
- void setIncludeComments(boolean on) {
- if (on) {
- this.formatComments |= CodeFormatter.F_INCLUDE_COMMENTS;
- } else {
- this.formatComments &= ~CodeFormatter.F_INCLUDE_COMMENTS;
- }
- }
-
- void setHeaderComment(int position) {
- this.headerEndPosition = position;
- }
-
- public void space() {
- if (!this.needSpace) return;
- this.lastNumberOfNewLines = 0;
- this.pendingSpace = true;
- this.column++;
- this.needSpace = false;
- }
-
- public String toString() {
- StringBuffer stringBuffer = new StringBuffer();
- stringBuffer
- .append("(page width = " + this.pageWidth + ") - (tabChar = ");//$NON-NLS-1$//$NON-NLS-2$
- switch(this.tabChar) {
- case DefaultCodeFormatterOptions.TAB :
- stringBuffer.append("TAB");//$NON-NLS-1$
- break;
- case DefaultCodeFormatterOptions.SPACE :
- stringBuffer.append("SPACE");//$NON-NLS-1$
- break;
- default :
- stringBuffer.append("MIXED");//$NON-NLS-1$
- }
- stringBuffer
- .append(") - (tabSize = " + this.tabLength + ")")//$NON-NLS-1$//$NON-NLS-2$
- .append(this.lineSeparator)
- .append("(line = " + this.line + ") - (column = " + this.column + ") - (identationLevel = " + this.indentationLevel + ")") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- .append(this.lineSeparator)
- .append("(needSpace = " + this.needSpace + ") - (lastNumberOfNewLines = " + this.lastNumberOfNewLines + ") - (checkLineWrapping = " + this.checkLineWrapping + ")") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- .append(this.lineSeparator)
- .append("==================================================================================") //$NON-NLS-1$
- .append(this.lineSeparator);
- if (this.tabLength > 0) {
- printRule(stringBuffer);
- }
- return stringBuffer.toString();
- }
-
- public void unIndent() {
- this.indentationLevel -= this.indentationSize;
- this.numberOfIndentations--;
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator.java
new file mode 100644
index 0000000..7607100
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/SpacePreparator.java
@@ -0,0 +1,1003 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] IndexOutOfBoundsException in TokenManager - https://bugs.eclipse.org/462945
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] follow up bug for comments - https://bugs.eclipse.org/458208
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.*;
+
+import java.util.List;
+
+import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTVisitor;
+import org.aspectj.org.eclipse.jdt.core.dom.Annotation;
+import org.aspectj.org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayAccess;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayCreation;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayInitializer;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayType;
+import org.aspectj.org.eclipse.jdt.core.dom.AssertStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.Assignment;
+import org.aspectj.org.eclipse.jdt.core.dom.Block;
+import org.aspectj.org.eclipse.jdt.core.dom.CastExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.CatchClause;
+import org.aspectj.org.eclipse.jdt.core.dom.ClassInstanceCreation;
+import org.aspectj.org.eclipse.jdt.core.dom.ConditionalExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.ConstructorInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.CreationReference;
+import org.aspectj.org.eclipse.jdt.core.dom.Dimension;
+import org.aspectj.org.eclipse.jdt.core.dom.DoStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.EnhancedForStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.EnumConstantDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.EnumDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Expression;
+import org.aspectj.org.eclipse.jdt.core.dom.ExpressionMethodReference;
+import org.aspectj.org.eclipse.jdt.core.dom.ExpressionStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.ForStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.IfStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.InfixExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.InstanceofExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.IntersectionType;
+import org.aspectj.org.eclipse.jdt.core.dom.LabeledStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.LambdaExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.MarkerAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.MemberValuePair;
+import org.aspectj.org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.MethodInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.ParameterizedType;
+import org.aspectj.org.eclipse.jdt.core.dom.ParenthesizedExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.PostfixExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.PrefixExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.PrefixExpression.Operator;
+import org.aspectj.org.eclipse.jdt.core.dom.ReturnStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.SingleMemberAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Statement;
+import org.aspectj.org.eclipse.jdt.core.dom.SuperConstructorInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.SuperMethodInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.SuperMethodReference;
+import org.aspectj.org.eclipse.jdt.core.dom.SwitchCase;
+import org.aspectj.org.eclipse.jdt.core.dom.SwitchStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.SynchronizedStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.ThrowStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.TryStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.Type;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeMethodReference;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeParameter;
+import org.aspectj.org.eclipse.jdt.core.dom.UnionType;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.WhileStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.WildcardType;
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
+
+public class SpacePreparator extends ASTVisitor {
+ TokenManager tm;
+ private DefaultCodeFormatterOptions options;
+
+ public SpacePreparator(TokenManager tokenManager, DefaultCodeFormatterOptions options) {
+ this.tm = tokenManager;
+ this.options = options;
+ }
+
+ @Override
+ public boolean preVisit2(ASTNode node) {
+ boolean isMalformed = (node.getFlags() & ASTNode.MALFORMED) != 0;
+ return !isMalformed;
+ }
+
+ @Override
+ public boolean visit(TypeDeclaration node) {
+ if (node.getName().getStartPosition() == -1)
+ return true; // this is a fake type created by parsing in class body mode
+
+ handleToken(node.getName(), TokenNameIdentifier, true, false);
+
+ List<TypeParameter> typeParameters = node.typeParameters();
+ handleTypeParameters(typeParameters);
+
+ handleToken(node.getName(), TokenNameLBRACE,
+ this.options.insert_space_before_opening_brace_in_type_declaration, false);
+ handleCommas(node.superInterfaceTypes(), this.options.insert_space_before_comma_in_superinterfaces,
+ this.options.insert_space_after_comma_in_superinterfaces);
+ return true;
+ }
+
+ @Override
+ public boolean visit(EnumDeclaration node) {
+ handleToken(node.getName(), TokenNameLBRACE,
+ this.options.insert_space_before_opening_brace_in_enum_declaration, false);
+ handleCommas(node.enumConstants(), this.options.insert_space_before_comma_in_enum_declarations,
+ this.options.insert_space_after_comma_in_enum_declarations);
+ return true;
+ }
+
+ @Override
+ public boolean visit(EnumConstantDeclaration node) {
+ List<Expression> arguments = node.arguments();
+ Token openingParen = null;
+ if (!arguments.isEmpty()) {
+ openingParen = this.tm.firstTokenIn(node, TokenNameLPAREN);
+ if (this.options.insert_space_after_opening_paren_in_enum_constant)
+ openingParen.spaceAfter();
+ handleTokenAfter(arguments.get(arguments.size() - 1), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_enum_constant, false);
+ } else {
+ // look for empty parenthesis, may not be there
+ int from = this.tm.firstIndexIn(node.getName(), TokenNameIdentifier) + 1;
+ AnonymousClassDeclaration classDeclaration = node.getAnonymousClassDeclaration();
+ int to = classDeclaration != null ? this.tm.firstIndexBefore(classDeclaration, -1)
+ : this.tm.lastIndexIn(node, -1);
+ for (int i = from; i <= to; i++) {
+ if (this.tm.get(i).tokenType == TokenNameLPAREN) {
+ openingParen = this.tm.get(i);
+ if (this.options.insert_space_between_empty_parens_in_enum_constant)
+ openingParen.spaceAfter();
+ break;
+ }
+ }
+ }
+ if (openingParen != null && this.options.insert_space_before_opening_paren_in_enum_constant)
+ openingParen.spaceBefore();
+ handleCommas(arguments, this.options.insert_space_before_comma_in_enum_constant_arguments,
+ this.options.insert_space_after_comma_in_enum_constant_arguments);
+ return true;
+ }
+
+ @Override
+ public boolean visit(AnonymousClassDeclaration node) {
+ boolean spaceBeforeOpenBrace = this.options.insert_space_before_opening_brace_in_anonymous_type_declaration;
+ if (node.getParent() instanceof EnumConstantDeclaration)
+ spaceBeforeOpenBrace = this.options.insert_space_before_opening_brace_in_enum_constant;
+ handleToken(node, TokenNameLBRACE, spaceBeforeOpenBrace, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(MethodDeclaration node) {
+ handleToken(node.getName(), TokenNameIdentifier, true, false);
+
+ boolean spaceBeforeOpenParen = node.isConstructor()
+ ? this.options.insert_space_before_opening_paren_in_constructor_declaration
+ : this.options.insert_space_before_opening_paren_in_method_declaration;
+ boolean spaceAfterOpenParen = node.isConstructor()
+ ? this.options.insert_space_after_opening_paren_in_constructor_declaration
+ : this.options.insert_space_after_opening_paren_in_method_declaration;
+ boolean spaceBetweenEmptyParens = node.isConstructor()
+ ? this.options.insert_space_between_empty_parens_in_constructor_declaration
+ : this.options.insert_space_between_empty_parens_in_method_declaration;
+ if (handleEmptyParens(node.getName(), spaceBetweenEmptyParens)) {
+ handleToken(node.getName(), TokenNameLPAREN, spaceBeforeOpenParen, false);
+ } else {
+ handleToken(node.getName(), TokenNameLPAREN, spaceBeforeOpenParen, spaceAfterOpenParen);
+
+ if (node.isConstructor() ? this.options.insert_space_before_closing_paren_in_constructor_declaration
+ : this.options.insert_space_before_closing_paren_in_method_declaration)
+ handleToken(node.getName(), TokenNameRPAREN, true, false);
+ }
+
+ if ((node.isConstructor() ? this.options.insert_space_before_opening_brace_in_constructor_declaration
+ : this.options.insert_space_before_opening_brace_in_method_declaration) && node.getBody() != null)
+ this.tm.firstTokenIn(node.getBody(), TokenNameLBRACE).spaceBefore();
+
+ boolean beforeComma = node.isConstructor()
+ ? this.options.insert_space_before_comma_in_constructor_declaration_parameters
+ : this.options.insert_space_before_comma_in_method_declaration_parameters;
+ boolean afterComma = node.isConstructor()
+ ? this.options.insert_space_after_comma_in_constructor_declaration_parameters
+ : this.options.insert_space_after_comma_in_method_declaration_parameters;
+ handleCommas(node.parameters(), beforeComma, afterComma);
+
+ List<Type> thrownExceptionTypes = node.thrownExceptionTypes();
+ if (!thrownExceptionTypes.isEmpty()) {
+ this.tm.firstTokenBefore(thrownExceptionTypes.get(0), TokenNamethrows).spaceBefore();
+
+ beforeComma = node.isConstructor()
+ ? this.options.insert_space_before_comma_in_constructor_declaration_throws
+ : this.options.insert_space_before_comma_in_method_declaration_throws;
+ afterComma = node.isConstructor()
+ ? this.options.insert_space_after_comma_in_constructor_declaration_throws
+ : this.options.insert_space_after_comma_in_method_declaration_throws;
+ handleCommas(thrownExceptionTypes, beforeComma, afterComma);
+ }
+
+ List<TypeParameter> typeParameters = node.typeParameters();
+ if (!typeParameters.isEmpty()) {
+ handleTypeParameters(typeParameters);
+ handleTokenBefore(typeParameters.get(0), TokenNameLESS, true, false);
+ handleTokenAfter(typeParameters.get(typeParameters.size() - 1), TokenNameGREATER, false, true);
+ }
+ return true;
+ }
+
+ private void handleTypeParameters(List<TypeParameter> typeParameters) {
+ if (!typeParameters.isEmpty()) {
+ handleTokenBefore(typeParameters.get(0), TokenNameLESS,
+ this.options.insert_space_before_opening_angle_bracket_in_type_parameters,
+ this.options.insert_space_after_opening_angle_bracket_in_type_parameters);
+ handleTokenAfter(typeParameters.get(typeParameters.size() - 1), TokenNameGREATER,
+ this.options.insert_space_before_closing_angle_bracket_in_type_parameters,
+ this.options.insert_space_after_closing_angle_bracket_in_type_parameters);
+ handleCommas(typeParameters, this.options.insert_space_before_comma_in_type_parameters,
+ this.options.insert_space_after_comma_in_type_parameters);
+ }
+ }
+
+ @Override
+ public boolean visit(FieldDeclaration node) {
+ handleToken((ASTNode) node.fragments().get(0), TokenNameIdentifier, true, false);
+ handleCommas(node.fragments(), this.options.insert_space_before_comma_in_multiple_field_declarations,
+ this.options.insert_space_after_comma_in_multiple_field_declarations);
+ return true;
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationStatement node) {
+ handleToken((ASTNode) node.fragments().get(0), TokenNameIdentifier, true, false);
+ handleCommas(node.fragments(), this.options.insert_space_before_comma_in_multiple_local_declarations,
+ this.options.insert_space_after_comma_in_multiple_local_declarations);
+ return true;
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationFragment node) {
+ if (node.getInitializer() != null) {
+ handleToken(node.getName(), TokenNameEQUAL, this.options.insert_space_before_assignment_operator,
+ this.options.insert_space_after_assignment_operator);
+ }
+ return true;
+ }
+
+ @Override
+ public void endVisit(SingleVariableDeclaration node) {
+ // this must be endVisit in case a space added by a visit on a child node needs to be cleared
+ if (node.isVarargs()) {
+ handleTokenBefore(node.getName(), TokenNameELLIPSIS, this.options.insert_space_before_ellipsis,
+ this.options.insert_space_after_ellipsis);
+ List<Annotation> varargsAnnotations = node.varargsAnnotations();
+ if (!varargsAnnotations.isEmpty()) {
+ this.tm.firstTokenIn(varargsAnnotations.get(0), TokenNameAT).spaceBefore();
+ this.tm.lastTokenIn(varargsAnnotations.get(varargsAnnotations.size() - 1), -1).clearSpaceAfter();
+ }
+ } else {
+ handleToken(node.getName(), TokenNameIdentifier, true, false);
+ }
+ }
+
+ @Override
+ public boolean visit(SwitchStatement node) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_switch,
+ this.options.insert_space_after_opening_paren_in_switch);
+ handleTokenAfter(node.getExpression(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_switch, false);
+ handleTokenAfter(node.getExpression(), TokenNameLBRACE,
+ this.options.insert_space_before_opening_brace_in_switch, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(SwitchCase node) {
+ if (node.isDefault()) {
+ handleToken(node, TokenNameCOLON, this.options.insert_space_before_colon_in_default, false);
+ } else {
+ handleToken(node, TokenNamecase, false, true);
+ handleToken(node.getExpression(), TokenNameCOLON, this.options.insert_space_before_colon_in_case, false);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(DoStatement node) {
+ handleTokenBefore(node.getExpression(), TokenNameLPAREN,
+ this.options.insert_space_before_opening_paren_in_while,
+ this.options.insert_space_after_opening_paren_in_while);
+ handleTokenBefore(node.getExpression(), TokenNamewhile,
+ !(node.getBody() instanceof Block) || this.options.insert_space_after_closing_brace_in_block, false);
+ handleTokenAfter(node.getExpression(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_while, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(WhileStatement node) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_while,
+ this.options.insert_space_after_opening_paren_in_while);
+ handleTokenBefore(node.getBody(), TokenNameRPAREN, this.options.insert_space_before_closing_paren_in_while,
+ false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(SynchronizedStatement node) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_synchronized,
+ this.options.insert_space_after_opening_paren_in_synchronized);
+ handleTokenBefore(node.getBody(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_synchronized, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(TryStatement node) {
+ List<VariableDeclarationExpression> resources = node.resources();
+ if (!resources.isEmpty()) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_try,
+ this.options.insert_space_after_opening_paren_in_try);
+ handleTokenBefore(node.getBody(), TokenNameRPAREN, this.options.insert_space_before_closing_paren_in_try,
+ false);
+ for (int i = 1; i < resources.size(); i++) {
+ handleTokenBefore(resources.get(i), TokenNameSEMICOLON,
+ this.options.insert_space_before_semicolon_in_try_resources,
+ this.options.insert_space_after_semicolon_in_try_resources);
+ }
+ // there can be a semicolon after the last resource
+ int index = this.tm.firstIndexAfter(resources.get(resources.size() - 1), -1);
+ while (index < this.tm.size()) {
+ Token token = this.tm.get(index++);
+ if (token.tokenType == TokenNameSEMICOLON) {
+ handleToken(token, this.options.insert_space_before_semicolon_in_try_resources, false);
+ } else if (token.tokenType == TokenNameRPAREN) {
+ break;
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(CatchClause node) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_catch,
+ this.options.insert_space_after_opening_paren_in_catch);
+ handleTokenBefore(node.getBody(), TokenNameRPAREN, this.options.insert_space_before_closing_paren_in_catch,
+ false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(AssertStatement node) {
+ if (node.getMessage() != null) {
+ handleTokenBefore(node.getMessage(), TokenNameCOLON, this.options.insert_space_before_colon_in_assert,
+ this.options.insert_space_after_colon_in_assert);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(ReturnStatement node) {
+ if (node.getExpression() != null) {
+ int returnTokenIndex = this.tm.firstIndexIn(node, TokenNamereturn);
+ if (!(node.getExpression() instanceof ParenthesizedExpression)
+ || this.options.insert_space_before_parenthesized_expression_in_return) {
+ this.tm.get(returnTokenIndex).spaceAfter();
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(ThrowStatement node) {
+ int returnTokenIndex = this.tm.firstIndexIn(node, TokenNamethrow);
+ if (this.tm.get(returnTokenIndex + 1).tokenType != TokenNameLPAREN
+ || this.options.insert_space_before_parenthesized_expression_in_throw) {
+ this.tm.get(returnTokenIndex).spaceAfter();
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(LabeledStatement node) {
+ handleToken(node, TokenNameCOLON, this.options.insert_space_before_colon_in_labeled_statement,
+ this.options.insert_space_after_colon_in_labeled_statement);
+ return true;
+ }
+
+ @Override
+ public boolean visit(AnnotationTypeDeclaration node) {
+ handleToken(node, TokenNameAT, this.options.insert_space_before_at_in_annotation_type_declaration,
+ this.options.insert_space_after_at_in_annotation_type_declaration);
+ handleToken(node.getName(), TokenNameLBRACE,
+ this.options.insert_space_before_opening_brace_in_annotation_type_declaration, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(AnnotationTypeMemberDeclaration node) {
+ handleToken(node.getName(), TokenNameLPAREN,
+ this.options.insert_space_before_opening_paren_in_annotation_type_member_declaration, false);
+ handleEmptyParens(node.getName(),
+ this.options.insert_space_between_empty_parens_in_annotation_type_member_declaration);
+ if (node.getDefault() != null)
+ handleTokenBefore(node.getDefault(), TokenNamedefault, true, true);
+ return true;
+ }
+
+ @Override
+ public boolean visit(NormalAnnotation node) {
+ handleAnnotation(node, true);
+ handleCommas(node.values(), this.options.insert_space_before_comma_in_annotation,
+ this.options.insert_space_after_comma_in_annotation);
+ return true;
+ }
+
+ @Override
+ public boolean visit(MemberValuePair node) {
+ handleToken(node, TokenNameEQUAL, this.options.insert_space_before_assignment_operator,
+ this.options.insert_space_after_assignment_operator);
+ return true;
+ }
+
+ @Override
+ public boolean visit(SingleMemberAnnotation node) {
+ handleAnnotation(node, true);
+ return true;
+ }
+
+ @Override
+ public boolean visit(MarkerAnnotation node) {
+ handleAnnotation(node, false);
+ return true;
+ }
+
+ private void handleAnnotation(Annotation node, boolean handleParenthesis) {
+ handleToken(node, TokenNameAT, false, this.options.insert_space_after_at_in_annotation);
+ if (handleParenthesis) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_annotation,
+ this.options.insert_space_after_opening_paren_in_annotation);
+ handleToken(node, TokenNameRPAREN, this.options.insert_space_before_closing_paren_in_annotation, false);
+ }
+
+ ASTNode parent = node.getParent();
+ if (!(parent instanceof Annotation) && !(parent instanceof ArrayInitializer))
+ this.tm.lastTokenIn(node, -1).spaceAfter();
+ }
+
+ @Override
+ public boolean visit(LambdaExpression node) {
+ handleToken(node, TokenNameARROW, this.options.insert_space_before_lambda_arrow,
+ this.options.insert_space_after_lambda_arrow);
+ List<VariableDeclaration> parameters = node.parameters();
+ if (node.hasParentheses()) {
+ if (handleEmptyParens(node, this.options.insert_space_between_empty_parens_in_method_declaration)) {
+ handleToken(node, TokenNameLPAREN,
+ this.options.insert_space_before_opening_paren_in_method_declaration, false);
+ } else {
+ handleToken(node, TokenNameLPAREN,
+ this.options.insert_space_before_opening_paren_in_method_declaration,
+ this.options.insert_space_after_opening_paren_in_method_declaration);
+
+ handleToken(node, TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_method_declaration, false);
+ }
+ handleCommas(parameters, this.options.insert_space_before_comma_in_method_declaration_parameters,
+ this.options.insert_space_after_comma_in_method_declaration_parameters);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(Block node) {
+ if (node.getParent().getLength() == 0)
+ return true; // this is a fake block created by parsing in statements mode
+ if (node.getParent() instanceof MethodDeclaration)
+ return true; // spaces handled in #visit(MethodDeclaration)
+
+ handleToken(node, TokenNameLBRACE, this.options.insert_space_before_opening_brace_in_block, false);
+ if (this.options.insert_space_after_closing_brace_in_block) {
+ int closeBraceIndex = this.tm.lastIndexIn(node, TokenNameRBRACE);
+ if (closeBraceIndex + 1 < this.tm.size()) {
+ int nextToken = this.tm.get(closeBraceIndex + 1).tokenType;
+ if (nextToken != TokenNameSEMICOLON && nextToken != TokenNameRPAREN)
+ this.tm.get(closeBraceIndex).spaceAfter();
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(IfStatement node) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_if,
+ this.options.insert_space_after_opening_paren_in_if);
+ handleTokenBefore(node.getThenStatement(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_if, true);
+
+ Statement thenStatement = node.getThenStatement();
+ if (thenStatement instanceof Block && this.tm.isGuardClause((Block) node.getThenStatement())) {
+ handleToken(thenStatement, TokenNameLBRACE, false, true);
+ this.tm.lastTokenIn(node, TokenNameRBRACE).spaceBefore();
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(ForStatement node) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_for,
+ this.options.insert_space_after_opening_paren_in_for);
+ handleTokenBefore(node.getBody(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_for, false);
+ handleCommas(node.initializers(), this.options.insert_space_before_comma_in_for_inits,
+ this.options.insert_space_after_comma_in_for_inits);
+ handleCommas(node.updaters(), this.options.insert_space_before_comma_in_for_increments,
+ this.options.insert_space_after_comma_in_for_increments);
+
+ boolean part1Empty = node.initializers().isEmpty();
+ boolean part2Empty = node.getExpression() == null;
+ boolean part3Empty = node.updaters().isEmpty();
+ handleToken(node, TokenNameSEMICOLON, this.options.insert_space_before_semicolon_in_for && !part1Empty,
+ this.options.insert_space_after_semicolon_in_for && !part2Empty);
+ handleTokenBefore(node.getBody(), TokenNameSEMICOLON,
+ this.options.insert_space_before_semicolon_in_for && !part2Empty,
+ this.options.insert_space_after_semicolon_in_for && !part3Empty);
+ return true;
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationExpression node) {
+ ASTNode parent = node.getParent();
+ if (parent instanceof ForStatement) {
+ handleCommas(node.fragments(), this.options.insert_space_before_comma_in_for_inits,
+ this.options.insert_space_after_comma_in_for_inits);
+ } else if (parent instanceof ExpressionStatement) {
+ handleCommas(node.fragments(), this.options.insert_space_before_comma_in_multiple_local_declarations,
+ this.options.insert_space_after_comma_in_multiple_local_declarations);
+ }
+ this.tm.firstTokenAfter(node.getType(), -1).spaceBefore();
+ return true;
+ }
+
+ @Override
+ public boolean visit(EnhancedForStatement node) {
+ handleToken(node, TokenNameLPAREN, this.options.insert_space_before_opening_paren_in_for,
+ this.options.insert_space_after_opening_paren_in_for);
+ handleTokenBefore(node.getBody(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_for, false);
+ handleTokenAfter(node.getParameter(), TokenNameCOLON, this.options.insert_space_before_colon_in_for,
+ this.options.insert_space_after_colon_in_for);
+ return true;
+ }
+
+ @Override
+ public boolean visit(MethodInvocation node) {
+ handleTypeArguments(node.typeArguments());
+ handleInvocation(node, node.getName(), node.typeArguments());
+ handleCommas(node.arguments(), this.options.insert_space_before_comma_in_method_invocation_arguments,
+ this.options.insert_space_after_comma_in_method_invocation_arguments);
+ return true;
+ }
+
+ @Override
+ public boolean visit(SuperMethodInvocation node) {
+ handleInvocation(node, node.getName(), node.typeArguments());
+ handleCommas(node.arguments(), this.options.insert_space_before_comma_in_method_invocation_arguments,
+ this.options.insert_space_after_comma_in_method_invocation_arguments);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ClassInstanceCreation node) {
+ handleInvocation(node, node.getType(), node.typeArguments());
+ handleCommas(node.arguments(), this.options.insert_space_before_comma_in_allocation_expression,
+ this.options.insert_space_after_comma_in_allocation_expression);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ConstructorInvocation node) {
+ handleInvocation(node, node, node.typeArguments());
+ handleCommas(node.arguments(),
+ this.options.insert_space_before_comma_in_explicit_constructor_call_arguments,
+ this.options.insert_space_after_comma_in_explicit_constructor_call_arguments);
+ return true;
+ }
+
+ @Override
+ public boolean visit(SuperConstructorInvocation node) {
+ handleInvocation(node, node, node.typeArguments());
+ handleCommas(node.arguments(),
+ this.options.insert_space_before_comma_in_explicit_constructor_call_arguments,
+ this.options.insert_space_after_comma_in_explicit_constructor_call_arguments);
+ return true;
+ }
+
+ private void handleInvocation(ASTNode invocationNode, ASTNode nodeBeforeOpeningParen, List<Type> typeArguments) {
+ if (handleEmptyParens(nodeBeforeOpeningParen,
+ this.options.insert_space_between_empty_parens_in_method_invocation)) {
+ handleToken(nodeBeforeOpeningParen, TokenNameLPAREN,
+ this.options.insert_space_before_opening_paren_in_method_invocation, false);
+ } else {
+ handleToken(nodeBeforeOpeningParen, TokenNameLPAREN,
+ this.options.insert_space_before_opening_paren_in_method_invocation,
+ this.options.insert_space_after_opening_paren_in_method_invocation);
+ if (this.options.insert_space_before_closing_paren_in_method_invocation) {
+ this.tm.lastTokenIn(invocationNode, TokenNameRPAREN).spaceBefore();
+ }
+ }
+
+ if (!typeArguments.isEmpty()) {
+ handleTokenAfter(typeArguments.get(typeArguments.size() - 1), TokenNameGREATER, false,
+ this.options.insert_space_after_closing_angle_bracket_in_type_arguments);
+ handleCommas(typeArguments,
+ this.options.insert_space_before_comma_in_parameterized_type_reference,
+ this.options.insert_space_after_comma_in_parameterized_type_reference);
+ }
+ }
+
+ @Override
+ public boolean visit(Assignment node) {
+ handleOperator(node.getOperator().toString(), node.getRightHandSide(),
+ this.options.insert_space_before_assignment_operator,
+ this.options.insert_space_after_assignment_operator);
+ return true;
+ }
+
+ @Override
+ public boolean visit(InfixExpression node) {
+ String operator = node.getOperator().toString();
+ handleOperator(operator, node.getRightOperand(), this.options.insert_space_before_binary_operator,
+ this.options.insert_space_after_binary_operator);
+ List<Expression> extendedOperands = node.extendedOperands();
+ for (Expression operand : extendedOperands) {
+ handleOperator(operator, operand, this.options.insert_space_before_binary_operator,
+ this.options.insert_space_after_binary_operator);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(PrefixExpression node) {
+ Operator operator = node.getOperator();
+ if (operator.equals(Operator.INCREMENT) || operator.equals(Operator.DECREMENT)) {
+ handleOperator(operator.toString(), node.getOperand(),
+ this.options.insert_space_before_prefix_operator,
+ this.options.insert_space_after_prefix_operator);
+ } else {
+ handleOperator(operator.toString(), node.getOperand(), this.options.insert_space_before_unary_operator,
+ this.options.insert_space_after_unary_operator);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(PostfixExpression node) {
+ if (this.options.insert_space_before_postfix_operator || this.options.insert_space_after_postfix_operator) {
+ String operator = node.getOperator().toString();
+ int i = this.tm.firstIndexAfter(node.getOperand(), -1);
+ while (!operator.equals(this.tm.toString(i))) {
+ i++;
+ }
+ handleToken(this.tm.get(i), this.options.insert_space_before_postfix_operator,
+ this.options.insert_space_after_postfix_operator);
+ }
+ return true;
+ }
+
+ private void handleOperator(String operator, ASTNode nodeAfter, boolean spaceBefore, boolean spaceAfter) {
+ if (spaceBefore || spaceAfter) {
+ int i = this.tm.firstIndexBefore(nodeAfter, -1);
+ while (!operator.equals(this.tm.toString(i))) {
+ i--;
+ }
+ handleToken(this.tm.get(i), spaceBefore, spaceAfter);
+ }
+ }
+
+ @Override
+ public boolean visit(ParenthesizedExpression node) {
+ handleToken(node, TokenNameLPAREN,
+ this.options.insert_space_before_opening_paren_in_parenthesized_expression,
+ this.options.insert_space_after_opening_paren_in_parenthesized_expression);
+ handleTokenAfter(node.getExpression(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_parenthesized_expression, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(CastExpression node) {
+ handleToken(node, TokenNameLPAREN, false, this.options.insert_space_after_opening_paren_in_cast);
+ handleTokenBefore(node.getExpression(), TokenNameRPAREN,
+ this.options.insert_space_before_closing_paren_in_cast,
+ this.options.insert_space_after_closing_paren_in_cast);
+ return true;
+ }
+
+ @Override
+ public boolean visit(IntersectionType node) {
+ List<Type> types = node.types();
+ for (int i = 1; i < types.size(); i++)
+ handleTokenBefore(types.get(i), TokenNameAND, this.options.insert_space_before_binary_operator,
+ this.options.insert_space_after_binary_operator);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ConditionalExpression node) {
+ handleTokenBefore(node.getThenExpression(), TokenNameQUESTION,
+ this.options.insert_space_before_question_in_conditional,
+ this.options.insert_space_after_question_in_conditional);
+ handleTokenBefore(node.getElseExpression(), TokenNameCOLON,
+ this.options.insert_space_before_colon_in_conditional,
+ this.options.insert_space_after_colon_in_conditional);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ArrayType node) {
+ ASTNode parent = node.getParent();
+ boolean spaceBeofreOpening, spaceBetween;
+ if (parent instanceof ArrayCreation) {
+ spaceBeofreOpening = this.options.insert_space_before_opening_bracket_in_array_allocation_expression;
+ spaceBetween = this.options.insert_space_between_empty_brackets_in_array_allocation_expression;
+ } else {
+ spaceBeofreOpening = this.options.insert_space_before_opening_bracket_in_array_type_reference;
+ spaceBetween = this.options.insert_space_between_brackets_in_array_type_reference;
+ }
+ List<Dimension> dimensions = node.dimensions();
+ for (Dimension dimension : dimensions) {
+ handleToken(dimension, TokenNameLBRACKET, spaceBeofreOpening, false);
+ handleEmptyBrackets(dimension, spaceBetween);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(ArrayAccess node) {
+ handleTokenBefore(node.getIndex(), TokenNameLBRACKET,
+ this.options.insert_space_before_opening_bracket_in_array_reference,
+ this.options.insert_space_after_opening_bracket_in_array_reference);
+ handleTokenAfter(node.getIndex(), TokenNameRBRACKET,
+ this.options.insert_space_before_closing_bracket_in_array_reference, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ArrayCreation node) {
+ List<Expression> dimensions = node.dimensions();
+ for (Expression dimension : dimensions) {
+ handleTokenBefore(dimension, TokenNameLBRACKET, false,
+ this.options.insert_space_after_opening_bracket_in_array_allocation_expression);
+ handleTokenAfter(dimension, TokenNameRBRACKET,
+ this.options.insert_space_before_closing_bracket_in_array_allocation_expression, false);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(ArrayInitializer node) {
+ int openingBraceIndex = this.tm.firstIndexIn(node, TokenNameLBRACE);
+ int closingBraceIndex = this.tm.lastIndexIn(node, TokenNameRBRACE);
+ Token lastToken = this.tm.get(closingBraceIndex - 1);
+ if (lastToken.tokenType == TokenNameLBRACE) {
+ handleToken(this.tm.get(openingBraceIndex),
+ this.options.insert_space_before_opening_brace_in_array_initializer
+ && !(node.getParent() instanceof ArrayInitializer)
+ && !(node.getParent() instanceof SingleMemberAnnotation),
+ this.options.insert_space_between_empty_braces_in_array_initializer);
+ } else {
+ boolean endsWithComma = lastToken.tokenType == TokenNameCOMMA;
+ handleToken(this.tm.get(openingBraceIndex),
+ this.options.insert_space_before_opening_brace_in_array_initializer
+ && !(node.getParent() instanceof ArrayInitializer)
+ && !(node.getParent() instanceof SingleMemberAnnotation),
+ this.options.insert_space_after_opening_brace_in_array_initializer
+ && !(endsWithComma && node.expressions().isEmpty()));
+ handleCommas(node.expressions(), this.options.insert_space_before_comma_in_array_initializer,
+ this.options.insert_space_after_comma_in_array_initializer);
+ if (endsWithComma) {
+ handleToken(lastToken, this.options.insert_space_before_comma_in_array_initializer,
+ false); //this.options.insert_space_after_comma_in_array_initializer);
+ }
+ handleToken(this.tm.get(closingBraceIndex),
+ this.options.insert_space_before_closing_brace_in_array_initializer
+ && !(endsWithComma && node.expressions().isEmpty()), false);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(ParameterizedType node) {
+ handleTokenAfter(node.getType(), TokenNameLESS,
+ this.options.insert_space_before_opening_angle_bracket_in_parameterized_type_reference,
+ this.options.insert_space_after_opening_angle_bracket_in_parameterized_type_reference);
+ List<Type> typeArguments = node.typeArguments();
+ if (typeArguments.isEmpty()) {
+ handleTokenAfter(node.getType(), TokenNameGREATER,
+ this.options.insert_space_before_closing_angle_bracket_in_parameterized_type_reference, false);
+ } else {
+ handleTokenAfter(typeArguments.get(typeArguments.size() - 1), TokenNameGREATER,
+ this.options.insert_space_before_closing_angle_bracket_in_parameterized_type_reference, false);
+ handleCommas(node.typeArguments(),
+ this.options.insert_space_before_comma_in_parameterized_type_reference,
+ this.options.insert_space_after_comma_in_parameterized_type_reference);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(TypeParameter node) {
+ List<Type> typeBounds = node.typeBounds();
+ for (int i = 1; i < typeBounds.size(); i++) {
+ handleTokenBefore(typeBounds.get(i), TokenNameAND,
+ this.options.insert_space_before_and_in_type_parameter,
+ this.options.insert_space_after_and_in_type_parameter);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(WildcardType node) {
+ handleToken(node, TokenNameQUESTION, this.options.insert_space_before_question_in_wilcard,
+ this.options.insert_space_after_question_in_wilcard || node.getBound() != null);
+ return true;
+ }
+
+ @Override
+ public boolean visit(UnionType node) {
+ List<Type> types = node.types();
+ for (int i = 1; i < types.size(); i++)
+ handleTokenBefore(types.get(i), TokenNameOR, this.options.insert_space_before_binary_operator,
+ this.options.insert_space_after_binary_operator);
+ return true;
+ }
+
+ @Override
+ public boolean visit(Dimension node) {
+ List<Annotation> annotations = node.annotations();
+ if (!annotations.isEmpty())
+ handleToken(annotations.get(0), TokenNameAT, true, false);
+ return true;
+ }
+
+ @Override
+ public boolean visit(TypeMethodReference node) {
+ handleTypeArguments(node.typeArguments());
+ return true;
+ }
+
+ @Override
+ public boolean visit(ExpressionMethodReference node) {
+ handleTypeArguments(node.typeArguments());
+ return true;
+ }
+
+ @Override
+ public boolean visit(SuperMethodReference node) {
+ handleTypeArguments(node.typeArguments());
+ return true;
+ }
+
+ @Override
+ public boolean visit(CreationReference node) {
+ handleTypeArguments(node.typeArguments());
+ return true;
+ }
+
+ private void handleTypeArguments(List<Type> typeArguments) {
+ if (typeArguments.isEmpty())
+ return;
+ handleTokenBefore(typeArguments.get(0), TokenNameLESS,
+ this.options.insert_space_before_opening_angle_bracket_in_type_arguments,
+ this.options.insert_space_after_opening_angle_bracket_in_type_arguments);
+ handleTokenAfter(typeArguments.get(typeArguments.size() - 1), TokenNameGREATER,
+ this.options.insert_space_before_closing_angle_bracket_in_type_arguments,
+ this.options.insert_space_after_closing_angle_bracket_in_type_arguments);
+ handleCommas(typeArguments, this.options.insert_space_before_comma_in_type_arguments,
+ this.options.insert_space_after_comma_in_type_arguments);
+ }
+
+ @Override
+ public boolean visit(InstanceofExpression node) {
+ handleTokenAfter(node.getLeftOperand(), TokenNameinstanceof, true, true);
+ return true;
+ }
+
+ private void handleCommas(List<? extends ASTNode> nodes, boolean spaceBefore, boolean spaceAfter) {
+ if (spaceBefore || spaceAfter) {
+ for (int i = 1; i < nodes.size(); i++) {
+ handleTokenBefore(nodes.get(i), TokenNameCOMMA, spaceBefore, spaceAfter);
+ }
+ }
+ }
+
+ private void handleToken(ASTNode node, int tokenType, boolean spaceBefore, boolean spaceAfter) {
+ if (spaceBefore || spaceAfter) {
+ Token token = this.tm.get(this.tm.findIndex(node.getStartPosition(), tokenType, true));
+ handleToken(token, spaceBefore, spaceAfter);
+ }
+ }
+
+ private void handleTokenBefore(ASTNode node, int tokenType, boolean spaceBefore, boolean spaceAfter) {
+ if (spaceBefore || spaceAfter) {
+ Token token = this.tm.firstTokenBefore(node, tokenType);
+ handleToken(token, spaceBefore, spaceAfter);
+ }
+ }
+
+ private void handleTokenAfter(ASTNode node, int tokenType, boolean spaceBefore, boolean spaceAfter) {
+ if (spaceBefore || spaceAfter) {
+ if (tokenType == TokenNameGREATER) {
+ // there could be ">>" or ">>>" instead, get rid of them
+ int index = this.tm.lastIndexIn(node, -1);
+ for (int i = index; i < index + 2; i++) {
+ Token token = this.tm.get(i);
+ if (token.tokenType == TokenNameRIGHT_SHIFT || token.tokenType == TokenNameUNSIGNED_RIGHT_SHIFT) {
+ this.tm.remove(i);
+ for (int j = 0; j < (token.tokenType == TokenNameRIGHT_SHIFT ? 2 : 3); j++) {
+ this.tm.insert(i + j, new Token(token.originalStart + j, token.originalStart + j,
+ TokenNameGREATER));
+ }
+ }
+ }
+ }
+ Token token = this.tm.firstTokenAfter(node, tokenType);
+ handleToken(token, spaceBefore, spaceAfter);
+ }
+ }
+
+ private void handleToken(Token token, boolean spaceBefore, boolean spaceAfter) {
+ if (spaceBefore)
+ token.spaceBefore();
+ if (spaceAfter)
+ token.spaceAfter();
+ }
+
+ private boolean handleEmptyParens(ASTNode nodeBeforeParens, boolean insertSpace) {
+ int openingIndex = this.tm.findIndex(nodeBeforeParens.getStartPosition(), TokenNameLPAREN, true);
+ if (this.tm.get(openingIndex + 1).tokenType == TokenNameRPAREN) {
+ if (insertSpace)
+ this.tm.get(openingIndex).spaceAfter();
+ return true;
+ }
+ return false;
+ }
+
+ private boolean handleEmptyBrackets(ASTNode nodeContainingBrackets, boolean insertSpace) {
+ int openingIndex = this.tm.firstIndexIn(nodeContainingBrackets, TokenNameLBRACKET);
+ if (this.tm.get(openingIndex + 1).tokenType == TokenNameRBRACKET) {
+ if (insertSpace)
+ this.tm.get(openingIndex).spaceAfter();
+ return true;
+ }
+ return false;
+ }
+
+ public void finishUp() {
+ this.tm.traverse(0, new TokenTraverser() {
+ boolean isPreviousJIDP = false;
+
+ @Override
+ protected boolean token(Token token, int index) {
+ // put space between consecutive keywords, numbers or identifiers
+ char c = SpacePreparator.this.tm.charAt(token.originalStart);
+ boolean isJIDP = ScannerHelper.isJavaIdentifierPart(c);
+ if ((isJIDP || c == '@') && this.isPreviousJIDP)
+ getPrevious().spaceAfter();
+ this.isPreviousJIDP = isJIDP;
+
+ switch (token.tokenType) {
+ case TokenNamePLUS:
+ if (getNext().tokenType == TokenNamePLUS || getNext().tokenType == TokenNamePLUS_PLUS)
+ token.spaceAfter();
+ break;
+ case TokenNameMINUS:
+ if (getNext().tokenType == TokenNameMINUS || getNext().tokenType == TokenNameMINUS_MINUS)
+ token.spaceAfter();
+ break;
+ }
+ return true;
+ }
+ });
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TextEditsBuilder.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TextEditsBuilder.java
new file mode 100644
index 0000000..71f673b
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TextEditsBuilder.java
@@ -0,0 +1,514 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameNotAToken;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameStringLiteral;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameWHITESPACE;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token.WrapPolicy;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Creates the formatter's result TextEdit by scanning through the tokens and comparing them with the original source.
+ */
+public class TextEditsBuilder extends TokenTraverser {
+
+ private final String source;
+ private List<IRegion> regions;
+ private TokenManager tm;
+ private final DefaultCodeFormatterOptions options;
+ private final StringBuilder buffer;
+
+ private final List<Token> stringLiteralsInLine = new ArrayList<Token>();
+ private final List<TextEdit> edits = new ArrayList<TextEdit>();
+
+ private int currentRegion = 0;
+
+ private TextEditsBuilder childBuilder;
+ private final TextEditsBuilder parent;
+ private int alignChar;
+ private int sourceLimit;
+ private int parentTokenIndex;
+
+ public TextEditsBuilder(String source, IRegion[] regions, TokenManager tokenManager,
+ DefaultCodeFormatterOptions options) {
+ this.source = source;
+ this.tm = tokenManager;
+ this.options = options;
+ this.regions = adaptRegions(regions);
+
+ this.alignChar = this.options.tab_char;
+ this.sourceLimit = source.length();
+ this.parent = null;
+
+ this.buffer = new StringBuilder();
+ }
+
+ private TextEditsBuilder(TextEditsBuilder parent) {
+ this.buffer = parent.buffer;
+ this.parent = parent;
+ this.source = parent.source;
+ this.options = parent.options;
+ this.regions = parent.regions;
+ this.alignChar = DefaultCodeFormatterOptions.SPACE;
+ }
+
+ private List<IRegion> adaptRegions(IRegion[] givenRegions) {
+ if (givenRegions == null)
+ return null;
+ // make sure regions don't begin or end inside multiline comments
+ ArrayList<IRegion> result = new ArrayList<IRegion>();
+ IRegion previous = null;
+ for (IRegion region : givenRegions) {
+ int start = region.getOffset();
+ int end = start + region.getLength() - 1;
+ int sourceStart = this.tm.get(0).originalStart;
+
+ if (start > sourceStart) {
+ Token token = this.tm.get(this.tm.findIndex(start, -1, false));
+ if ((token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC)
+ && start <= token.originalEnd) {
+ start = token.originalStart;
+ }
+ }
+
+ if (end > start && end > sourceStart) {
+ Token token = this.tm.get(this.tm.findIndex(end, -1, false));
+ if ((token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC)
+ && end < token.originalEnd) {
+ end = token.originalEnd;
+ }
+ }
+
+ if (previous != null && previous.getOffset() + previous.getLength() >= start) {
+ result.remove(result.size() - 1);
+ start = previous.getOffset();
+ }
+ if (end + 1 == this.source.length())
+ end++;
+ IRegion adapted = new Region(start, end - start + 1);
+ result.add(adapted);
+ previous = adapted;
+ }
+ return result;
+ }
+
+ @Override
+ protected boolean token(Token token, int index) {
+
+ bufferWhitespaceBefore(token, index);
+
+ List<Token> structure = token.getInternalStructure();
+ if (token.tokenType == TokenNameCOMMENT_LINE) {
+ handleSingleLineComment(token, index);
+ } else if (structure != null && !structure.isEmpty()) {
+ handleMultiLineComment(token, index);
+ } else {
+ flushBuffer(token.originalStart);
+ if (token.isToEscape()) {
+ this.buffer.append(this.tm.toString(token));
+ flushBuffer(token.originalEnd + 1);
+ } else {
+ this.counter = token.originalEnd + 1;
+ }
+ }
+
+ if (token.tokenType == TokenNameStringLiteral)
+ this.stringLiteralsInLine.add(token);
+
+ if (getNext() == null) {
+ for (int i = 0; i < token.getLineBreaksAfter(); i++)
+ bufferLineSeparator(null, i + 1 == token.getLineBreaksAfter());
+ char lastChar = this.source.charAt(this.sourceLimit - 1);
+ if (token.getLineBreaksAfter() == 0 && (lastChar == '\r' || lastChar == '\n'))
+ bufferLineSeparator(null, false);
+ flushBuffer(this.sourceLimit);
+ }
+ return true;
+ }
+
+ private void bufferWhitespaceBefore(Token token, int index) {
+ if (getLineBreaksBefore() > 0) {
+ this.stringLiteralsInLine.clear();
+ if (getLineBreaksBefore() > 1) {
+ Token indentToken = null;
+ if (this.options.indent_empty_lines && token.tokenType != TokenNameNotAToken)
+ indentToken = token.getIndent() > getPrevious().getIndent() ? token : getPrevious();
+ for (int i = 1; i < getLineBreaksBefore(); i++) {
+ bufferLineSeparator(token, true);
+ if (indentToken != null)
+ bufferIndent(indentToken, index);
+ }
+ }
+ bufferLineSeparator(token, false);
+ bufferAlign(token, index);
+ bufferIndent(token, index);
+ } else if (index == 0 && this.parent == null) {
+ bufferIndent(token, index);
+ } else {
+ bufferAlign(token, index);
+ if (isSpaceBefore() && token.getAlign() == 0)
+ this.buffer.append(' ');
+ }
+ }
+
+ private void bufferLineSeparator(Token token, boolean emptyLine) {
+ if (this.parent == null) {
+ this.buffer.append(this.options.line_separator);
+ return;
+ }
+
+ this.parent.counter = this.counter;
+ this.parent.bufferLineSeparator(null, false);
+ this.counter = this.parent.counter;
+
+ bufferIndent(this.parent.tm.get(this.parentTokenIndex), -1);
+
+ if (token != null && token.tokenType == TokenNameNotAToken)
+ return; // this is an unformatted block comment, don't force asterisk
+
+ if (getNext() == null && !emptyLine)
+ return; // this is the last token of block comment, asterisk is included
+
+ boolean asteriskFound = false;
+ int searchLimit = token != null ? token.originalStart : this.sourceLimit;
+ for (int i = this.counter; i < searchLimit; i++) {
+ char c = this.source.charAt(i);
+ if (c == '*') {
+ this.buffer.append(' ');
+ flushBuffer(i);
+ while (i + 1 < this.sourceLimit && this.source.charAt(i + 1) == '*')
+ i++;
+ this.counter = i + 1;
+ c = this.source.charAt(i + 1);
+ if ((c != '\r' && c != '\n') || !emptyLine)
+ this.buffer.append(' ');
+ asteriskFound = true;
+ break;
+ }
+ if (!ScannerHelper.isWhitespace(c))
+ break;
+ }
+ if (!asteriskFound)
+ this.buffer.append(" * "); //$NON-NLS-1$
+ }
+
+ private void bufferIndent(Token token, int index) {
+ int indent = token.getIndent();
+ int additionalSpaces = 0;
+ if (this.options.use_tabs_only_for_leading_indentations) {
+ // use indentation of wrap-line start token and add spaces to match current token
+ WrapPolicy wrapPolicy = token.getWrapPolicy();
+ int wrapRootIndent = indent;
+ if (index == -1) { // this means we print a line separator in a multi-line comment
+ TokenManager tm2 = this.parent.tm;
+ wrapRootIndent = tm2.get(tm2.findFirstTokenInLine(this.parentTokenIndex, true)).getIndent();
+ } else if (wrapPolicy != null) {
+ wrapRootIndent = this.tm.get(this.tm.findFirstTokenInLine(index, true)).getIndent();
+ }
+ additionalSpaces = indent - wrapRootIndent;
+ indent = wrapRootIndent;
+
+ if (wrapPolicy != null && wrapPolicy.isForced) {
+ int extraIndent = wrapPolicy.extraIndent;
+ additionalSpaces -= extraIndent;
+ indent += extraIndent;
+ }
+ }
+ appendIndentationString(this.buffer, this.options.tab_char, this.options.tab_size, indent, additionalSpaces);
+ }
+
+ public static void appendIndentationString(StringBuilder target, int tabChar, int tabSize, int indent,
+ int additionalSpaces) {
+ int spacesCount = additionalSpaces;
+ int tabsCount = 0;
+ switch (tabChar) {
+ case DefaultCodeFormatterOptions.SPACE:
+ spacesCount += indent;
+ break;
+ case DefaultCodeFormatterOptions.TAB:
+ if (tabSize > 0) {
+ tabsCount += indent / tabSize;
+ if (indent % tabSize > 0)
+ tabsCount++;
+ }
+ break;
+ case DefaultCodeFormatterOptions.MIXED:
+ if (tabSize > 0) {
+ tabsCount += indent / tabSize;
+ spacesCount += indent % tabSize;
+ } else {
+ spacesCount += indent;
+ }
+ break;
+ default:
+ throw new IllegalStateException("Unrecognized tab char: " + tabChar); //$NON-NLS-1$
+ }
+
+ char[] indentChars = new char[tabsCount + spacesCount];
+ Arrays.fill(indentChars, 0, tabsCount, '\t');
+ Arrays.fill(indentChars, tabsCount, indentChars.length, ' ');
+ target.append(indentChars);
+ }
+
+ private void bufferAlign(Token token, int index) {
+ int align = token.getAlign();
+ if (align == 0)
+ return;
+
+ int currentPositionInLine = 0;
+ if (getLineBreaksBefore() > 0) {
+ if (this.parent == null)
+ currentPositionInLine = this.tm.toIndent(token.getIndent(), token.getWrapPolicy() != null);
+ } else {
+ currentPositionInLine = this.tm.getPositionInLine(index - 1);
+ currentPositionInLine += this.tm.getLength(this.tm.get(index - 1), currentPositionInLine);
+ }
+
+ final int tabSize = this.options.tab_size;
+ switch (this.alignChar) {
+ case DefaultCodeFormatterOptions.SPACE:
+ while (currentPositionInLine++ < align) {
+ this.buffer.append(' ');
+ }
+ break;
+ case DefaultCodeFormatterOptions.TAB:
+ while (currentPositionInLine < align && tabSize > 0) {
+ this.buffer.append('\t');
+ currentPositionInLine += tabSize - currentPositionInLine % tabSize;
+ }
+ break;
+ case DefaultCodeFormatterOptions.MIXED:
+ while (tabSize > 0 && currentPositionInLine + tabSize - currentPositionInLine % tabSize <= align) {
+ this.buffer.append('\t');
+ currentPositionInLine += tabSize - currentPositionInLine % tabSize;
+ }
+ while (currentPositionInLine++ < align) {
+ this.buffer.append(' ');
+ }
+ break;
+ default:
+ throw new IllegalStateException("Unrecognized align char: " + this.alignChar); //$NON-NLS-1$
+ }
+ }
+
+ private void flushBuffer(int currentPosition) {
+ String buffered = this.buffer.toString();
+ boolean sourceMatch = this.source.startsWith(buffered, this.counter)
+ && this.counter + buffered.length() == currentPosition;
+ if (!sourceMatch && checkRegions(this.counter, currentPosition)) {
+ TextEdit edit = getReplaceEdit(this.counter, currentPosition, buffered);
+ this.edits.add(edit);
+ }
+ this.buffer.setLength(0);
+ this.counter = currentPosition;
+ }
+
+ private boolean checkRegions(int editStart, int editEnd) {
+ while (true) {
+ if (this.currentRegion >= this.regions.size())
+ return false;
+ IRegion region = this.regions.get(this.currentRegion);
+ if (editEnd < region.getOffset())
+ return false;
+ if (editStart < region.getOffset() + region.getLength())
+ return true;
+ this.currentRegion++;
+ }
+ }
+
+ private TextEdit getReplaceEdit(int editStart, int editEnd, String text) {
+ IRegion region = this.regions.get(this.currentRegion);
+ int regionEnd = region.getOffset() + region.getLength();
+ if (editStart < region.getOffset() && regionEnd < editEnd) {
+ int breaksInReplacement = this.tm.countLineBreaksBetween(text, 0, text.length());
+ int breaksBeforeRegion = this.tm.countLineBreaksBetween(this.source, editStart, region.getOffset());
+ int breaksAfterRegion = this.tm.countLineBreaksBetween(this.source, regionEnd, editEnd);
+ if (breaksBeforeRegion + breaksAfterRegion > breaksInReplacement) {
+ text = ""; //$NON-NLS-1$
+ editStart = region.getOffset();
+ editEnd = regionEnd;
+ }
+ }
+ if (region.getOffset() > editStart && isOnlyWhitespace(text)) {
+ int breaksInReplacement = this.tm.countLineBreaksBetween(text, 0, text.length());
+ int breaksOutsideRegion = this.tm.countLineBreaksBetween(this.source, editStart, region.getOffset());
+ int breaksToPreserve = breaksInReplacement - breaksOutsideRegion;
+ text = adaptReplaceText(text, breaksToPreserve, false, region.getOffset() - 1);
+ editStart = region.getOffset();
+ }
+ if (regionEnd < editEnd && isOnlyWhitespace(text)) {
+ int breaksInReplacement = this.tm.countLineBreaksBetween(text, 0, text.length());
+ int breaksOutsideRegion = this.tm.countLineBreaksBetween(this.source, regionEnd, editEnd);
+ int breaksToPreserve = breaksInReplacement - breaksOutsideRegion;
+ text = adaptReplaceText(text, breaksToPreserve, true, regionEnd);
+ editEnd = regionEnd;
+ }
+ return new ReplaceEdit(editStart, editEnd - editStart, text);
+ }
+
+ private boolean isOnlyWhitespace(String text) {
+ for (int i = 0; i < text.length(); i++)
+ if (!ScannerHelper.isWhitespace(text.charAt(i)))
+ return false;
+ return true;
+ }
+
+ private String adaptReplaceText(String text, int breaksToPreserve, boolean isRegionEnd, int regionEdge) {
+ int i = isRegionEnd ? 0 : text.length() - 1;
+ int direction = isRegionEnd ? 1 : -1;
+ int preservedBreaks = 0;
+ for (; i >= 0 && i < text.length(); i += direction) {
+ assert ScannerHelper.isWhitespace(text.charAt(i));
+ char c1 = text.charAt(i);
+ if (c1 == '\r' || c1 == '\n') {
+ if (preservedBreaks >= breaksToPreserve)
+ break;
+ preservedBreaks++;
+ int i2 = i + direction;
+ if (i2 >= 0 && i2 < text.length()) {
+ char c2 = text.charAt(i2);
+ if ((c2 == '\r' || c2 == '\n') && c2 != c1)
+ i = i2;
+ }
+ }
+ }
+ text = isRegionEnd ? text.substring(0, i) : text.substring(i + 1);
+
+ // cut out text if the source outside region is a matching whitespace
+ int textPos = isRegionEnd ? text.length() - 1 : 0;
+ int sourcePos = regionEdge;
+ theLoop: while (textPos >= 0 && textPos < text.length() && sourcePos >= 0 && sourcePos < this.source.length()) {
+ char c1 = text.charAt(textPos);
+ char c2 = this.source.charAt(sourcePos);
+ if (c1 == c2 && (c1 == ' ' || c1 == '\t')) {
+ textPos -= direction;
+ sourcePos += direction;
+ } else if (c1 == '\t' && c2 == ' ') {
+ for (i = 0; i < this.options.tab_size; i++) {
+ sourcePos += direction;
+ if (i < this.options.tab_size - 1
+ && (sourcePos < 0 || sourcePos >= this.source.length() || this.source.charAt(sourcePos) != ' '))
+ continue theLoop;
+ }
+ textPos -= direction;
+ } else if (c2 == '\t' && c1 == ' ') {
+ for (i = 0; i < this.options.tab_size; i++) {
+ textPos -= direction;
+ if (i < this.options.tab_size - 1
+ && (textPos < 0 || textPos >= text.length() || text.charAt(textPos) != ' '))
+ continue theLoop;
+ }
+ sourcePos += direction;
+ } else {
+ break;
+ }
+ }
+ if (isRegionEnd) {
+ text = text.substring(0, textPos + 1);
+ } else {
+ text = text.substring(textPos);
+ }
+
+ return text;
+ }
+
+ private void handleSingleLineComment(Token lineComment, int index) {
+ List<Token> structure = lineComment.getInternalStructure();
+ if (structure == null) {
+ flushBuffer(lineComment.originalStart);
+ this.counter = lineComment.originalEnd + 1;
+ return;
+ }
+ if (structure.get(0).tokenType == TokenNameWHITESPACE) {
+ flushBuffer(structure.get(0).originalStart);
+ } else {
+ flushBuffer(lineComment.originalStart);
+ }
+
+ for (int i = 0; i < structure.size(); i++) {
+ Token fragment = structure.get(i);
+
+ if (fragment.getLineBreaksBefore() > 0) {
+ bufferLineSeparator(fragment, false);
+ bufferIndent(fragment, index);
+ } else if (fragment.isSpaceBefore() && i > 0) {
+ this.buffer.append(' ');
+ }
+
+ if (fragment.hasNLSTag()) {
+ int tagNumber = this.stringLiteralsInLine.indexOf(fragment.getNLSTag());
+ assert tagNumber >= 0;
+ this.buffer.append("//$NON-NLS-").append(tagNumber + 1).append("$"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (fragment.originalStart < this.counter) {
+ // Comment line prefix may be a copy of earlier code
+ this.buffer.append(this.tm.toString(fragment));
+ } else {
+ flushBuffer(fragment.originalStart);
+ this.counter = fragment.originalEnd + 1;
+ }
+ }
+
+ if (lineComment.originalEnd > lineComment.originalStart) // otherwise it's a forged comment
+ flushBuffer(lineComment.originalEnd + 1);
+ }
+
+ private void handleMultiLineComment(Token comment, int index) {
+ flushBuffer(comment.originalStart);
+ if (this.childBuilder == null) {
+ this.childBuilder = new TextEditsBuilder(this);
+ }
+ this.childBuilder.traverseInternalStructure(comment, index);
+ this.edits.addAll(this.childBuilder.edits);
+ this.childBuilder.edits.clear();
+ this.counter = this.childBuilder.sourceLimit;
+ }
+
+ private void traverseInternalStructure(Token token, int index) {
+ List<Token> structure = token.getInternalStructure();
+ this.tm = new TokenManager(structure, this.parent.tm);
+ this.counter = token.originalStart;
+ this.sourceLimit = token.originalEnd + 1;
+
+ this.parentTokenIndex = index;
+
+ traverse(structure, 0);
+ }
+
+ public void processComment(Token commentToken) {
+ assert commentToken.isComment();
+ if (commentToken.tokenType == TokenNameCOMMENT_LINE) {
+ handleSingleLineComment(commentToken, this.tm.indexOf(commentToken));
+ } else {
+ handleMultiLineComment(commentToken, this.tm.indexOf(commentToken));
+ }
+ }
+
+ public List<TextEdit> getEdits() {
+ return this.edits;
+ }
+
+ public void setAlignChar(int alignChar) {
+ this.alignChar = alignChar;
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Token.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Token.java
new file mode 100644
index 0000000..3ab1748
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/Token.java
@@ -0,0 +1,299 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+
+import java.util.List;
+
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner;
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
+
+/**
+ * Stores a token's type, position and all its properties like surrounding whitespace, wrapping behavior and so on.
+ */
+public class Token {
+
+ public static class WrapPolicy {
+
+ /** Policy used for internal structure of multiline comments to mark tokens that should never be wrapped */
+ public final static WrapPolicy DISABLE_WRAP = new WrapPolicy(0, 0, false);
+
+ /**
+ * Policy used for internal structure of multiline comments to mark tokens that can be wrapped only in lines
+ * that have no other tokens to wrap.
+ */
+ public final static WrapPolicy SUBSTITUTE_ONLY = new WrapPolicy(0, 0, false);
+
+ public final int extraIndent;
+ public final int wrapParentIndex;
+ public final int structureDepth;
+ public final float penaltyMultiplier;
+ public final boolean isFirstInGroup;
+ public final boolean indentOnColumn;
+ public final int topPriorityGroupEnd;
+ /**
+ * If true, it means the token was in new line even before wrapping, but should be treaded as wrapped token for
+ * indentation purposes. Used for anonymous class body, lambda body and comments inside code.
+ */
+ public final boolean isForced;
+
+ public WrapPolicy(int extraIndent, int wrapParentIndex, int structureDepth, float penaltyMultiplier,
+ boolean isFirstInGroup, boolean indentOnColumn, int topPriorityGroupEnd, boolean isForced) {
+ this.extraIndent = extraIndent;
+ this.wrapParentIndex = wrapParentIndex;
+ this.structureDepth = structureDepth;
+ this.penaltyMultiplier = penaltyMultiplier;
+ this.isFirstInGroup = isFirstInGroup;
+ this.indentOnColumn = indentOnColumn;
+ this.topPriorityGroupEnd = topPriorityGroupEnd;
+ this.isForced = isForced;
+ }
+
+ public WrapPolicy(int extraIndent, int wrapParentIndex, boolean isForced) {
+ this(extraIndent, wrapParentIndex, 0, 1, false, false, -1, isForced);
+ }
+
+ public boolean isTopPriority() {
+ return this.topPriorityGroupEnd >= 0;
+ }
+ }
+
+ /** Position in source of the first character. */
+ public final int originalStart;
+ /** Position in source of the last character (this position is included in the token). */
+ public final int originalEnd;
+ /** Type of this token. See {@link TerminalTokens} for constants definition. */
+ public final int tokenType;
+ private boolean spaceBefore, spaceAfter;
+ private int lineBreaksBefore, lineBreaksAfter;
+ private int indent;
+ private int align;
+ private boolean toEscape;
+
+ private boolean nextLineOnWrap;
+ private WrapPolicy wrapPolicy;
+
+ private Token nlsTagToken;
+
+ private List<Token> internalStructure;
+
+ public Token(int sourceStart, int sourceEnd, int tokenType) {
+ assert sourceStart <= sourceEnd;
+ this.originalStart = sourceStart;
+ this.originalEnd = sourceEnd;
+ this.tokenType = tokenType;
+ }
+
+ public Token(Token tokenToCopy) {
+ this(tokenToCopy, tokenToCopy.originalStart, tokenToCopy.originalEnd, tokenToCopy.tokenType);
+ }
+
+ public Token(Token tokenToCopy, int newOriginalStart, int newOriginalEnd, int newTokenType) {
+ this.originalStart = newOriginalStart;
+ this.originalEnd = newOriginalEnd;
+ this.tokenType = newTokenType;
+ this.spaceBefore = tokenToCopy.spaceBefore;
+ this.spaceAfter = tokenToCopy.spaceAfter;
+ this.lineBreaksBefore = tokenToCopy.lineBreaksBefore;
+ this.lineBreaksAfter = tokenToCopy.lineBreaksAfter;
+ this.indent = tokenToCopy.indent;
+ this.nextLineOnWrap = tokenToCopy.nextLineOnWrap;
+ this.wrapPolicy = tokenToCopy.wrapPolicy;
+ this.nlsTagToken = tokenToCopy.nlsTagToken;
+ this.internalStructure = tokenToCopy.internalStructure;
+ }
+
+ public static Token fromCurrent(Scanner scanner, int currentToken) {
+ int start = scanner.getCurrentTokenStartPosition();
+ int end = scanner.getCurrentTokenEndPosition();
+ if (currentToken == TokenNameCOMMENT_LINE) {
+ // don't include line separator
+ String source = scanner.getCurrentTokenString();
+ for (int i = source.length() - 1; i > 0; i--) {
+ char c = source.charAt(i);
+ if (c != '\r' && c != '\n')
+ break;
+ end--;
+ }
+ }
+ Token token = new Token(start, end, currentToken);
+ return token;
+ }
+
+ /** Adds space before this token */
+ public void spaceBefore() {
+ this.spaceBefore = true;
+ }
+
+ /** Removes space before this token */
+ public void clearSpaceBefore() {
+ this.spaceBefore = false;
+ }
+
+ public boolean isSpaceBefore() {
+ return this.spaceBefore;
+ }
+
+ /** Adds space after this token */
+ public void spaceAfter() {
+ this.spaceAfter = true;
+ }
+
+ /** Removes space after this token */
+ public void clearSpaceAfter() {
+ this.spaceAfter = false;
+ }
+
+ public boolean isSpaceAfter() {
+ return this.spaceAfter;
+ }
+
+ public void breakBefore() {
+ putLineBreaksBefore(1);
+ }
+
+ public void putLineBreaksBefore(int lineBreaks) {
+ this.lineBreaksBefore = Math.max(this.lineBreaksBefore, lineBreaks);
+ }
+
+ public int getLineBreaksBefore() {
+ return this.lineBreaksBefore;
+ }
+
+ public void clearLineBreaksBefore() {
+ this.lineBreaksBefore = 0;
+ }
+
+ public void breakAfter() {
+ putLineBreaksAfter(1);
+ }
+
+ public void putLineBreaksAfter(int lineBreaks) {
+ this.lineBreaksAfter = Math.max(this.lineBreaksAfter, lineBreaks);
+ }
+
+ public int getLineBreaksAfter() {
+ return this.lineBreaksAfter;
+ }
+
+ public void clearLineBreaksAfter() {
+ this.lineBreaksAfter = 0;
+ }
+
+ /** Increases this token's indentation by one position */
+ public void indent() {
+ this.indent++;
+ }
+
+ /** Decreses this token's indentation by one position */
+ public void unindent() {
+ this.indent--;
+ }
+
+ public void setIndent(int indent) {
+ this.indent = indent;
+ }
+
+ public int getIndent() {
+ return this.indent;
+ }
+
+ public void setAlign(int align) {
+ this.align = align;
+ }
+
+ public int getAlign() {
+ return this.align;
+ }
+
+ public void setToEscape(boolean shouldEscape) {
+ this.toEscape = shouldEscape;
+ }
+
+ public boolean isToEscape() {
+ return this.toEscape;
+ }
+
+ public void setNextLineOnWrap() {
+ this.nextLineOnWrap = true;
+ }
+
+ public boolean isNextLineOnWrap() {
+ return this.nextLineOnWrap;
+ }
+
+ public void setWrapPolicy(WrapPolicy wrapPolicy) {
+ this.wrapPolicy = wrapPolicy;
+ }
+
+ public WrapPolicy getWrapPolicy() {
+ return this.wrapPolicy;
+ }
+
+ public boolean isWrappable() {
+ return this.wrapPolicy != null && !this.wrapPolicy.isForced;
+ }
+
+ public void setNLSTag(Token nlsTagToken) {
+ this.nlsTagToken = nlsTagToken;
+ }
+
+ public boolean hasNLSTag() {
+ return this.nlsTagToken != null;
+ }
+
+ public Token getNLSTag() {
+ return this.nlsTagToken;
+ }
+
+ public void setInternalStructure(List<Token> internalStructure) {
+ this.internalStructure = internalStructure;
+ }
+
+ public List<Token> getInternalStructure() {
+ return this.internalStructure;
+ }
+
+ public boolean isComment() {
+ switch (this.tokenType) {
+ case TokenNameCOMMENT_BLOCK:
+ case TokenNameCOMMENT_JAVADOC:
+ case TokenNameCOMMENT_LINE:
+ return true;
+ }
+ return false;
+ }
+
+ public String toString(String source) {
+ return source.substring(this.originalStart, this.originalEnd + 1);
+ }
+
+ public int countChars() {
+ return this.originalEnd - this.originalStart + 1;
+ }
+
+ /*
+ * Conceptually, Token abstracts away from the source so it doesn't need to know how
+ * the source looks like. However, it's useful to see the actual token contents while debugging.
+ * Uncomment this field, commented code in toString() below and in DefaultCodeFormatter.init(String source)
+ * during debugging sessions to easily recognize tokens.
+ */
+// public static String source;
+
+ public String toString() {
+// if (source != null) // see comment above
+// return toString(source);
+ return "[" + this.originalStart + "-" + this.originalEnd + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager.java
new file mode 100644
index 0000000..fa0ec6a
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TokenManager.java
@@ -0,0 +1,447 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
+import org.aspectj.org.eclipse.jdt.core.dom.Block;
+import org.aspectj.org.eclipse.jdt.core.dom.IfStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.ReturnStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.ThrowStatement;
+import org.aspectj.org.eclipse.jdt.internal.formatter.linewrap.CommentWrapExecutor;
+
+/**
+ * A helper class that can be used to easily access source code and find tokens on any position.
+ * It also has some other methods that are useful on multiple stages of formatting.
+ */
+public class TokenManager implements Iterable<Token> {
+
+ private static final Pattern COMMENT_LINE_ANNOTATION_PATTERN = Pattern.compile("^(\\s*\\*?\\s*)(@)"); //$NON-NLS-1$
+
+ private final List<Token> tokens;
+ private final String source;
+ private final int tabSize;
+ private final int tabChar;
+ private final boolean wrapWithSpaces;
+
+ final CommentWrapExecutor commentWrapper;
+
+ private HashMap<Integer, Integer> tokenIndexToNLSAlign;
+ private List<Token[]> formatOffTagPairs;
+ private int headerEndIndex = 0;
+
+ public TokenManager(List<Token> tokens, String source, DefaultCodeFormatterOptions options) {
+ this.tokens = tokens;
+ this.source = source;
+ this.tabSize = options.tab_size;
+ this.tabChar = options.tab_char;
+ this.wrapWithSpaces = options.use_tabs_only_for_leading_indentations;
+ this.commentWrapper = new CommentWrapExecutor(this, options);
+ }
+
+ public TokenManager(List<Token> tokens, TokenManager parent) {
+ this.tokens = tokens;
+ this.source = parent.source;
+ this.tabSize = parent.tabSize;
+ this.tabChar = parent.tabChar;
+ this.wrapWithSpaces = parent.wrapWithSpaces;
+ this.commentWrapper = parent.commentWrapper;
+ }
+
+ public Token get(int index) {
+ return this.tokens.get(index);
+ }
+
+ /**
+ * @return total number of tokens
+ */
+ public int size() {
+ return this.tokens.size();
+ }
+
+ /**
+ * Removes the token at given index.
+ * <p>Warning: never call this method after wrap policies have been added to tokens
+ * since wrap parent indexes may become invalid.
+ */
+ public void remove(int tokenIndex) {
+ this.tokens.remove(tokenIndex);
+ }
+
+ /**
+ * Adds given token at given index.
+ * <p>Warning: never call this method after wrap policies have been added to tokens
+ * since wrap parent indexes may become invalid.
+ */
+ public void insert(int tokenIndex, Token token) {
+ this.tokens.add(tokenIndex, token);
+ }
+
+ /**
+ * Gets token text with characters escaped as HTML entities where necessary.
+ * @param tokenIndex index of the token to get.
+ */
+ public String toString(int tokenIndex) {
+ return toString(get(tokenIndex));
+ }
+
+ /**
+ * Gets token text with characters escaped as HTML entities where necessary.
+ */
+ public String toString(Token token) {
+ if (token.isToEscape())
+ return getEscapedTokenString(token);
+ return token.toString(this.source);
+ }
+
+ /**
+ * @return part of the source code defined by given node's position and length.
+ */
+ public String toString(ASTNode node) {
+ return this.source.substring(node.getStartPosition(), node.getStartPosition() + node.getLength());
+ }
+
+ public String getSource() {
+ return this.source;
+ }
+
+ public int indexOf(Token token) {
+ int index = findIndex(token.originalStart, -1, false);
+ if (get(index) != token)
+ return -1;
+ return index;
+ }
+
+ public char charAt(int sourcePosition) {
+ return this.source.charAt(sourcePosition);
+ }
+
+ public int getSourceLength() {
+ return this.source.length();
+ }
+
+ public int findIndex(int positionInSource, int tokenType, boolean forward) {
+ // binary search
+ int left = 0, right = size() - 1;
+ while (left < right) {
+ int index = (right + left) / 2;
+ Token token = get(index);
+ if (token.originalStart <= positionInSource && positionInSource <= token.originalEnd) {
+ left = index;
+ break;
+ }
+ if (token.originalEnd < positionInSource) {
+ left = index + 1;
+ } else {
+ assert token.originalStart > positionInSource;
+ right = index - 1;
+ }
+ }
+ int index = left;
+ if (!forward && get(index).originalStart > positionInSource)
+ index--;
+ if (forward && get(index).originalEnd < positionInSource)
+ index++;
+ while (tokenType >= 0 && get(index).tokenType != tokenType) {
+ index += forward ? 1 : -1;
+ }
+ return index;
+ }
+
+ @Override
+ public Iterator<Token> iterator() {
+ return this.tokens.iterator();
+ }
+
+ public boolean isGuardClause(Block node) {
+ if (node.statements().size() != 1)
+ return false;
+ ASTNode parent = node.getParent();
+ if (!(parent instanceof IfStatement) || ((IfStatement) parent).getElseStatement() != null)
+ return false;
+ Object statement = node.statements().get(0);
+ if (!(statement instanceof ReturnStatement) && !(statement instanceof ThrowStatement))
+ return false;
+ // guard clause cannot start with a comment
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=58565
+ int openBraceIndex = firstIndexIn(node, TokenNameLBRACE);
+ return !get(openBraceIndex + 1).isComment();
+ }
+
+ public int firstIndexIn(ASTNode node, int tokenType) {
+ int index = findIndex(node.getStartPosition(), tokenType, true);
+ assert tokenInside(node, index);
+ return index;
+ }
+
+ public Token firstTokenIn(ASTNode node, int tokenType) {
+ return get(firstIndexIn(node, tokenType));
+ }
+
+ public int lastIndexIn(ASTNode node, int tokenType) {
+ int index = findIndex(node.getStartPosition() + node.getLength() - 1, tokenType, false);
+ assert tokenInside(node, index);
+ return index;
+ }
+
+ public Token lastTokenIn(ASTNode node, int tokenType) {
+ return get(lastIndexIn(node, tokenType));
+ }
+
+ public int firstIndexAfter(ASTNode node, int tokenType) {
+ return findIndex(node.getStartPosition() + node.getLength(), tokenType, true);
+ }
+
+ public Token firstTokenAfter(ASTNode node, int tokenType) {
+ return get(firstIndexAfter(node, tokenType));
+ }
+
+ public int firstIndexBefore(ASTNode node, int tokenType) {
+ return findIndex(node.getStartPosition() - 1, tokenType, false);
+ }
+
+ public Token firstTokenBefore(ASTNode node, int tokenType) {
+ return get(firstIndexBefore(node, tokenType));
+ }
+
+ public int countLineBreaksBetween(Token previous, Token current) {
+ int start = previous != null ? previous.originalEnd + 1 : 0;
+ int end = current != null ? current.originalStart : this.source.length();
+ return countLineBreaksBetween(this.source, start, end);
+ }
+
+ public int countLineBreaksBetween(String text, int startPosition, int endPosition) {
+ int result = 0;
+ for (int i = startPosition; i < endPosition; i++) {
+ switch (text.charAt(i)) {
+ case '\r':
+ result++;
+ if (i + 1 < endPosition && text.charAt(i + 1) == '\n')
+ i++;
+ break;
+ case '\n':
+ result++;
+ if (i + 1 < endPosition && text.charAt(i + 1) == '\r')
+ i++;
+ break;
+ }
+ }
+ return result;
+ }
+
+ private TokenTraverser positionInLineCounter = new TokenTraverser() {
+ private boolean isNLSTagInLine = false;
+
+ @Override
+ protected boolean token(Token traversed, int index) {
+ if (index == this.value) {
+ this.isNLSTagInLine = false;
+ return false;
+ }
+ if (traversed.hasNLSTag()) {
+ assert traversed.tokenType == TokenNameStringLiteral;
+ this.isNLSTagInLine = true;
+ }
+ if (traversed.getAlign() > 0)
+ this.counter = traversed.getAlign();
+ List<Token> internalStructure = traversed.getInternalStructure();
+ if (internalStructure != null && !internalStructure.isEmpty()) {
+ assert traversed.tokenType == TokenNameCOMMENT_BLOCK || traversed.tokenType == TokenNameCOMMENT_JAVADOC;
+ this.counter = TokenManager.this.commentWrapper.wrapMultiLineComment(traversed, this.counter, true,
+ this.isNLSTagInLine);
+ } else {
+ this.counter += getLength(traversed, this.counter);
+ }
+ if (isSpaceAfter())
+ this.counter++;
+ return true;
+ }
+ };
+
+ public int getPositionInLine(int tokenIndex) {
+ Token token = get(tokenIndex);
+ if (token.getAlign() > 0)
+ return get(tokenIndex).getAlign();
+ // find the first token in line and calculate position of given token
+ int firstTokenIndex = token.getLineBreaksBefore() > 0 ? tokenIndex : findFirstTokenInLine(tokenIndex);
+ Token firstToken = get(firstTokenIndex);
+ int startingPosition = toIndent(firstToken.getIndent(), firstToken.getWrapPolicy() != null);
+ if (firstTokenIndex == tokenIndex)
+ return startingPosition;
+
+ this.positionInLineCounter.value = tokenIndex;
+ this.positionInLineCounter.counter = startingPosition;
+ traverse(firstTokenIndex, this.positionInLineCounter);
+ return this.positionInLineCounter.counter;
+ }
+
+ public int findSourcePositionInLine(int position) {
+ int lineStartPosition = position;
+ char c;
+ while (lineStartPosition > 0 && (c = charAt(lineStartPosition)) != '\r' && c != '\n')
+ lineStartPosition--;
+ int positionInLine = getLength(lineStartPosition, position - 1, 0);
+ return positionInLine;
+ }
+
+ private String getEscapedTokenString(Token token) {
+ if (token.getLineBreaksBefore() > 0 && charAt(token.originalStart) == '@') {
+ return "@" + this.source.substring(token.originalStart + 1, token.originalEnd + 1); //$NON-NLS-1$
+ } else if (token.tokenType == TokenNameNotAToken) {
+ String text = token.toString(this.source);
+ Matcher matcher = COMMENT_LINE_ANNOTATION_PATTERN.matcher(text);
+ if (matcher.find()) {
+ return matcher.group(1) + "@" + text.substring(matcher.end(2)); //$NON-NLS-1$
+ }
+ }
+ return token.toString(this.source);
+ }
+
+ /**
+ * @param token the token to measure
+ * @param startPosition position in line of the first character (affects tabs calculation)
+ * @return actual length of given token, considering tabs and escaping characters as HTML entities
+ */
+ public int getLength(Token token, int startPosition) {
+ int length = getLength(token.originalStart, token.originalEnd, startPosition);
+ if (token.isToEscape()) {
+ if (token.getLineBreaksBefore() > 0 && charAt(token.originalStart) == '@') {
+ length += 4; // 4 = "@".length() - "@".length()
+ } else if (token.tokenType == TokenNameNotAToken) {
+ Matcher matcher = COMMENT_LINE_ANNOTATION_PATTERN.matcher(token.toString(this.source));
+ if (matcher.find()) {
+ length += 4; // 4 = "@".length() - "@".length()
+ }
+ }
+ }
+ return length;
+ }
+
+ /**
+ * Calculates the length of a source code fragment.
+ * @param originalStart the first position of the source code fragment
+ * @param originalEnd the last position of the source code fragment
+ * @param startPosition position in line of the first character (affects tabs calculation)
+ * @return length, considering tabs and escaping characters as HTML entities
+ */
+ public int getLength(int originalStart, int originalEnd, int startPosition) {
+ int position = startPosition;
+ for (int i = originalStart; i <= originalEnd; i++) {
+ switch (this.source.charAt(i)) {
+ case '\t':
+ if (this.tabSize > 0)
+ position += this.tabSize - position % this.tabSize;
+ break;
+ case '\r':
+ case '\n':
+ position = 0;
+ break;
+ default:
+ position++;
+ }
+ }
+ return position - startPosition;
+ }
+
+ /**
+ * @param indent desired indentation (in positions, not in levels)
+ * @param isWrapped whether indented element is wrapped
+ * @return actual indentation that can be achieved with current settings
+ */
+ public int toIndent(int indent, boolean isWrapped) {
+ if (this.tabChar == DefaultCodeFormatterOptions.TAB && !(isWrapped && this.wrapWithSpaces)) {
+ int tab = this.tabSize;
+ if (tab <= 0)
+ return 0;
+ indent = ((indent + tab - 1) / tab) * tab;
+ }
+ return indent;
+ }
+
+ public int traverse(int startIndex, TokenTraverser traverser) {
+ return traverser.traverse(this.tokens, startIndex);
+ }
+
+ public int findFirstTokenInLine(int startIndex) {
+ return findFirstTokenInLine(startIndex, false);
+ }
+
+ public int findFirstTokenInLine(int startIndex, boolean includeWraps) {
+ Token previous = get(startIndex); // going backwards, previous has higher index than current
+ for (int i = startIndex - 1; i >= 0; i--) {
+ Token token = get(i);
+ int lineBreaks = Math.max(token.getLineBreaksAfter(), previous.getLineBreaksBefore());
+ if (lineBreaks > 0 && (!includeWraps || previous.getWrapPolicy() == null))
+ return i + 1;
+ previous = token;
+ }
+ return 0;
+ }
+
+ private boolean tokenInside(ASTNode node, int index) {
+ return get(index).originalStart >= node.getStartPosition()
+ && get(index).originalEnd <= node.getStartPosition() + node.getLength();
+ }
+
+ public void addNLSAlignIndex(int index, int align) {
+ if (this.tokenIndexToNLSAlign == null)
+ this.tokenIndexToNLSAlign = new HashMap<Integer, Integer>();
+ this.tokenIndexToNLSAlign.put(index, align);
+ }
+
+ public int getNLSAlign(int index) {
+ if (this.tokenIndexToNLSAlign == null)
+ return 0;
+ Integer align = this.tokenIndexToNLSAlign.get(index);
+ return align != null ? align : 0;
+ }
+
+ public void setHeaderEndIndex(int headerEndIndex) {
+ this.headerEndIndex = headerEndIndex;
+ }
+
+ public boolean isInHeader(int tokenIndex) {
+ return tokenIndex < this.headerEndIndex;
+ }
+
+ public void addDisableFormatTokenPair(Token formatOffTag, Token formatOnTag) {
+ if (this.formatOffTagPairs == null)
+ this.formatOffTagPairs = new ArrayList<Token[]>();
+ this.formatOffTagPairs.add(new Token[] { formatOffTag, formatOnTag });
+ }
+
+ public void applyFormatOff() {
+ if (this.formatOffTagPairs == null)
+ return;
+ for (Token[] pair : this.formatOffTagPairs) {
+ int index1 = indexOf(pair[0]);
+ int index2 = indexOf(pair[1]);
+ Token unformatted = new Token(pair[0].originalStart, pair[1].originalEnd, TokenNameWHITESPACE);
+ unformatted.setIndent(Math.min(pair[0].getIndent(), findSourcePositionInLine(pair[0].originalStart)));
+ unformatted.putLineBreaksBefore(pair[0].getLineBreaksBefore());
+ if (pair[0].isSpaceBefore())
+ unformatted.spaceBefore();
+ unformatted.putLineBreaksAfter(pair[1].getLineBreaksAfter());
+ if (pair[1].isSpaceAfter())
+ unformatted.spaceAfter();
+ this.tokens.set(index1, unformatted);
+ this.tokens.subList(index1 + 1, index2 + 1).clear();
+ }
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TokenTraverser.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TokenTraverser.java
new file mode 100644
index 0000000..38757ca
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/TokenTraverser.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter;
+
+import java.util.List;
+
+/**
+ * Helper class that can be subclassed every time an algorithm needs to swipe through all or part of the tokens and
+ * easily keep track or previous and future tokens and whitespace.
+ */
+public abstract class TokenTraverser {
+ /** General purpose field that can be used by subclasses to count things */
+ protected int counter = 0;
+ /** General purpose field that can be used by subclasses to store an integer value */
+ protected int value = 0;
+
+ private boolean spaceBefore, spaceAfter;
+ private int lineBreaksBefore, lineBreaksAfter;
+ private Token previous, current, next;
+ private boolean structureChanged = false;
+
+ protected abstract boolean token(Token token, int index);
+
+ /**
+ * Must be called every time tokens are added or removed from the list that is currently being traversed so that
+ * cached data can be refreshed.
+ */
+ protected void structureChanged() {
+ this.structureChanged = true;
+ }
+
+ protected boolean isSpaceBefore() {
+ return this.spaceBefore;
+ }
+
+ protected boolean isSpaceAfter() {
+ return this.spaceAfter;
+ }
+
+ protected int getLineBreaksBefore() {
+ return this.lineBreaksBefore;
+ }
+
+ protected int getLineBreaksAfter() {
+ return this.lineBreaksAfter;
+ }
+
+ protected Token getPrevious() {
+ return this.previous;
+ }
+
+ protected Token getCurrent() {
+ return this.current;
+ }
+
+ protected Token getNext() {
+ return this.next;
+ }
+
+ private void initTraverse(List<Token> tokens, int startIndex) {
+ if (tokens.isEmpty())
+ return;
+ this.structureChanged = false;
+
+ this.previous = this.next = null;
+ if (startIndex > 0)
+ this.previous = tokens.get(startIndex - 1);
+ this.current = tokens.get(startIndex);
+ this.lineBreaksBefore = Math.max(this.previous != null ? this.previous.getLineBreaksAfter() : 0,
+ this.current.getLineBreaksBefore());
+ this.spaceBefore = this.current.isSpaceBefore();
+ if (this.lineBreaksBefore == 0) {
+ this.spaceBefore = this.spaceBefore || (this.previous != null && this.previous.isSpaceAfter());
+ }
+ }
+
+ public int traverse(List<Token> tokens, int startIndex) {
+ initTraverse(tokens, startIndex);
+
+ for (int i = startIndex; i < tokens.size(); i++) {
+ if (this.structureChanged)
+ initTraverse(tokens, i);
+
+ this.next = null;
+ if (i < tokens.size() - 1) {
+ this.next = tokens.get(i + 1);
+ }
+ this.lineBreaksAfter = Math.max(this.current.getLineBreaksAfter(),
+ this.next != null ? this.next.getLineBreaksBefore() : 0);
+ this.spaceAfter = this.current.isSpaceAfter();
+ if (this.lineBreaksAfter == 0) {
+ this.spaceAfter = this.spaceAfter || (this.next != null && this.next.isSpaceBefore());
+ }
+
+ if (!this.token(this.current, i))
+ return i;
+
+ if (this.next != null) {
+ this.previous = this.current;
+ this.current = this.next;
+ this.lineBreaksBefore = this.lineBreaksAfter;
+ this.spaceBefore = this.spaceAfter;
+ if (this.lineBreaksBefore > 0)
+ this.spaceBefore = this.current.isSpaceBefore();
+ }
+ }
+ return tokens.size() - 1;
+ }
+}
\ No newline at end of file
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/align/Alignment.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/align/Alignment.java
deleted file mode 100644
index b8a9d50..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/align/Alignment.java
+++ /dev/null
@@ -1,604 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter.align;
-
-import org.eclipse.core.runtime.Assert;
-import org.aspectj.org.eclipse.jdt.internal.formatter.Location;
-import org.aspectj.org.eclipse.jdt.internal.formatter.Scribe;
-
-/**
- * Alignment management
- *
- * @since 2.1
- */
-public class Alignment {
-
- // Kind of alignment
- public int kind;
- public static final int ALLOCATION = 1;
- public static final int ANNOTATION_MEMBERS_VALUE_PAIRS = 2;
- public static final int ARRAY_INITIALIZER = 3;
- public static final int ASSIGNMENT = 4;
- public static final int BINARY_EXPRESSION = 5;
- public static final int CASCADING_MESSAGE_SEND = 6;
- public static final int COMPACT_IF = 7;
- public static final int COMPOUND_ASSIGNMENT = 8;
- public static final int CONDITIONAL_EXPRESSION = 9;
- public static final int ENUM_CONSTANTS = 10;
- public static final int ENUM_CONSTANTS_ARGUMENTS = 11;
- public static final int EXPLICIT_CONSTRUCTOR_CALL = 12;
- public static final int FIELD_DECLARATION_ASSIGNMENT = 13;
- public static final int LOCAL_DECLARATION_ASSIGNMENT = 14;
- public static final int MESSAGE_ARGUMENTS = 15;
- public static final int MESSAGE_SEND = 16;
- public static final int METHOD_ARGUMENTS = 17;
- public static final int METHOD_DECLARATION = 18;
- public static final int MULTIPLE_FIELD = 19;
- public static final int SUPER_CLASS = 20;
- public static final int SUPER_INTERFACES = 21;
- public static final int THROWS = 22;
- public static final int TYPE_MEMBERS = 23;
- public static final int STRING_CONCATENATION = 24;
- public static final int TRY_RESOURCES = 25;
- public static final int MULTI_CATCH = 26;
-
- // name of alignment
- public String name;
- public static final String[] NAMES = {
- "", //$NON-NLS-1$
- "allocation", //$NON-NLS-1$
- "annotationMemberValuePairs", //$NON-NLS-1$
- "array_initializer", //$NON-NLS-1$
- "assignmentAlignment", //$NON-NLS-1$
- "binaryExpressionAlignment", //$NON-NLS-1$
- "cascadingMessageSendAlignment", //$NON-NLS-1$
- "compactIf", //$NON-NLS-1$
- "compoundAssignmentAlignment", //$NON-NLS-1$
- "conditionalExpression", //$NON-NLS-1$
- "enumConstants", //$NON-NLS-1$
- "enumConstantArguments", //$NON-NLS-1$
- "explicit_constructor_call", //$NON-NLS-1$
- "fieldDeclarationAssignmentAlignment", //$NON-NLS-1$
- "localDeclarationAssignmentAlignment", //$NON-NLS-1$
- "messageArguments", //$NON-NLS-1$
- "messageAlignment", //$NON-NLS-1$
- "methodArguments", //$NON-NLS-1$
- "methodDeclaration", //$NON-NLS-1$
- "multiple_field", //$NON-NLS-1$
- "superclass", //$NON-NLS-1$
- "superInterfaces", //$NON-NLS-1$
- "throws", //$NON-NLS-1$
- "typeMembers", //$NON-NLS-1$
- "stringConcatenation", //$NON-NLS-1$
- "tryResources", //$NON-NLS-1$
- "unionTypeInMulticatch", //$NON-NLS-1$
- };
-
- // link to enclosing alignment
- public Alignment enclosing;
-
- // start location of this alignment
- public Location location;
-
- // indentation management
- public int fragmentIndex;
- public int fragmentCount;
- public int[] fragmentIndentations;
- public boolean needRedoColumnAlignment;
-
- // chunk management
- public int chunkStartIndex;
- public int chunkKind;
-
- // break management
- public int originalIndentationLevel;
- public int breakIndentationLevel;
- public int shiftBreakIndentationLevel;
- public int[] fragmentBreaks;
- public boolean wasSplit;
- public boolean blockAlign = false;
- public boolean tooLong = false;
-
- public Scribe scribe;
-
- // reset
- private boolean reset = false;
-
- /*
- * Alignment modes
- */
- public static final int M_FORCE = 1; // if bit set, then alignment will be non-optional (default is optional)
- public static final int M_INDENT_ON_COLUMN = 2; // if bit set, broken fragments will be aligned on current location column (default is to break at current indentation level)
- public static final int M_INDENT_BY_ONE = 4; // if bit set, broken fragments will be indented one level below current (not using continuation indentation)
-
- // split modes can be combined either with M_FORCE or M_INDENT_ON_COLUMN
-
- /** foobar(#fragment1, #fragment2, <ul>
- * <li> #fragment3, #fragment4 </li>
- * </ul>
- */
- public static final int M_COMPACT_SPLIT = 16; // fill each line with all possible fragments
-
- /** foobar(<ul>
- * <li> #fragment1, #fragment2, </li>
- * <li> #fragment3, #fragment4, </li>
- * </ul>
- */
- public static final int M_COMPACT_FIRST_BREAK_SPLIT = 32; // compact mode, but will first try to break before first fragment
-
- /** foobar(<ul>
- * <li> #fragment1, </li>
- * <li> #fragment2, </li>
- * <li> #fragment3 </li>
- * <li> #fragment4, </li>
- * </ul>
- */
- public static final int M_ONE_PER_LINE_SPLIT = 32+16; // one fragment per line
-
- /**
- * foobar(<ul>
- * <li> #fragment1, </li>
- * <li> #fragment2, </li>
- * <li> #fragment3 </li>
- * <li> #fragment4, </li>
- * </ul>
- */
- public static final int M_NEXT_SHIFTED_SPLIT = 64; // one fragment per line, subsequent are indented further
-
- /** foobar(#fragment1, <ul>
- * <li> #fragment2, </li>
- * <li> #fragment3 </li>
- * <li> #fragment4, </li>
- * </ul>
- */
- public static final int M_NEXT_PER_LINE_SPLIT = 64+16; // one per line, except first fragment (if possible)
-
- //64+32
- //64+32+16
-
- // mode controlling column alignments
- /**
- * <table BORDER COLS=4 WIDTH="100%" >
- * <tr><td>#fragment1A</td> <td>#fragment2A</td> <td>#fragment3A</td> <td>#very-long-fragment4A</td></tr>
- * <tr><td>#fragment1B</td> <td>#long-fragment2B</td> <td>#fragment3B</td> <td>#fragment4B</td></tr>
- * <tr><td>#very-long-fragment1C</td> <td>#fragment2C</td> <td>#fragment3C</td> <td>#fragment4C</td></tr>
- * </table>
- */
- public static final int M_MULTICOLUMN = 256; // fragments are on same line, but multiple line of fragments will be aligned vertically
-
- public static final int M_NO_ALIGNMENT = 0;
-
- public int mode;
-
- public static final int SPLIT_MASK = M_ONE_PER_LINE_SPLIT | M_NEXT_SHIFTED_SPLIT | M_COMPACT_SPLIT | M_COMPACT_FIRST_BREAK_SPLIT | M_NEXT_PER_LINE_SPLIT;
-
- // alignment tie-break rules - when split is needed, will decide whether innermost/outermost alignment is to be chosen
- public static final int R_OUTERMOST = 1;
- public static final int R_INNERMOST = 2;
- public int tieBreakRule;
- public int startingColumn = -1;
-
- // alignment effects on a per fragment basis
- public static final int NONE = 0;
- public static final int BREAK = 1;
-
- // chunk kind
- public static final int CHUNK_FIELD = 1;
- public static final int CHUNK_METHOD = 2;
- public static final int CHUNK_TYPE = 3;
- public static final int CHUNK_ENUM = 4;
-
- // location to align and break on.
- public Alignment(int kind, int mode, int tieBreakRule, Scribe scribe, int fragmentCount, int sourceRestart, int continuationIndent){
-
- Assert.isTrue(kind >=ALLOCATION && kind <=MULTI_CATCH);
- this.kind = kind;
- this.name = NAMES[kind];
- this.location = new Location(scribe, sourceRestart);
- this.mode = mode;
- this.tieBreakRule = tieBreakRule;
- this.fragmentCount = fragmentCount;
- this.scribe = scribe;
- this.originalIndentationLevel = this.scribe.indentationLevel;
- this.wasSplit = false;
-
- // initialize the break indentation level, using modes and continuationIndentationLevel preference
- final int indentSize = this.scribe.indentationSize;
- int currentColumn = this.location.outputColumn;
- if (currentColumn == 1) {
- currentColumn = this.location.outputIndentationLevel + 1;
- }
-
- if ((mode & M_INDENT_ON_COLUMN) != 0) {
- // indent broken fragments at next indentation level, based on current column
- this.breakIndentationLevel = this.scribe.getNextIndentationLevel(currentColumn);
- if (this.breakIndentationLevel == this.location.outputIndentationLevel) {
- this.breakIndentationLevel += (continuationIndent * indentSize);
- }
- } else if ((mode & M_INDENT_BY_ONE) != 0) {
- // indent broken fragments exactly one level deeper than current indentation
- this.breakIndentationLevel = this.location.outputIndentationLevel + indentSize;
- } else {
- this.breakIndentationLevel = this.location.outputIndentationLevel + continuationIndent * indentSize;
- }
- this.shiftBreakIndentationLevel = this.breakIndentationLevel + indentSize;
-
- this.fragmentIndentations = new int[this.fragmentCount];
- this.fragmentBreaks = new int[this.fragmentCount];
-
- // check for forced alignments
- if ((this.mode & M_FORCE) != 0) {
- couldBreak();
- }
- }
-
- public boolean checkChunkStart(int chunk, int startIndex, int sourceRestart) {
- if (this.chunkKind != chunk) {
- this.chunkKind = chunk;
-
- // when redoing same chunk alignment, must not reset
- if (startIndex != this.chunkStartIndex) {
- this.chunkStartIndex = startIndex;
- this.location.update(this.scribe, sourceRestart);
- reset();
- }
- return true;
- }
- return false;
- }
-
- public void checkColumn() {
- if ((this.mode & M_MULTICOLUMN) != 0 && this.fragmentCount > 0) {
- int currentIndentation = this.scribe.getNextIndentationLevel(this.scribe.column+(this.scribe.needSpace ? 1 : 0));
- int fragmentIndentation = this.fragmentIndentations[this.fragmentIndex];
- if (currentIndentation > fragmentIndentation) {
- this.fragmentIndentations[this.fragmentIndex] = currentIndentation;
- if (fragmentIndentation != 0) {
- for (int i = this.fragmentIndex+1; i < this.fragmentCount; i++) {
- this.fragmentIndentations[i] = 0;
- }
- this.needRedoColumnAlignment = true;
- }
- }
- // backtrack only once all fragments got checked
- if (this.needRedoColumnAlignment && this.fragmentIndex == this.fragmentCount-1) { // alignment too small
-
-// if (CodeFormatterVisitor.DEBUG){
-// System.out.println("ALIGNMENT TOO SMALL");
-// System.out.println(this);
-// }
- this.needRedoColumnAlignment = false;
- int relativeDepth = 0;
- Alignment targetAlignment = this.scribe.memberAlignment;
- while (targetAlignment != null){
- if (targetAlignment == this){
- throw new AlignmentException(AlignmentException.ALIGN_TOO_SMALL, relativeDepth);
- }
- targetAlignment = targetAlignment.enclosing;
- relativeDepth++;
- }
- }
- }
- }
-
- public int depth() {
- int depth = 0;
- Alignment current = this.enclosing;
- while (current != null) {
- depth++;
- current = current.enclosing;
- }
- return depth;
- }
-
- /**
- * Returns whether the alignment can be aligned or not.
- * Only used for message send alignment, it currently blocks its alignment
- * when it's at the first nesting level of a message send. It allow to save
- * space on the argument broken line by reducing the number of indentations.
- */
- public boolean canAlign() {
- if (this.tooLong) {
- return true;
- }
- boolean canAlign = true;
- Alignment enclosingAlignment = this.enclosing;
- while (enclosingAlignment != null) {
- switch (enclosingAlignment.kind) {
- case Alignment.ALLOCATION:
- case Alignment.MESSAGE_ARGUMENTS:
- // message send inside arguments, avoid to align
- if (enclosingAlignment.isWrapped() &&
- (enclosingAlignment.fragmentIndex > 0 || enclosingAlignment.fragmentCount < 2)) {
- return !this.blockAlign;
- }
- if (enclosingAlignment.tooLong) {
- return true;
- }
- canAlign = false;
- break;
- case Alignment.MESSAGE_SEND:
- // multiple depth of message send, hence allow current to align
- switch (this.kind) {
- case Alignment.ALLOCATION:
- case Alignment.MESSAGE_ARGUMENTS:
- case Alignment.MESSAGE_SEND:
- Alignment superEnclosingAlignment = enclosingAlignment.enclosing;
- while (superEnclosingAlignment != null) {
- switch (superEnclosingAlignment.kind) {
- case Alignment.ALLOCATION:
- case Alignment.MESSAGE_ARGUMENTS:
- case Alignment.MESSAGE_SEND:
- // block the alignment of the intermediate message send
- if (this.scribe.nlsTagCounter == 0) {
- enclosingAlignment.blockAlign = true;
- }
- return !this.blockAlign;
- }
- superEnclosingAlignment = superEnclosingAlignment.enclosing;
- }
- break;
- }
- return !this.blockAlign;
- }
- enclosingAlignment = enclosingAlignment.enclosing;
- }
- return canAlign && !this.blockAlign;
- }
-
- public boolean couldBreak(){
- if (this.fragmentCount == 0) return false;
- int i;
- switch(this.mode & SPLIT_MASK){
-
- /* # aligned fragment
- * foo(
- * #AAAAA, #BBBBB,
- * #CCCC);
- */
- case M_COMPACT_FIRST_BREAK_SPLIT :
- if (this.fragmentBreaks[0] == NONE) {
- this.fragmentBreaks[0] = BREAK;
- this.fragmentIndentations[0] = this.breakIndentationLevel;
- return this.wasSplit = true;
- }
- i = this.fragmentIndex;
- do {
- if (this.fragmentBreaks[i] == NONE) {
- this.fragmentBreaks[i] = BREAK;
- this.fragmentIndentations[i] = this.breakIndentationLevel;
- return this.wasSplit = true;
- }
- } while (--i >= 0);
- break;
- /* # aligned fragment
- * foo(#AAAAA, #BBBBB,
- * #CCCC);
- */
- case M_COMPACT_SPLIT :
- i = this.fragmentIndex;
- do {
- if (this.fragmentBreaks[i] == NONE) {
- this.fragmentBreaks[i] = BREAK;
- this.fragmentIndentations[i] = this.breakIndentationLevel;
- return this.wasSplit = true;
- }
- } while (--i >= 0);
- break;
-
- /* # aligned fragment
- * foo(
- * #AAAAA,
- * #BBBBB,
- * #CCCC);
- */
- case M_NEXT_SHIFTED_SPLIT :
- if (this.fragmentBreaks[0] == NONE) {
- this.fragmentBreaks[0] = BREAK;
- this.fragmentIndentations[0] = this.breakIndentationLevel;
- for (i = 1; i < this.fragmentCount; i++){
- this.fragmentBreaks[i] = BREAK;
- this.fragmentIndentations[i] = this.shiftBreakIndentationLevel;
- }
- return this.wasSplit = true;
- }
- break;
-
- /* # aligned fragment
- * foo(
- * #AAAAA,
- * #BBBBB,
- * #CCCC);
- */
- case M_ONE_PER_LINE_SPLIT :
- if (this.fragmentBreaks[0] == NONE) {
- for (i = 0; i < this.fragmentCount; i++){
- this.fragmentBreaks[i] = BREAK;
- this.fragmentIndentations[i] = this.breakIndentationLevel;
- }
- return this.wasSplit = true;
- }
- break;
- /* # aligned fragment
- * foo(#AAAAA,
- * #BBBBB,
- * #CCCC);
- */
- case M_NEXT_PER_LINE_SPLIT :
- if (this.fragmentBreaks[0] == NONE) {
- if (this.fragmentCount > 1
- && this.fragmentBreaks[1] == NONE) {
- if ((this.mode & M_INDENT_ON_COLUMN) != 0) {
- this.fragmentIndentations[0] = this.breakIndentationLevel;
- }
- for (i = 1; i < this.fragmentCount; i++) {
- this.fragmentBreaks[i] = BREAK;
- this.fragmentIndentations[i] = this.breakIndentationLevel;
- }
- return this.wasSplit = true;
- }
- }
- break;
- }
- return false; // cannot split better
- }
-
- public boolean isWrapped() {
- if (this.fragmentCount == 0) return false;
- return this.fragmentBreaks[this.fragmentIndex] == BREAK;
- }
-
- public int wrappedIndex() {
- for (int i = 0, max = this.fragmentCount; i < max; i++) {
- if (this.fragmentBreaks[i] == BREAK) {
- return i;
- }
- }
- return -1;
- }
-
- // perform alignment effect for current fragment
- public void performFragmentEffect(){
- if (this.fragmentCount == 0) return;
- if ((this.mode & M_MULTICOLUMN) == 0) {
- switch(this.mode & SPLIT_MASK) {
- case Alignment.M_COMPACT_SPLIT :
- case Alignment.M_COMPACT_FIRST_BREAK_SPLIT :
- case Alignment.M_NEXT_PER_LINE_SPLIT :
- case Alignment.M_NEXT_SHIFTED_SPLIT :
- case Alignment.M_ONE_PER_LINE_SPLIT :
- break;
- default:
- return;
- }
- }
-
- int fragmentIndentation = this.fragmentIndentations[this.fragmentIndex];
- if (this.startingColumn < 0 || (fragmentIndentation+1) < this.startingColumn) {
- if (this.fragmentBreaks[this.fragmentIndex] == BREAK) {
- this.scribe.printNewLine();
- }
- if (fragmentIndentation > 0) {
- this.scribe.indentationLevel = fragmentIndentation;
- }
- }
- }
-
- // reset fragment indentation/break status
- public void reset() {
-
- this.wasSplit = false;
- if (this.fragmentCount > 0){
- this.fragmentIndentations = new int[this.fragmentCount];
- this.fragmentBreaks = new int[this.fragmentCount];
- }
-
- // check for forced alignments
- if ((this.mode & M_FORCE) != 0) {
- couldBreak();
- }
- this.reset = true;
- }
-
- public void toFragmentsString(StringBuffer buffer){
- // default implementation
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer(10);
- return toString(buffer, -1);
- }
-
- public String toString(StringBuffer buffer, int level) {
-
- // Compute the indentation at the given level
- StringBuffer indentation = new StringBuffer();
- for (int i=0; i<level; i++) {
- indentation.append('\t');
- }
-
- // First line is for class and name
- buffer.append(indentation);
- buffer
- .append("<kind: ") //$NON-NLS-1$
- .append(this.kind)
- .append("> "); //$NON-NLS-1$
- buffer
- .append("<name: ") //$NON-NLS-1$
- .append(this.name)
- .append(">\n"); //$NON-NLS-1$
-
- // Line for depth and break indentation
- buffer.append(indentation);
- buffer
- .append("<depth=") //$NON-NLS-1$
- .append(depth())
- .append("><breakIndent=") //$NON-NLS-1$
- .append(this.breakIndentationLevel)
- .append("><shiftBreakIndent=") //$NON-NLS-1$
- .append(this.shiftBreakIndentationLevel)
- .append(">\n"); //$NON-NLS-1$
-
- // Line to display the location
- buffer.append(indentation);
- buffer
- .append("<location=") //$NON-NLS-1$
- .append(this.location.toString())
- .append(">\n"); //$NON-NLS-1$
-
- // Lines for fragments
- buffer
- .append(indentation)
- .append("<fragments:\n"); //$NON-NLS-1$
- for (int i = 0; i < this.fragmentCount; i++){
- buffer
- .append(indentation)
- .append(" - ") //$NON-NLS-1$
- .append(i)
- .append(": ") //$NON-NLS-1$
- .append("<break: ") //$NON-NLS-1$
- .append(this.fragmentBreaks[i] > 0 ? "YES" : "NO") //$NON-NLS-1$ //$NON-NLS-2$
- .append(">") //$NON-NLS-1$
- .append("<indent: ") //$NON-NLS-1$
- .append(this.fragmentIndentations[i])
- .append(">\n"); //$NON-NLS-1$
- }
- buffer
- .append(indentation)
- .append(">\n"); //$NON-NLS-1$
-
- // Display enclosing
- if (this.enclosing != null && level >= 0) {
- buffer
- .append(indentation)
- .append("<enclosing assignement:\n"); //$NON-NLS-1$
- this.enclosing.toString(buffer, level+1);
- buffer
- .append(indentation)
- .append(">\n"); //$NON-NLS-1$
- }
-
- // Return the result
- return buffer.toString();
- }
-
- public void update() {
- for (int i = 1; i < this.fragmentCount; i++){
- if (this.fragmentBreaks[i] == BREAK) {
- this.fragmentIndentations[i] = this.breakIndentationLevel;
- }
- }
- }
-
- public boolean wasReset() {
- return this.reset;
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/align/AlignmentException.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/align/AlignmentException.java
deleted file mode 100644
index 0b13215..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/align/AlignmentException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter.align;
-
-/**
- * Exception used to backtrack and break available alignments
- * When the exception is thrown, it is assumed that some alignment will be changed.
- *
- * @since 2.1
- */
-public class AlignmentException extends RuntimeException {
-
- public static final int LINE_TOO_LONG = 1;
- public static final int ALIGN_TOO_SMALL = 2;
- private static final long serialVersionUID = -3324134986466253314L; // backward compatible
-
- int reason;
- int value;
- public int relativeDepth;
-
- public AlignmentException(int reason, int relativeDepth) {
- this(reason, 0, relativeDepth);
- }
-
- public AlignmentException(int reason, int value, int relativeDepth) {
- this.reason = reason;
- this.value = value;
- this.relativeDepth = relativeDepth;
- }
-
- public String toString(){
- StringBuffer buffer = new StringBuffer(10);
- switch(this.reason){
- case LINE_TOO_LONG :
- buffer.append("LINE_TOO_LONG"); //$NON-NLS-1$
- break;
- case ALIGN_TOO_SMALL :
- buffer.append("ALIGN_TOO_SMALL"); //$NON-NLS-1$
- break;
- }
- buffer
- .append("<relativeDepth: ") //$NON-NLS-1$
- .append(this.relativeDepth)
- .append(">\n"); //$NON-NLS-1$
- return buffer.toString();
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.java
deleted file mode 100644
index 95d796f..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter.comment;
-
-import java.util.Map;
-
-import org.eclipse.text.edits.TextEdit;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-import org.eclipse.jface.text.DefaultPositionUpdater;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.Position;
-
-import org.aspectj.org.eclipse.jdt.core.ToolFactory;
-
-import org.aspectj.org.eclipse.jdt.internal.core.util.Util;
-
-/**
- * Comment formatting utils.
- *
- * @since 3.1
- */
-@SuppressWarnings("rawtypes")
-public class CommentFormatterUtil {
-
- /**
- * Evaluates the edit on the given string.
- *
- * @throws IllegalArgumentException if the positions are not inside the
- * string
- */
- public static String evaluateFormatterEdit(String string, TextEdit edit, Position[] positions) {
- try {
- Document doc= createDocument(string, positions);
- edit.apply(doc, 0);
- if (positions != null) {
- for (int i= 0; i < positions.length; i++) {
- Assert.isTrue(!positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$
- }
- }
- return doc.get();
- } catch (BadLocationException e) {
- log(e); // bug in the formatter
- Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Creates edits that describe how to format the given string. Returns
- * <code>null</code> if the code could not be formatted for the given
- * kind.
- *
- * @throws IllegalArgumentException if the offset and length are not
- * inside the string
- */
- public static TextEdit format2(int kind, String string, int indentationLevel, String lineSeparator, Map options) {
- int length= string.length();
- if (0 < 0 || length < 0 || 0 + length > string.length()) {
- throw new IllegalArgumentException("offset or length outside of string. offset: " + 0 + ", length: " + length + ", string size: " + string.length()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- }
- return ToolFactory.createCodeFormatter(options).format(kind, string, 0, length, indentationLevel, lineSeparator);
- }
-
- /**
- * Returns a document with the given content and the given positions
- * registered with the {@link DefaultPositionUpdater}.
- *
- * @param content the content
- * @param positions the positions
- * @return the document
- * @throws IllegalArgumentException
- */
- private static Document createDocument(String content, Position[] positions) throws IllegalArgumentException {
- Document doc= new Document(content);
- try {
- if (positions != null) {
- final String POS_CATEGORY= "myCategory"; //$NON-NLS-1$
-
- doc.addPositionCategory(POS_CATEGORY);
- doc.addPositionUpdater(new DefaultPositionUpdater(POS_CATEGORY) {
- protected boolean notDeleted() {
- if (this.fOffset < this.fPosition.offset && (this.fPosition.offset + this.fPosition.length < this.fOffset + this.fLength)) {
- this.fPosition.offset= this.fOffset + this.fLength; // deleted positions: set to end of remove
- return false;
- }
- return true;
- }
- });
- for (int i= 0; i < positions.length; i++) {
- try {
- doc.addPosition(POS_CATEGORY, positions[i]);
- } catch (BadLocationException e) {
- throw new IllegalArgumentException("Position outside of string. offset: " + positions[i].offset + ", length: " + positions[i].length + ", string size: " + content.length()); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- }
- }
- }
- } catch (BadPositionCategoryException cannotHappen) {
- // can not happen: category is correctly set up
- }
- return doc;
- }
-
- /**
- * Logs the given throwable.
- *
- * @param t the throwable
- * @since 3.1
- */
- public static void log(Throwable t) {
- Util.log(t, "Exception occured while formatting comments"); //$NON-NLS-1$
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/HTMLEntity2JavaReader.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/HTMLEntity2JavaReader.java
deleted file mode 100644
index 820e580..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/HTMLEntity2JavaReader.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Matt McCutchen - fix for bug 198153
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter.comment;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
-
-/**
- * <code>SubstitutionTextReader</code> that will substitute plain text values
- * for html entities encountered in the original text. Line breaks and
- * whitespace are preserved.
- *
- * @since 3.0
- */
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public class HTMLEntity2JavaReader extends SubstitutionTextReader {
-
- /** The hard-coded entity map. */
- private static final Map fgEntityLookup;
-
- static {
- fgEntityLookup= new HashMap(7);
- fgEntityLookup.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("circ", "^"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("tilde", "~"); //$NON-NLS-2$ //$NON-NLS-1$
- fgEntityLookup.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Creates a new instance that will read from <code>reader</code>
- *
- * @param reader the source reader
- */
- public HTMLEntity2JavaReader(Reader reader) {
- super(reader);
- setSkipWhitespace(false);
- }
-
- /*
- * @see org.aspectj.org.eclipse.jdt.internal.ui.text.SubstitutionTextReader#computeSubstitution(int)
- */
- protected String computeSubstitution(int c) throws IOException {
- if (c == '&')
- return processEntity();
- return null;
- }
-
- /**
- * Replaces an HTML entity body (without & and ;) with its
- * plain/text (or plain/java) counterpart.
- *
- * @param symbol the entity body to resolve
- * @return the plain/text counterpart of <code>symbol</code>
- */
- protected String entity2Text(String symbol) {
- if (symbol.length() > 1 && symbol.charAt(0) == '#') {
- int ch;
- try {
- if (symbol.charAt(1) == 'x') {
- ch= Integer.parseInt(symbol.substring(2), 16);
- } else {
- ch= Integer.parseInt(symbol.substring(1), 10);
- }
- return String.valueOf((char) ch);
- } catch (NumberFormatException e) {
- // ignore
- }
- } else {
- String str= (String) fgEntityLookup.get(symbol);
- if (str != null) {
- return str;
- }
- }
- return "&" + symbol; // not found //$NON-NLS-1$
- }
-
- /**
- * Reads an HTML entity from the stream and returns its plain/text
- * counterpart.
- *
- * @return an entity read from the stream, or the stream content.
- * @throws IOException if the underlying reader throws one
- */
- private String processEntity() throws IOException {
- StringBuffer buf= new StringBuffer();
- int ch= nextChar();
- while (ScannerHelper.isLetterOrDigit((char) ch) || ch == '#') {
- buf.append((char) ch);
- ch= nextChar();
- }
- if (ch == ';')
- return entity2Text(buf.toString());
- buf.insert(0, '&');
- if (ch != -1)
- buf.append((char) ch);
- return buf.toString();
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.java
deleted file mode 100644
index 642a358..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/IJavaDocTagConstants.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.aspectj.org.eclipse.jdt.internal.formatter.comment;
-
-/**
- * Javadoc tag constants.
- *
- * @since 3.0
- */
-public interface IJavaDocTagConstants {
-
- /** Javadoc single break tag */
- public static final char[][] JAVADOC_SINGLE_BREAK_TAG= new char[][] { "br".toCharArray() }; //$NON-NLS-1$
-
- /** Javadoc code tags */
- public static final char[][] JAVADOC_CODE_TAGS= new char[][] { "pre".toCharArray() }; //$NON-NLS-1$
-
- /** Javadoc break tags */
- public static final char[][] JAVADOC_BREAK_TAGS = new char[][] {
- "dd".toCharArray(), //$NON-NLS-1$
- "dt".toCharArray(), //$NON-NLS-1$
- "li".toCharArray(), //$NON-NLS-1$
- "td".toCharArray(), //$NON-NLS-1$
- "th".toCharArray(), //$NON-NLS-1$
- "h1".toCharArray(), //$NON-NLS-1$
- "h2".toCharArray(), //$NON-NLS-1$
- "h3".toCharArray(), //$NON-NLS-1$
- "h4".toCharArray(), //$NON-NLS-1$
- "h5".toCharArray(), //$NON-NLS-1$
- "h6".toCharArray(), //$NON-NLS-1$
- "q".toCharArray() //$NON-NLS-1$
- };
-
- /** Javadoc immutable tags */
- public static final char[][] JAVADOC_IMMUTABLE_TAGS= new char[][] {
- "code".toCharArray(), //$NON-NLS-1$
- "em".toCharArray(), //$NON-NLS-1$
- "pre".toCharArray(), //$NON-NLS-1$
- "q".toCharArray(), //$NON-NLS-1$
- "tt".toCharArray() //$NON-NLS-1$
- };
-
- /** Javadoc new line tags */
- public static final char[][] JAVADOC_NEWLINE_TAGS= new char[][] {
- "dd".toCharArray(), //$NON-NLS-1$
- "dt".toCharArray(), //$NON-NLS-1$
- "li".toCharArray(), //$NON-NLS-1$
- "td".toCharArray(), //$NON-NLS-1$
- "th".toCharArray(), //$NON-NLS-1$
- "tr".toCharArray(), //$NON-NLS-1$
- "h1".toCharArray(), //$NON-NLS-1$
- "h2".toCharArray(), //$NON-NLS-1$
- "h3".toCharArray(), //$NON-NLS-1$
- "h4".toCharArray(), //$NON-NLS-1$
- "h5".toCharArray(), //$NON-NLS-1$
- "h6".toCharArray(), //$NON-NLS-1$
- "q".toCharArray() //$NON-NLS-1$
- };
-
- /** Javadoc parameter tags */
- // TODO (frederic) should have another name than 'param' for the following tags
- // TODO (frederic) investigate how and why this list was created
- public static final char[][] JAVADOC_PARAM_TAGS= new char[][] {
- "@exception".toCharArray(), //$NON-NLS-1$
- "@param".toCharArray(), //$NON-NLS-1$
- "@serialField".toCharArray(), //$NON-NLS-1$
- "@throws".toCharArray() //$NON-NLS-1$
- };
-
- /** Javadoc separator tags */
- public static final char[][] JAVADOC_SEPARATOR_TAGS= new char[][] {
- "dl".toCharArray(), //$NON-NLS-1$
- "hr".toCharArray(), //$NON-NLS-1$
- "nl".toCharArray(), //$NON-NLS-1$
- "p".toCharArray(), //$NON-NLS-1$
- "pre".toCharArray(), //$NON-NLS-1$
- "ul".toCharArray(), //$NON-NLS-1$
- "ol".toCharArray(), //$NON-NLS-1$
- "table".toCharArray(), //$NON-NLS-1$
- "tr".toCharArray(), //$NON-NLS-1$
- };
-
- /** Javadoc tag prefix */
- public static final char JAVADOC_TAG_PREFIX= '@';
-
- /** Link tag postfix */
- public static final char LINK_TAG_POSTFIX= '}';
-
- /** Link tag prefix */
- public static final String LINK_TAG_PREFIX_STRING = "{@"; //$NON-NLS-1$
-
- public static final char[] LINK_TAG_PREFIX= LINK_TAG_PREFIX_STRING.toCharArray();
-
-
- /** Comment root tags */
- public static final char[][] COMMENT_ROOT_TAGS= new char[][] {
- "@deprecated".toCharArray(), //$NON-NLS-1$
- "@see".toCharArray(), //$NON-NLS-1$
- "@since".toCharArray(), //$NON-NLS-1$
- "@version".toCharArray() //$NON-NLS-1$
- };
-
- /** Tag prefix of comment tags */
- public static final char COMMENT_TAG_PREFIX= '@';
-
- /** BLOCK COMMENTS */
- public static final String BLOCK_HEADER = "/*"; //$NON-NLS-1$
- public static final int BLOCK_HEADER_LENGTH = BLOCK_HEADER.length();
- public static final String JAVADOC_HEADER = "/**"; //$NON-NLS-1$
- public static final int JAVADOC_HEADER_LENGTH = JAVADOC_HEADER.length();
- public static final String BLOCK_LINE_PREFIX = " * "; //$NON-NLS-1$
- public static final int BLOCK_LINE_PREFIX_LENGTH = BLOCK_LINE_PREFIX.length();
- public static final String BLOCK_FOOTER = "*/"; //$NON-NLS-1$
- public static final int BLOCK_FOOTER_LENGTH = BLOCK_FOOTER.length();
-
- /** LINE COMMENTS */
- public static final String LINE_COMMENT_PREFIX = "// "; //$NON-NLS-1$
- public static final int LINE_COMMENT_PREFIX_LENGTH = LINE_COMMENT_PREFIX.length();
-
- /** JAVADOC STAR */
- public static final String JAVADOC_STAR = "*"; //$NON-NLS-1$
-
- /*
- * Tags IDs
- */
- static final int JAVADOC_TAGS_INDEX_MASK = 0xFFFF;
- static final int JAVADOC_TAGS_ID_MASK = 0xFF00;
- static final int JAVADOC_SINGLE_BREAK_TAG_ID = 0x100;
- static final int JAVADOC_CODE_TAGS_ID = 0x200;
- static final int JAVADOC_BREAK_TAGS_ID = 0x400;
- static final int JAVADOC_IMMUTABLE_TAGS_ID = 0x800;
- static final int JAVADOC_SEPARATOR_TAGS_ID = 0x1000;
- static final int JAVADOC_SINGLE_TAGS_ID = JAVADOC_SINGLE_BREAK_TAG_ID; // ID max for tags ID with no opening/closing (e.g. <bla>....</bla>)
- static final int JAVADOC_CLOSED_TAG = 0x10000;
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.java
deleted file mode 100644
index 72aed81..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/Java2HTMLEntityReader.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Matt McCutchen - fix for bug 197169 and complementary fix for 109636
- *******************************************************************************/
-package org.aspectj.org.eclipse.jdt.internal.formatter.comment;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.*;
-
-/**
- * <code>SubstitutionTextReader</code> that will substitute html entities for
- * html symbols encountered in the original text. Line breaks and whitespaces
- * are preserved.
- *
- * @since 3.0
- */
-@SuppressWarnings({"rawtypes", "unchecked"})
-public class Java2HTMLEntityReader extends SubstitutionTextReader {
-
- private static final int BEGIN_LINE = 0x01;
-
- /** The hardcoded entity map. */
- private static final Map fgEntityLookup;
-
- /**
- * True if we have not yet seen a non-whitespace character on the current
- * line.
- */
- private int bits = BEGIN_LINE;
-
- static {
- fgEntityLookup= new HashMap(7);
- fgEntityLookup.put("<", "<"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put(">", ">"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("&", "&"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("^", "ˆ"); //$NON-NLS-1$ //$NON-NLS-2$
- fgEntityLookup.put("~", "˜"); //$NON-NLS-2$ //$NON-NLS-1$
- fgEntityLookup.put("\"", """); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Creates a new instance that will read from <code>reader</code>
- *
- * @param reader the source reader
- */
- public Java2HTMLEntityReader(Reader reader) {
- super(reader);
- setSkipWhitespace(false);
- }
-
- /*
- * @see org.aspectj.org.eclipse.jdt.internal.ui.text.SubstitutionTextReader#computeSubstitution(int)
- */
- protected String computeSubstitution(int c) throws IOException {
- StringBuffer buf = new StringBuffer();
- // Accumulate *s into the buffer until we see something other than *.
- while (c == '*') {
- this.bits &= ~BEGIN_LINE;
- c = nextChar();
- buf.append('*');
- }
- if (c == -1)
- // Snippet must have ended with *s. Just return them.
- return buf.toString();
- if (c == '/' && buf.length() > 0) {
- /*
- * Translate a * that precedes a / to * so it isn't
- * misinterpreted as the end of the Javadoc comment that contains
- * the code we are formatting.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=109636
- */
- buf.setLength(buf.length() - 1);
- buf.append("*/"); //$NON-NLS-1$
- } else if (c == '@' && (this.bits & BEGIN_LINE) != 0) {
- /*
- * When @ is first on a line, translate it to @ so it isn't
- * misinterpreted as a Javadoc tag.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=197169
- */
- buf.append("@"); //$NON-NLS-1$
- } else {
- /*
- * Ordinary processing. If the character needs an entity in HTML,
- * add the entity, otherwise add the character.
- */
- String entity = (String) fgEntityLookup.get(String.valueOf((char) c));
- if (entity != null)
- buf.append(entity);
- else
- buf.append((char) c);
- }
- // Update bits for the benefit of the next character.
- if (c == '\n' || c == '\r') {
- this.bits |= BEGIN_LINE;
- } else if (!ScannerHelper.isWhitespace((char) c)) {
- this.bits &= ~BEGIN_LINE;
- }
- return buf.toString();
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.java
deleted file mode 100644
index 7f987b8..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Matt McCutchen - add check for EOF handling
- ******************************************************************************/
-
-package org.aspectj.org.eclipse.jdt.internal.formatter.comment;
-
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
-
-/**
- * Reads the text contents from a reader and computes for each character
- * a potential substitution. The substitution may eat more characters than
- * only the one passed into the computation routine.
- */
-public abstract class SubstitutionTextReader extends Reader {
-
- private Reader fReader;
- private boolean fWasWhiteSpace;
- private int fCharAfterWhiteSpace;
-
- /**
- * Tells whether white space characters are skipped.
- */
- private boolean fSkipWhiteSpace= true;
-
- private boolean fReadFromBuffer;
- private StringBuffer fBuffer;
- private int fIndex;
-
-
- protected SubstitutionTextReader(Reader reader) {
- this.fReader= reader;
- this.fBuffer= new StringBuffer();
- this.fIndex= 0;
- this.fReadFromBuffer= false;
- this.fCharAfterWhiteSpace= -1;
- this.fWasWhiteSpace= true;
- }
-
- /**
- * Gets the content as a String
- */
- public String getString() throws IOException {
- StringBuffer buf= new StringBuffer();
- int ch;
- while ((ch= read()) != -1) {
- buf.append((char)ch);
- }
- return buf.toString();
- }
-
- /**
- * Implement to compute the substitution for the given character and
- * if necessary subsequent characters. Use <code>nextChar</code>
- * to read subsequent characters.
- */
- protected abstract String computeSubstitution(int c) throws IOException;
-
- /**
- * Returns the internal reader.
- */
- protected Reader getReader() {
- return this.fReader;
- }
-
- /**
- * Returns the next character.
- */
- protected int nextChar() throws IOException {
- this.fReadFromBuffer= (this.fBuffer.length() > 0);
- if (this.fReadFromBuffer) {
- char ch= this.fBuffer.charAt(this.fIndex++);
- if (this.fIndex >= this.fBuffer.length()) {
- this.fBuffer.setLength(0);
- this.fIndex= 0;
- }
- return ch;
- } else {
- int ch= this.fCharAfterWhiteSpace;
- if (ch == -1) {
- ch= this.fReader.read();
- }
- if (this.fSkipWhiteSpace && ScannerHelper.isWhitespace((char)ch)) {
- do {
- ch= this.fReader.read();
- } while (ScannerHelper.isWhitespace((char)ch));
- if (ch != -1) {
- this.fCharAfterWhiteSpace= ch;
- return ' ';
- }
- } else {
- this.fCharAfterWhiteSpace= -1;
- }
- return ch;
- }
- }
-
- /*
- * @see Reader#read()
- */
- public int read() throws IOException {
- int c;
- do {
-
- c= nextChar();
- while (!this.fReadFromBuffer && c != -1) {
- String s= computeSubstitution(c);
- if (s == null)
- break;
- if (s.length() > 0)
- this.fBuffer.insert(0, s);
- c= nextChar();
- }
-
- } while (this.fSkipWhiteSpace && this.fWasWhiteSpace && (c == ' '));
- this.fWasWhiteSpace= (c == ' ' || c == '\r' || c == '\n');
- return c;
- }
-
- /*
- * @see Reader#read(char[],int,int)
- */
- public int read(char cbuf[], int off, int len) throws IOException {
- int end= off + len;
- for (int i= off; i < end; i++) {
- int ch= read();
- if (ch == -1) {
- if (i == off) {
- return -1;
- } else {
- return i - off;
- }
- }
- cbuf[i]= (char)ch;
- }
- return len;
- }
-
- /*
- * @see java.io.Reader#ready()
- */
- public boolean ready() throws IOException {
- return this.fReader.ready();
- }
-
- /*
- * @see Reader#close()
- */
- public void close() throws IOException {
- this.fReader.close();
- }
-
- /*
- * @see Reader#reset()
- */
- public void reset() throws IOException {
- this.fReader.reset();
- this.fWasWhiteSpace= true;
- this.fCharAfterWhiteSpace= -1;
- this.fBuffer.setLength(0);
- this.fIndex= 0;
- }
-
- protected final void setSkipWhitespace(boolean state) {
- this.fSkipWhiteSpace= state;
- }
-
- protected final boolean isSkippingWhitespace() {
- return this.fSkipWhiteSpace;
- }
-}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/package.html b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/package.html
deleted file mode 100644
index d2210a7..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/comment/package.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-Provides facilities to format comments in Java source code.
-<h2>
-Package Specification</h2>
-This package provides interfaces and implementations for three kinds of comment types used in
-Java source code:
-<ul>
-<li>Javadoc comments</li>
-<li>Multi-line comments</li>
-<li>Single-line comments</li>
-</ul>
-<h3>
-Comment Formatting</h3>
-Comment regions form the principle access point to the formatting of comments. To create a comment
-region for a specified comment type, the factory method
-<tt>CommentObjectFactory#createRegion(IDocument, TypedPosition, String, Map, StyledText)</tt>
-should be used.<p>
-The formatting process is then launch by calling <tt>CommentRegion#format(String)</tt>, where
-the argument denotes the desired indentation. This method returns a textedit representing the changes that where made during
-the formatting process. The document for which the comment region was created is therefore guaranteed
-to remain unchanged.<p>
-Internally, the comment region is first cast into comment lines to form the basis of the following scan step:
-Each comment line is scanned for valid prefixes and tokenized afterwards. This tokenize step yields a stream of
-tokens called comment ranges that are then marked with attributes representing information about the kind of
-token associated with that comment range.<p>
-Once the comment ranges have enough attributed information, the comment region wraps the comment ranges at
-the line margin boundary. This is coordinated by a set of rules that can be contributed to a certain type of comment
-region. At this point of time, the comment range stream already represents the formatted comment region. The last
-step therefore is to record the edits and to construct the resulting text edit, which describes all the changes that were
-made to the comment region.
-<br>
-Note that the changes are not directly applied to the document. Clients are responsible for applying the textedit
-and updating and preserving the document structure.
-<p>
-All the objects used during comment formatting should not directly be instantiated, but
-rather retrieved from the factory <tt>CommentObjectFactory</tt>. This factory ensures
-that the right kind of regions and lines are returned for a specific comment type.
-</body>
-</html>
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/CommentWrapExecutor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/CommentWrapExecutor.java
new file mode 100644
index 0000000..5e260c5
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/CommentWrapExecutor.java
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter.linewrap;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameNotAToken;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameWHITESPACE;
+import static org.aspectj.org.eclipse.jdt.internal.formatter.CommentsPreparator.COMMENT_LINE_SEPARATOR_LENGTH;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenManager;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenTraverser;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token.WrapPolicy;
+
+public class CommentWrapExecutor extends TokenTraverser {
+
+ private final TokenManager tm;
+ private final DefaultCodeFormatterOptions options;
+
+ private final ArrayList<Token> nlsTags = new ArrayList<Token>();
+
+ private int lineStartPosition;
+ private List<Token> blockStructure;
+ private boolean simulation;
+ private boolean wrapDisabled;
+
+ private Token potentialWrapToken, potentialWrapTokenSubstitute;
+ private int counterIfWrapped, counterIfWrappedSubstitute;
+ private int lineCounter;
+
+ public CommentWrapExecutor(TokenManager tokenManager, DefaultCodeFormatterOptions options) {
+ this.tm = tokenManager;
+ this.options = options;
+ }
+
+ /**
+ * @param commentToken token to wrap
+ * @param startPosition position in line of the beginning of the comment
+ * @param simulate if {@code true}, the properties of internal tokens will not really change. This
+ * mode is useful for checking how much space the comment takes.
+ * @param noWrap if {@code true}, it means that wrapping is disabled for this comment (for example because there's
+ * a NON-NLS tag after it). This method is still useful for checking comment length in that case.
+ * @return position in line at the end of comment
+ */
+ public int wrapMultiLineComment(Token commentToken, int startPosition, boolean simulate, boolean noWrap) {
+ this.lineCounter = 1;
+ this.counter = startPosition;
+
+ List<Token> structure = commentToken.getInternalStructure();
+ if (structure == null || structure.isEmpty())
+ return startPosition + this.tm.getLength(commentToken, startPosition);
+
+ commentToken.setIndent(this.tm.toIndent(startPosition, true));
+ this.lineStartPosition = commentToken.getIndent();
+ this.simulation = simulate;
+ this.wrapDisabled = noWrap;
+ this.potentialWrapToken = this.potentialWrapTokenSubstitute = null;
+ this.blockStructure = structure;
+ traverse(structure, 0);
+
+ boolean newLinesAtBoundries = commentToken.tokenType == TokenNameCOMMENT_JAVADOC
+ ? this.options.comment_new_lines_at_javadoc_boundaries
+ : this.options.comment_new_lines_at_block_boundaries;
+ if (this.lineCounter > 1 && newLinesAtBoundries) {
+ Token endingToken = structure.get(structure.size() - 1);
+ if (!simulate && endingToken.tokenType != TokenNameNotAToken) {
+ structure.get(0).breakAfter();
+ endingToken.breakBefore();
+ endingToken.setAlign(1);
+ }
+ return startPosition + this.tm.getLength(endingToken, startPosition);
+ } else if (this.lineCounter > 1 && !newLinesAtBoundries) {
+ // the rest of this code assumes that newLinesAtBoundries==true, so now subtract the additional lines
+ this.lineCounter -= 2;
+
+ this.lineCounter -= structure.get(1).getLineBreaksBefore();
+ structure.get(1).clearLineBreaksBefore();
+ Token last = structure.get(structure.size() - 1);
+ this.lineCounter -= last.getLineBreaksBefore();
+ last.clearLineBreaksBefore();
+ }
+ return this.counter;
+ }
+
+ public int getLinesCount() {
+ return this.lineCounter;
+ }
+
+ @Override
+ protected boolean token(Token token, int index) {
+ int positionIfNewLine = this.lineStartPosition + token.getAlign() + token.getIndent();
+ if (token.tokenType != TokenNameNotAToken)
+ positionIfNewLine += COMMENT_LINE_SEPARATOR_LENGTH;
+ if (getLineBreaksBefore() > 0) {
+ this.lineCounter = Math.max(this.lineCounter + getLineBreaksBefore(), 4);
+ this.counter = positionIfNewLine;
+ this.potentialWrapToken = this.potentialWrapTokenSubstitute = null;
+
+ boolean isFormattedCode = token.getWrapPolicy() != null
+ && token.getWrapPolicy() != WrapPolicy.SUBSTITUTE_ONLY;
+ if (!isFormattedCode && token.getAlign() == 0) {
+ // Indents are reserved for code inside <pre>.
+ // Indentation of javadoc tags can be achieved with align
+ token.setAlign(token.getIndent());
+ token.setIndent(0);
+ }
+ }
+
+ boolean canWrap = getNext() != null && getLineBreaksBefore() == 0 && index > 1
+ && positionIfNewLine < this.counter;
+ if (canWrap) {
+ if (token.getWrapPolicy() == null) {
+ this.potentialWrapToken = token;
+ this.counterIfWrapped = positionIfNewLine;
+ } else if (token.getWrapPolicy() == WrapPolicy.SUBSTITUTE_ONLY) {
+ this.potentialWrapTokenSubstitute = token;
+ this.counterIfWrappedSubstitute = positionIfNewLine;
+ }
+ }
+
+ this.counter += this.tm.getLength(token, this.counter);
+ this.counterIfWrapped += this.tm.getLength(token, this.counterIfWrapped);
+ this.counterIfWrappedSubstitute += this.tm.getLength(token, this.counterIfWrappedSubstitute);
+ if (shouldWrap()) {
+ if (this.potentialWrapToken == null) {
+ assert this.potentialWrapTokenSubstitute != null;
+ this.potentialWrapToken = this.potentialWrapTokenSubstitute;
+ this.counterIfWrapped = this.counterIfWrappedSubstitute;
+ }
+ this.counter = this.counterIfWrapped;
+ if (!this.simulation) {
+ this.potentialWrapToken.breakBefore();
+ // Indents are reserved for code inside <pre>.
+ // Indentation of javadoc tags can be achieved with align
+ this.potentialWrapToken.setAlign(this.potentialWrapToken.getIndent());
+ this.potentialWrapToken.setIndent(0);
+ }
+ this.lineCounter = Math.max(this.lineCounter + 1, 4);
+ this.potentialWrapToken = this.potentialWrapTokenSubstitute = null;
+ }
+
+ if (isSpaceAfter()) {
+ this.counter++;
+ this.counterIfWrapped++;
+ }
+
+ return true;
+ }
+
+ private boolean shouldWrap() {
+ int lineLenght = this.options.comment_line_length;
+ if (this.wrapDisabled || this.counter <= lineLenght)
+ return false;
+ if (this.potentialWrapToken != null && this.potentialWrapTokenSubstitute != null
+ && this.counterIfWrapped > lineLenght && this.counterIfWrappedSubstitute < this.counterIfWrapped) {
+ // there is a normal token to wrap, but the line would overflow anyway - better use substitute
+ this.potentialWrapToken = null;
+ }
+ if (this.potentialWrapToken == null && this.potentialWrapTokenSubstitute == null) {
+ boolean isFormattingEnabled = this.blockStructure.size() > 1
+ && this.blockStructure.get(1).tokenType == TokenNameNotAToken;
+ if (isFormattingEnabled) {
+ // can't wrap, but the long comment cannot stay in one line
+ this.lineCounter = Math.max(this.lineCounter, 3);
+ }
+ return false;
+ }
+
+ if (this.options.comment_new_lines_at_javadoc_boundaries) {
+ if (getNext() == null) { // the closing token will go to the next line anyway
+ this.lineCounter = Math.max(this.lineCounter, 3);
+ return false;
+ }
+ if (this.lineCounter == 1) {
+ // when wrapping the first line of javadoc (more asterisks in opening token), the line will
+ // move to the left so it may not need wrapping in the end
+ int openingTokenLength = this.tm.getLength(this.blockStructure.get(0), 0);
+ if (this.counter - (openingTokenLength - 2) <= lineLenght) {
+ this.counter -= (openingTokenLength - 2);
+ this.lineCounter = Math.max(this.lineCounter, 3);
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void wrapLineComment(Token commentToken, int startPosition) {
+ List<Token> structure = commentToken.getInternalStructure();
+ if (structure == null || structure.isEmpty())
+ return;
+ int commentIndex = this.tm.indexOf(commentToken);
+ boolean isHeader = this.tm.isInHeader(commentIndex);
+ boolean formattingEnabled = (this.options.comment_format_line_comment && !isHeader)
+ || (this.options.comment_format_header && isHeader);
+ if (!formattingEnabled)
+ return;
+
+ int position = startPosition;
+ startPosition = this.tm.toIndent(startPosition, true);
+ int indent = startPosition;
+
+ for (Token token : structure) {
+ if (token.hasNLSTag()) {
+ this.nlsTags.add(token);
+ position += token.countChars() + (token.isSpaceBefore() ? 1 : 0);
+ }
+ }
+
+ Token whitespace = null;
+ Token prefix = structure.get(0);
+ if (prefix.tokenType == TokenNameWHITESPACE) {
+ whitespace = new Token(prefix);
+ whitespace.breakBefore();
+ whitespace.setWrapPolicy(new WrapPolicy(0, commentIndex, false));
+ prefix = structure.get(1);
+ }
+ int prefixEnd = commentToken.originalStart + 1;
+ if (prefix.tokenType == TokenNameCOMMENT_LINE)
+ prefixEnd = Math.max(prefixEnd, prefix.originalEnd);
+ prefix = new Token(commentToken.originalStart, prefixEnd, TokenNameCOMMENT_LINE);
+ if (whitespace == null) {
+ prefix.breakBefore();
+ prefix.setWrapPolicy(new WrapPolicy(0, commentIndex, false));
+ }
+
+ int lineStartIndex = whitespace == null ? 0 : 1;
+ for (int i = 0; i < structure.size(); i++) {
+ Token token = structure.get(i);
+ token.setIndent(indent);
+ if (token.hasNLSTag()) {
+ this.nlsTags.remove(token);
+ continue;
+ }
+ if (token.isSpaceBefore())
+ position++;
+ if (token.getLineBreaksBefore() > 0) {
+ position = startPosition;
+ lineStartIndex = whitespace == null ? i : i + 1;
+ if (whitespace != null && token != whitespace) {
+ token.clearLineBreaksBefore();
+ structure.add(i, whitespace);
+ token = whitespace;
+ }
+ }
+ position += this.tm.getLength(token, position);
+ if (position > this.options.comment_line_length && i > lineStartIndex + 1) {
+ structure.add(i, prefix);
+ if (whitespace != null)
+ structure.add(i, whitespace);
+
+ structure.removeAll(this.nlsTags);
+ structure.addAll(i, this.nlsTags);
+ i = i + this.nlsTags.size() - 1;
+ this.nlsTags.clear();
+ }
+ }
+ this.nlsTags.clear();
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner.java
new file mode 100644
index 0000000..f76c43c
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/FieldAligner.java
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter.linewrap;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameEQUAL;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameIdentifier;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.aspectj.org.eclipse.jdt.core.dom.BodyDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.SimpleName;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenManager;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenTraverser;
+
+/** Implementation of the "Align fields on columns" feature */
+public class FieldAligner {
+ private class PositionCounter extends TokenTraverser {
+ int stoppingIndex;
+ int maxPosition;
+
+ public PositionCounter() {
+ // nothing to do
+ }
+
+ @Override
+ protected boolean token(Token token, int index) {
+ if (index == this.stoppingIndex)
+ return false;
+ if (getLineBreaksBefore() > 0)
+ this.counter = FieldAligner.this.tm.getPositionInLine(index);
+ if (token.getAlign() > 0)
+ this.counter = token.getAlign();
+ this.counter += FieldAligner.this.tm.getLength(token, this.counter);
+ if (isSpaceAfter() && getLineBreaksAfter() == 0)
+ this.counter++;
+ this.maxPosition = Math.max(this.maxPosition, this.counter);
+ return true;
+ }
+
+ public int findMaxPosition(int fromIndex, int toIndex) {
+ this.counter = FieldAligner.this.tm.getPositionInLine(fromIndex);
+ this.stoppingIndex = toIndex;
+ this.maxPosition = 0;
+ FieldAligner.this.tm.traverse(fromIndex, this);
+ return this.maxPosition;
+ }
+ }
+
+ private final List<List<FieldDeclaration>> fieldAlignGroups = new ArrayList<List<FieldDeclaration>>();
+
+ final TokenManager tm;
+
+ private final DefaultCodeFormatterOptions options;
+
+ public FieldAligner(TokenManager tokenManager, DefaultCodeFormatterOptions options) {
+ this.tm = tokenManager;
+ this.options = options;
+ }
+
+ public void prepareAlign(TypeDeclaration node) {
+ List<FieldDeclaration> bodyDeclarations = node.bodyDeclarations();
+ ArrayList<FieldDeclaration> alignGroup = new ArrayList<FieldDeclaration>();
+ BodyDeclaration previous = null;
+ for (BodyDeclaration declaration : bodyDeclarations) {
+ if (!alignGroup.isEmpty()) {
+ if ((declaration instanceof FieldDeclaration) && !areSeparated(previous, declaration)) {
+ alignGroup.add((FieldDeclaration) declaration);
+ } else {
+ alignFields(alignGroup);
+ alignGroup = new ArrayList<FieldDeclaration>();
+ }
+ }
+ if (alignGroup.isEmpty()) {
+ if (declaration instanceof FieldDeclaration)
+ alignGroup.add((FieldDeclaration) declaration);
+ }
+ previous = declaration;
+ }
+ alignFields(alignGroup);
+ }
+
+ private boolean areSeparated(BodyDeclaration declaration1, BodyDeclaration declaration2) {
+ // check if there are more empty lines between fields than normal
+ if (this.options.number_of_empty_lines_to_preserve <= this.options.blank_lines_before_field)
+ return false;
+ int maxLineBreaks = 0;
+ int from = this.tm.lastIndexIn(declaration1, -1);
+ int to = this.tm.firstIndexIn(declaration2, -1);
+
+ Token previous = this.tm.get(from);
+ for (int i = from + 1; i <= to; i++) {
+ Token token = this.tm.get(i);
+ maxLineBreaks = Math.max(maxLineBreaks, this.tm.countLineBreaksBetween(previous, token));
+ previous = token;
+ }
+ return maxLineBreaks - 1 > this.options.blank_lines_before_field;
+ }
+
+ private void alignFields(ArrayList<FieldDeclaration> alignGroup) {
+ if (alignGroup.size() < 2)
+ return;
+ this.fieldAlignGroups.add(alignGroup);
+
+ int maxNameAlign = 0;
+ for (FieldDeclaration declaration : alignGroup) {
+ List<VariableDeclarationFragment> fragments = declaration.fragments();
+ SimpleName fieldName = fragments.get(0).getName();
+ int nameIndex = this.tm.firstIndexIn(fieldName, TokenNameIdentifier);
+ int positionInLine = this.tm.getPositionInLine(nameIndex);
+ maxNameAlign = Math.max(maxNameAlign, positionInLine);
+ }
+ maxNameAlign = this.tm.toIndent(maxNameAlign, true);
+
+ int maxAssignAlign = 0;
+ for (FieldDeclaration declaration : alignGroup) {
+ List<VariableDeclarationFragment> fragments = declaration.fragments();
+ VariableDeclarationFragment fragment = fragments.get(0);
+ int nameIndex = this.tm.firstIndexIn(fragment.getName(), TokenNameIdentifier);
+ Token nameToken = this.tm.get(nameIndex);
+
+ nameToken.setAlign(maxNameAlign);
+
+ if (fragment.getInitializer() != null) {
+ int equalIndex = this.tm.firstIndexAfter(fragment.getName(), TokenNameEQUAL);
+ int positionInLine = this.tm.getPositionInLine(equalIndex);
+ maxAssignAlign = Math.max(maxAssignAlign, positionInLine);
+ }
+ }
+ maxAssignAlign = this.tm.toIndent(maxAssignAlign, true);
+
+ for (FieldDeclaration declaration : alignGroup) {
+ List<VariableDeclarationFragment> fragments = declaration.fragments();
+ VariableDeclarationFragment fragment = fragments.get(0);
+ if (fragment.getInitializer() != null) {
+ int assingIndex = this.tm.firstIndexAfter(fragment.getName(), TokenNameEQUAL);
+ Token assignToken = this.tm.get(assingIndex);
+ assignToken.setAlign(maxAssignAlign);
+
+ int baseIndent = this.tm.getPositionInLine(assingIndex + 1) - assignToken.getIndent();
+ int lastIndex = this.tm.lastIndexIn(declaration, -1);
+ for (int i = assingIndex + 1; i <= lastIndex; i++) {
+ Token token = this.tm.get(i);
+ token.setIndent(baseIndent + token.getIndent());
+ }
+ }
+ }
+ }
+
+ public void alignComments() {
+ if (this.fieldAlignGroups.isEmpty())
+ return;
+ PositionCounter positionCounter = new PositionCounter();
+ // align comments after field declarations
+ for (List<FieldDeclaration> alignGroup : this.fieldAlignGroups) {
+ int maxCommentAlign = 0;
+ for (FieldDeclaration declaration : alignGroup) {
+ int typeIndex = this.tm.firstIndexIn(declaration.getType(), -1);
+ int firstIndexInLine = this.tm.findFirstTokenInLine(typeIndex);
+ int lastIndex = this.tm.lastIndexIn(declaration, -1) + 1;
+ maxCommentAlign = Math.max(maxCommentAlign,
+ positionCounter.findMaxPosition(firstIndexInLine, lastIndex));
+ }
+ maxCommentAlign = this.tm.toIndent(maxCommentAlign, true);
+
+ for (FieldDeclaration declaration : alignGroup) {
+ int typeIndex = this.tm.firstIndexIn(declaration.getType(), -1);
+ int firstIndexInLine = this.tm.findFirstTokenInLine(typeIndex);
+ int lastIndex = this.tm.lastIndexIn(declaration, -1);
+ lastIndex = Math.min(lastIndex, this.tm.size() - 2);
+ for (int i = firstIndexInLine; i <= lastIndex; i++) {
+ Token token = this.tm.get(i);
+ Token next = this.tm.get(i + 1);
+ boolean lineBreak = token.getLineBreaksAfter() > 0 || next.getLineBreaksBefore() > 0;
+ if (lineBreak) {
+ if (token.tokenType == TokenNameCOMMENT_BLOCK) {
+ token.setAlign(maxCommentAlign);
+ } else {
+ this.tm.addNLSAlignIndex(i, maxCommentAlign);
+ }
+ } else if (next.tokenType == TokenNameCOMMENT_LINE
+ || (next.tokenType == TokenNameCOMMENT_BLOCK && i == lastIndex)) {
+ next.setAlign(maxCommentAlign);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
new file mode 100644
index 0000000..b988ba5
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapExecutor.java
@@ -0,0 +1,658 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] follow up bug for comments - https://bugs.eclipse.org/458208
+ * Mateusz Matela <mateusz.matela@gmail.com> - NPE in WrapExecutor during Java text formatting - https://bugs.eclipse.org/465669
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter.linewrap;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+
+import org.aspectj.org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
+import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenManager;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenTraverser;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token.WrapPolicy;
+
+public class WrapExecutor {
+
+ private static class WrapInfo {
+ public int wrapTokenIndex;
+ public int indent;
+
+ public WrapInfo(int wrapIndex, int indent) {
+ this.wrapTokenIndex = wrapIndex;
+ this.indent = indent;
+ }
+
+ public WrapInfo() {
+ // empty constructor
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + this.indent;
+ result = prime * result + this.wrapTokenIndex;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ WrapInfo other = (WrapInfo) obj;
+ if (this.indent != other.indent)
+ return false;
+ if (this.wrapTokenIndex != other.wrapTokenIndex)
+ return false;
+ return true;
+ }
+
+ }
+
+ private static class WrapResult {
+
+ public static final WrapResult NO_WRAP_NEEDED = new WrapResult(0, 0, null);
+
+ public static final WrapResult TOP_PRIORITY_WRAP_MET = new WrapResult(0, 0, null);
+
+ public final double penalty;
+ public final int totalExtraLines;
+ /**
+ * Contains information about the next wrap in the result or <code>null</code> if this is the last wrap.
+ * Can be used as a key in {@link WrapExecutor#wrapSearchResults} to retrieve the next wraps.
+ */
+ public final WrapInfo nextWrap;
+
+ WrapResult(double penalty, int extraLines, WrapInfo nextWrap) {
+ this.penalty = penalty;
+ this.totalExtraLines = extraLines;
+ this.nextWrap = nextWrap;
+ }
+ }
+
+ private class LineAnalyzer extends TokenTraverser {
+
+ final private CommentWrapExecutor commentWrapper;
+ private int lineIndent;
+ int firstPotentialWrap;
+ int extraLines;
+ boolean lineExceeded;
+ final List<Integer> extraLinesPerComment = new ArrayList<Integer>();
+ final List<Integer> topPriorityGroupStarts = new ArrayList<Integer>();
+ int currentTopPriorityGroupEnd;
+ private boolean isNLSTagInLine;
+
+ public LineAnalyzer(TokenManager tokenManager, DefaultCodeFormatterOptions options) {
+ this.commentWrapper = new CommentWrapExecutor(tokenManager, options);
+ }
+
+ /**
+ * @return index of the last token in line
+ */
+ public int analyzeLine(int startIndex, int indent) {
+ Token startToken = WrapExecutor.this.tm.get(startIndex);
+ this.counter = WrapExecutor.this.tm.toIndent(indent, startToken.isWrappable());
+ this.lineIndent = indent;
+ this.firstPotentialWrap = -1;
+ this.extraLines = 0;
+ this.extraLinesPerComment.clear();
+ this.topPriorityGroupStarts.clear();
+ this.currentTopPriorityGroupEnd = -1;
+ this.isNLSTagInLine = false;
+ return WrapExecutor.this.tm.traverse(startIndex, this);
+ }
+
+ @Override
+ protected boolean token(Token token, int index) {
+ if (token.tokenType == TokenNameCOMMENT_LINE)
+ return false;
+
+ if (token.hasNLSTag())
+ this.isNLSTagInLine = true;
+
+ if (token.isWrappable()) {
+ WrapPolicy wrapPolicy = token.getWrapPolicy();
+ if (wrapPolicy.isTopPriority() && getLineBreaksBefore() == 0
+ && index > this.currentTopPriorityGroupEnd) {
+ this.topPriorityGroupStarts.add(index);
+ this.currentTopPriorityGroupEnd = wrapPolicy.topPriorityGroupEnd;
+ }
+ if (this.firstPotentialWrap < 0 && getWrapIndent(token) < this.counter)
+ this.firstPotentialWrap = index;
+ }
+
+ if (token.getAlign() > 0) {
+ this.counter = token.getAlign();
+ } else if (isSpaceBefore() && getLineBreaksBefore() == 0 && index > 0) {
+ this.counter++;
+ }
+
+ if (token.isComment()) {
+ this.counter = this.commentWrapper.wrapMultiLineComment(token, this.counter, true, this.isNLSTagInLine);
+ this.extraLines += this.commentWrapper.getLinesCount() - 1;
+ this.extraLinesPerComment.add(this.commentWrapper.getLinesCount() - 1);
+ } else {
+ this.counter += WrapExecutor.this.tm.getLength(token, this.counter);
+ }
+
+ this.lineExceeded = this.counter > WrapExecutor.this.options.page_width;
+ if (this.lineExceeded && this.firstPotentialWrap >= 0) {
+ return false;
+ }
+ if (!token.isNextLineOnWrap())
+ token.setIndent(this.lineIndent);
+
+ boolean isLineEnd = getLineBreaksAfter() > 0 || getNext() == null;
+ assert !(token.isNextLineOnWrap() && !isLineEnd);
+ return !isLineEnd;
+ }
+
+ public int getLastPosition() {
+ return this.counter;
+ }
+ }
+
+ private class NLSTagHandler extends TokenTraverser {
+ private final ArrayList<Token> nlsTags = new ArrayList<Token>();
+
+ public NLSTagHandler() {
+ // nothing to do
+ }
+
+ @Override
+ protected boolean token(final Token token, final int index) {
+ if (token.hasNLSTag())
+ this.nlsTags.add(token.getNLSTag());
+
+ if (getLineBreaksAfter() > 0 || getNext() == null) {
+ // make sure there's a line comment with all necessary NLS tags
+ Token lineComment = token;
+ if (token.tokenType != TokenNameCOMMENT_LINE) {
+ if (this.nlsTags.isEmpty())
+ return true;
+ lineComment = new Token(token.originalEnd + 1, token.originalEnd + 1, TokenNameCOMMENT_LINE);
+ lineComment.breakAfter();
+ lineComment.spaceBefore();
+ lineComment.setAlign(WrapExecutor.this.tm.getNLSAlign(index));
+ lineComment.setInternalStructure(new ArrayList<Token>());
+ WrapExecutor.this.tm.insert(index + 1, lineComment);
+ structureChanged();
+ return true; // will fill the line comment structure in next step
+ }
+
+ List<Token> structure = lineComment.getInternalStructure();
+ if (structure == null) {
+ if (this.nlsTags.isEmpty())
+ return true;
+ structure = new ArrayList<Token>();
+ structure.add(lineComment);
+ lineComment.setInternalStructure(structure);
+ }
+
+ boolean isPrefixMissing = false;
+ for (int i = 0; i < structure.size(); i++) {
+ Token fragment = structure.get(i);
+ // remove NLS tags that are not associated with this line
+ // (these have been added on wrapped lines earlier)
+ if (fragment.hasNLSTag()) {
+ if (!this.nlsTags.remove(fragment)) {
+ if (i == 0)
+ isPrefixMissing = true;
+ structure.remove(i--);
+ } else {
+ isPrefixMissing = false;
+ }
+ } else if (isPrefixMissing) {
+ // remove trailing whitespace
+ int pos = fragment.originalStart;
+ while (pos <= fragment.originalEnd
+ && ScannerHelper.isWhitespace(WrapExecutor.this.tm.charAt(pos)))
+ pos++;
+ if (pos > fragment.originalEnd) {
+ structure.remove(i--);
+ continue;
+ }
+ if (pos > fragment.originalStart) {
+ fragment = new Token(pos, fragment.originalEnd, TokenNameCOMMENT_LINE);
+ structure.set(i, fragment);
+ }
+
+ String fragmentString = WrapExecutor.this.tm.toString(fragment);
+ if (!fragmentString.startsWith("//")) { //$NON-NLS-1$
+ // forge a prefix
+ Token prefix = new Token(lineComment.originalStart, lineComment.originalStart + 1,
+ TokenNameCOMMENT_LINE);
+ prefix.spaceBefore();
+ structure.add(i, prefix);
+ }
+ isPrefixMissing = false;
+ }
+ }
+ // add all remaining tags in this line
+ // (these are currently in a future line comment but will be removed)
+ structure.addAll(this.nlsTags);
+
+ if (structure.isEmpty()) { // all the tags have been moved to other lines
+ WrapExecutor.this.tm.remove(index);
+ structureChanged();
+ }
+
+ this.nlsTags.clear();
+ }
+ return true;
+ }
+ }
+
+ private final static int[] EMPTY_ARRAY = {};
+
+ private final HashMap<WrapInfo, WrapResult> wrapSearchResults = new HashMap<WrapInfo, WrapResult>();
+ private final HashSet<WrapPolicy> usedTopPriorityWraps = new HashSet<WrapPolicy>();
+
+ private final LineAnalyzer lineAnalyzer;
+
+ final TokenManager tm;
+ final DefaultCodeFormatterOptions options;
+
+ private int topPriorityWrapIndex;
+
+ private final WrapInfo wrapInfoTemp = new WrapInfo();
+
+ public WrapExecutor(TokenManager tokenManager, DefaultCodeFormatterOptions options) {
+ this.tm = tokenManager;
+ this.options = options;
+ this.lineAnalyzer = new LineAnalyzer(tokenManager, options);
+ }
+
+ public void executeWraps() {
+ int index = 0;
+ mainLoop: while (index < this.tm.size()) {
+ Token token = this.tm.get(index);
+ handleOnColumnIndent(index, token.getWrapPolicy());
+ // this might be a pre-existing wrap that should trigger other top priority wraps
+ int jumpToIndex = handleTopPriorityWraps(index);
+ if (jumpToIndex >= 0) {
+ index = jumpToIndex;
+ continue mainLoop;
+ }
+
+ // determine wraps for incoming line
+ int currentIndent = getWrapIndent(token);
+ boolean isLineWrapped = token.isWrappable();
+ this.wrapSearchResults.clear();
+ WrapResult wrapResult = findWraps(index, currentIndent);
+ if (wrapResult == WrapResult.TOP_PRIORITY_WRAP_MET) {
+ jumpToIndex = handleTopPriorityWraps(this.topPriorityWrapIndex);
+ assert jumpToIndex >= 0;
+ index = Math.min(index, jumpToIndex);
+ continue mainLoop;
+ }
+
+ // apply wraps and indents
+ WrapInfo wrapInfo = wrapResult.nextWrap;
+ while (wrapInfo != null) {
+ isLineWrapped = true;
+ for (; index < wrapInfo.wrapTokenIndex; index++) {
+ token = this.tm.get(index);
+ if (shouldForceWrap(token, currentIndent)) {
+ currentIndent = token.getIndent();
+ wrapInfo = new WrapInfo(index, currentIndent);
+ findWrapsCached(index, currentIndent);
+ break;
+ }
+ token.setIndent(currentIndent);
+ }
+ token = this.tm.get(index);
+ token.breakBefore();
+ token.setIndent(currentIndent = wrapInfo.indent);
+ handleOnColumnIndent(index, token.getWrapPolicy());
+ jumpToIndex = handleTopPriorityWraps(index);
+ if (jumpToIndex >= 0) {
+ index = jumpToIndex;
+ continue mainLoop;
+ }
+ wrapInfo = this.wrapSearchResults.get(wrapInfo).nextWrap;
+ }
+
+ // apply indent until the beginning of the next line
+ token.setIndent(currentIndent);
+ for (index++; index < this.tm.size(); index++) {
+ if (token.getLineBreaksAfter() > 0)
+ break;
+ token = this.tm.get(index);
+ if (token.isNextLineOnWrap() && isLineWrapped)
+ token.breakBefore();
+ if (token.getLineBreaksBefore() > 0)
+ break;
+ if (shouldForceWrap(token, currentIndent))
+ currentIndent = token.getIndent();
+ token.setIndent(currentIndent);
+ }
+ }
+ this.wrapSearchResults.clear();
+ this.usedTopPriorityWraps.clear();
+
+ this.tm.traverse(0, new NLSTagHandler());
+ }
+
+ private WrapResult findWrapsCached(int startTokenIndex, int indent) {
+ this.wrapInfoTemp.wrapTokenIndex = startTokenIndex;
+ this.wrapInfoTemp.indent = indent;
+ WrapResult wrapResult = this.wrapSearchResults.get(this.wrapInfoTemp);
+ if (wrapResult == null) {
+ Token token = this.tm.get(startTokenIndex);
+ boolean wasLineBreak = token.getLineBreaksBefore() > 0;
+ token.breakBefore();
+ wrapResult = findWraps(startTokenIndex, indent);
+ if (!wasLineBreak)
+ token.clearLineBreaksBefore();
+
+ WrapInfo wrapInfo = new WrapInfo(startTokenIndex, indent);
+ this.wrapSearchResults.put(wrapInfo, wrapResult);
+ }
+ return wrapResult;
+ }
+
+ /**
+ * The main algorithm that looks for optimal places to wrap.
+ * Calls itself recursively to get results for wrapped sub-lines.
+ */
+ private WrapResult findWraps(int wrapTokenIndex, int indent) {
+ final int lastIndex = this.lineAnalyzer.analyzeLine(wrapTokenIndex, indent);
+ final boolean lineExceeded = this.lineAnalyzer.lineExceeded;
+ final int lastPosition = this.lineAnalyzer.getLastPosition();
+ int extraLines = this.lineAnalyzer.extraLines;
+ final int firstPotentialWrap = this.lineAnalyzer.firstPotentialWrap;
+
+ final int[] extraLinesPerComment = toArray(this.lineAnalyzer.extraLinesPerComment);
+ int commentIndex = extraLinesPerComment.length;
+
+ final int[] topPriorityGroupStarts = toArray(this.lineAnalyzer.topPriorityGroupStarts);
+ int topPriorityIndex = topPriorityGroupStarts.length - 1;
+ int nearestGroupEnd = topPriorityIndex == -1 ? 0
+ : this.tm.get(topPriorityGroupStarts[topPriorityIndex]).getWrapPolicy().topPriorityGroupEnd;
+
+ double bestTotalPenalty = getWrapPenalty(wrapTokenIndex, indent, lastIndex + 1, -1, WrapResult.NO_WRAP_NEEDED);
+ int bestExtraLines = lineExceeded ? Integer.MAX_VALUE : extraLines; // if line is exceeded, accept every wrap
+ int bestNextWrap = -1;
+ int bestIndent = 0;
+
+ if (!lineExceeded && (!this.options.join_wrapped_lines || !this.options.wrap_outer_expressions_when_nested))
+ return new WrapResult(bestTotalPenalty, bestExtraLines, null);
+
+ if ((!lineExceeded || firstPotentialWrap < 0) && lastIndex + 1 < this.tm.size()) {
+ Token nextLineToken = this.tm.get(lastIndex + 1);
+ if (nextLineToken.isWrappable() && (this.tm.get(lastIndex).isComment() || nextLineToken.isComment())) {
+ // this might be a pre-existing wrap forced by a comment, calculate penalties as normal
+ bestIndent = getWrapIndent(nextLineToken);
+ bestNextWrap = lastIndex + 1;
+ WrapResult wrapResult = findWrapsCached(bestNextWrap, bestIndent);
+ bestTotalPenalty = getWrapPenalty(wrapTokenIndex, indent, bestNextWrap, bestIndent, wrapResult);
+ bestExtraLines = extraLines + wrapResult.totalExtraLines;
+ }
+ }
+
+ if (firstPotentialWrap < 0 && lineExceeded) {
+ if (topPriorityGroupStarts.length > 0) {
+ this.topPriorityWrapIndex = topPriorityGroupStarts[0];
+ return WrapResult.TOP_PRIORITY_WRAP_MET;
+ }
+
+ // Report high number of extra lines to encourage the algorithm to look
+ // for other wraps (maybe something will result in smaller indent and line will fit).
+ // This should be achieved with penalty, but it's hard to choose a good penalty value here.
+ if (bestExtraLines == Integer.MAX_VALUE)
+ bestExtraLines = extraLines + lastPosition;
+ else
+ bestExtraLines += lastPosition;
+ }
+
+ for (int i = lastIndex; firstPotentialWrap >= 0 && i >= firstPotentialWrap; i--) {
+ Token token = this.tm.get(i);
+ if (commentIndex > 0
+ && (token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC)) {
+ extraLines -= extraLinesPerComment[--commentIndex];
+ }
+ if (topPriorityIndex >= 0 && i <= nearestGroupEnd) {
+ if (i > topPriorityGroupStarts[topPriorityIndex])
+ continue;
+ assert i == topPriorityGroupStarts[topPriorityIndex];
+ topPriorityIndex--;
+ nearestGroupEnd = topPriorityIndex == -1 ? 0
+ : this.tm.get(topPriorityGroupStarts[topPriorityIndex]).getWrapPolicy().topPriorityGroupEnd;
+ }
+
+ if (!token.isWrappable())
+ continue;
+
+ int nextWrapIndent = getWrapIndent(token);
+ WrapResult nextWrapResult = findWrapsCached(i, nextWrapIndent);
+
+ if (nextWrapResult == WrapResult.TOP_PRIORITY_WRAP_MET)
+ continue;
+
+ double totalPenalty = getWrapPenalty(wrapTokenIndex, indent, i, nextWrapIndent, nextWrapResult);
+ int totalExtraLines = extraLines + nextWrapResult.totalExtraLines;
+ boolean isBetter = totalExtraLines < bestExtraLines || bestExtraLines == Integer.MAX_VALUE;
+ if (!isBetter && totalExtraLines == bestExtraLines)
+ isBetter = totalPenalty < bestTotalPenalty || bestTotalPenalty == Double.MAX_VALUE;
+ if (isBetter) {
+ bestTotalPenalty = totalPenalty;
+ bestExtraLines = totalExtraLines;
+ bestNextWrap = i;
+ bestIndent = nextWrapIndent;
+
+ if (!this.options.wrap_outer_expressions_when_nested)
+ break;
+ }
+ }
+
+ if (bestNextWrap == -1 && lineExceeded && topPriorityGroupStarts.length > 0) {
+ this.topPriorityWrapIndex = topPriorityGroupStarts[0];
+ return WrapResult.TOP_PRIORITY_WRAP_MET;
+ }
+
+ return new WrapResult(bestTotalPenalty, bestExtraLines,
+ bestNextWrap == -1 ? null : new WrapInfo(bestNextWrap, bestIndent));
+ }
+
+ private double getWrapPenalty(int lineStartIndex, int lineIndent, int wrapIndex, int wrapIndent,
+ WrapResult wrapResult) {
+ WrapPolicy wrapPolicy = null;
+ Token wrapToken = null;
+ if (wrapIndex < this.tm.size()) {
+ wrapToken = this.tm.get(wrapIndex);
+ wrapPolicy = wrapToken.getWrapPolicy();
+ if (wrapIndent < 0)
+ wrapIndent = getWrapIndent(this.tm.get(wrapIndex));
+ }
+
+ double penalty = wrapToken != null && wrapToken.isWrappable() ? getPenalty(wrapPolicy) : 0;
+
+ // First parameter in method invocation has higher penalty to make wrapping more similar to the old formatter.
+ // This can lead to an undesired effect like this (should wrap aaaaaa and bbbbbb, not .bar):
+ // foo.foo
+ // .bar(aaaaaa,
+ // bbbbbbb);
+ if (wrapIndent > lineIndent)
+ penalty *= 1 + 3.0 / 16;
+
+ // Avoid ugly formations like this (bar2 should be wrapped):
+ // foooooo(bar1(aaaaaa,
+ // bbb), bar2(aaa,
+ // bbbbbb)
+ // Assuming lineStartIndex is at bbb, look for unwrapped bar2 and if found,
+ // add more penalty than if it was wrapped.
+ Token lineStartToken = this.tm.get(lineStartIndex);
+ WrapPolicy lineStartWrapPolicy = lineStartToken.getWrapPolicy();
+ if (wrapToken != null && wrapToken.isWrappable() && lineStartToken.isWrappable()) {
+ for (int i = lineStartIndex + 1; i < wrapIndex; i++) {
+ WrapPolicy intermediatePolicy = this.tm.get(i).getWrapPolicy();
+ if (intermediatePolicy != null
+ && intermediatePolicy.structureDepth < lineStartWrapPolicy.structureDepth
+ && intermediatePolicy.structureDepth < wrapPolicy.structureDepth) {
+ penalty += getPenalty(intermediatePolicy) * 1.25;
+ }
+ }
+ }
+
+ // In the previous example, bar1 should be wrapped too, to emphasize that bar1 and bar2 are the same level.
+ // Assuming wrapIndex is at bar1, check if there is a higher depth wrap (bbb) followed by
+ // a wrap of the same parent (bar2). If so, then bar1 must be wrapped (so give it negative penalty).
+ // Update: Actually, every token that is followed by a higher level depth wrap should be also wrapped,
+ // as long as this next wrap is not the last in line and the token is not the first in its wrap group.
+ WrapResult nextWrapResult = wrapResult;
+ boolean checkDepth = wrapToken != null && wrapToken.isWrappable()
+ && (lineStartWrapPolicy == null || wrapPolicy.structureDepth >= lineStartWrapPolicy.structureDepth);
+ double penaltyDiff = 0;
+ while (checkDepth && nextWrapResult.nextWrap != null) {
+ WrapPolicy nextPolicy = this.tm.get(nextWrapResult.nextWrap.wrapTokenIndex).getWrapPolicy();
+ if (nextPolicy.wrapParentIndex == wrapPolicy.wrapParentIndex
+ || (penaltyDiff != 0 && !wrapPolicy.isFirstInGroup)) {
+ penalty -= penaltyDiff * 1.25;
+ break;
+ }
+ if (nextPolicy.structureDepth <= wrapPolicy.structureDepth)
+ break;
+ penaltyDiff = Math.max(penaltyDiff, getPenalty(nextPolicy));
+ nextWrapResult = this.wrapSearchResults.get(nextWrapResult.nextWrap);
+ }
+
+ return penalty + wrapResult.penalty;
+ }
+
+ private double getPenalty(WrapPolicy policy) {
+ return Math.exp(policy.structureDepth) * policy.penaltyMultiplier;
+ }
+
+ private boolean shouldForceWrap(Token token, int currentIndent) {
+ // A token that will have smaller indent when wrapped than the current line indent,
+ // should be wrapped because it's a low depth token following some complex wraps of higher depth.
+ // This rule could not be implemented in getWrapPenalty() because a token's wrap indent may depend
+ // on wraps in previous lines, which are not determined yet when the token's penalty is calculated.
+ if (token.isWrappable() && this.options.wrap_outer_expressions_when_nested) {
+ int indent = getWrapIndent(token);
+ if (indent < currentIndent) {
+ token.breakBefore();
+ token.setIndent(indent);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @return index of the first token in the top priority group that given token belongs to or -1 if it doesn't belong
+ * to any top priority.
+ */
+ private int handleTopPriorityWraps(int wrapIndex) {
+ // wrap all tokens in the same top priority group and jump back to the first one
+ WrapPolicy wrapPolicy = this.tm.get(wrapIndex).getWrapPolicy();
+ if (wrapPolicy == null || !wrapPolicy.isTopPriority() || this.usedTopPriorityWraps.contains(wrapPolicy))
+ return -1;
+ int firstTokenIndex = -1;
+ int parentIndex = wrapPolicy.wrapParentIndex;
+ for (int i = wrapIndex; i > parentIndex; i--) {
+ Token token = this.tm.get(i);
+ wrapPolicy = token.getWrapPolicy();
+ if (wrapPolicy != null && wrapPolicy.wrapParentIndex == parentIndex) {
+ if (wrapPolicy.isTopPriority()) {
+ token.breakBefore();
+ firstTokenIndex = i;
+ this.usedTopPriorityWraps.add(wrapPolicy);
+ }
+ if (wrapPolicy.isFirstInGroup)
+ break;
+ }
+ }
+ boolean breakAfterPrevious = false;
+ for (int i = wrapIndex + 1; i < this.tm.size(); i++) {
+ Token token = this.tm.get(i);
+ wrapPolicy = token.getWrapPolicy();
+ if (wrapPolicy == null && (token.getLineBreaksBefore() > 0 || breakAfterPrevious)) {
+ break;
+ } else if (wrapPolicy != null && wrapPolicy.wrapParentIndex == parentIndex) {
+ if (wrapPolicy.isFirstInGroup)
+ break;
+ if (wrapPolicy.isTopPriority()) {
+ token.breakBefore();
+ this.usedTopPriorityWraps.add(wrapPolicy);
+ }
+ }
+ breakAfterPrevious = token.getLineBreaksAfter() > 0;
+ }
+ return firstTokenIndex;
+ }
+
+ private int[] toArray(List<Integer> list) {
+ if (list.isEmpty())
+ return EMPTY_ARRAY;
+ int[] result = new int[list.size()];
+ int i = 0;
+ for (int item : list) {
+ result[i++] = item;
+ }
+ return result;
+ }
+
+ private void handleOnColumnIndent(int tokenIndex, WrapPolicy wrapPolicy) {
+ if (wrapPolicy != null && wrapPolicy.indentOnColumn && !wrapPolicy.isFirstInGroup
+ && this.options.tab_char == DefaultCodeFormatterOptions.TAB
+ && !this.options.use_tabs_only_for_leading_indentations) {
+ // special case: first wrap in a group should be aligned on column even if it's not wrapped
+ for (int i = tokenIndex - 1; i >= 0; i--) {
+ Token token = this.tm.get(i);
+ WrapPolicy wrapPolicy2 = token.getWrapPolicy();
+ if (wrapPolicy2 != null && wrapPolicy2.isFirstInGroup
+ && wrapPolicy2.wrapParentIndex == wrapPolicy.wrapParentIndex) {
+ token.setAlign(getWrapIndent(token));
+ break;
+ }
+ }
+ }
+ }
+
+ int getWrapIndent(Token token) {
+ WrapPolicy policy = token.getWrapPolicy();
+ if (policy == null || (token.getLineBreaksBefore() > 1 && !policy.isForced && !policy.isTopPriority()))
+ return token.getIndent(); // no additional indentation after an empty line
+
+ if (this.options.never_indent_line_comments_on_first_column && token.tokenType == TokenNameCOMMENT_LINE
+ && token.getIndent() == 0)
+ return 0;
+ if (this.options.never_indent_block_comments_on_first_column && token.tokenType == TokenNameCOMMENT_BLOCK
+ && token.getIndent() == 0)
+ return 0;
+
+ Token wrapParent = this.tm.get(policy.wrapParentIndex);
+ int wrapIndent = wrapParent.getIndent();
+ if (policy.indentOnColumn) {
+ wrapIndent = this.tm.getPositionInLine(policy.wrapParentIndex);
+ wrapIndent += this.tm.getLength(wrapParent, wrapIndent);
+ if (wrapParent.isSpaceAfter() || this.tm.get(policy.wrapParentIndex + 1).isSpaceBefore())
+ wrapIndent++;
+ }
+ wrapIndent += policy.extraIndent;
+ return this.tm.toIndent(wrapIndent, true);
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
new file mode 100644
index 0000000..ac8d071
--- /dev/null
+++ b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
@@ -0,0 +1,809 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Mateusz Matela and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] Formatter does not format Java code correctly, especially when max line width is set - https://bugs.eclipse.org/303519
+ * Mateusz Matela <mateusz.matela@gmail.com> - [formatter] follow up bug for comments - https://bugs.eclipse.org/458208
+ *******************************************************************************/
+package org.aspectj.org.eclipse.jdt.internal.formatter.linewrap;
+
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOLON;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_BLOCK;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_JAVADOC;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameCOMMENT_LINE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameDOT;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameEQUAL;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameLBRACE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameLPAREN;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameOR;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameQUESTION;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameRBRACE;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameRPAREN;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameStringLiteral;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameextends;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameimplements;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNameIdentifier;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNamenew;
+import static org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens.TokenNamethrows;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.aspectj.org.eclipse.jdt.core.dom.ASTNode;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTVisitor;
+import org.aspectj.org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.ArrayInitializer;
+import org.aspectj.org.eclipse.jdt.core.dom.Assignment;
+import org.aspectj.org.eclipse.jdt.core.dom.Block;
+import org.aspectj.org.eclipse.jdt.core.dom.ClassInstanceCreation;
+import org.aspectj.org.eclipse.jdt.core.dom.CompilationUnit;
+import org.aspectj.org.eclipse.jdt.core.dom.ConditionalExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.ConstructorInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.EnumConstantDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.EnumDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Expression;
+import org.aspectj.org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.IfStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.InfixExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.InfixExpression.Operator;
+import org.aspectj.org.eclipse.jdt.core.dom.LambdaExpression;
+import org.aspectj.org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.MethodInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.aspectj.org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.Statement;
+import org.aspectj.org.eclipse.jdt.core.dom.SuperConstructorInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.SuperMethodInvocation;
+import org.aspectj.org.eclipse.jdt.core.dom.TryStatement;
+import org.aspectj.org.eclipse.jdt.core.dom.Type;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeParameter;
+import org.aspectj.org.eclipse.jdt.core.dom.UnionType;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+import org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter;
+import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions;
+import org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions.Alignment;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token;
+import org.aspectj.org.eclipse.jdt.internal.formatter.Token.WrapPolicy;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenManager;
+import org.aspectj.org.eclipse.jdt.internal.formatter.TokenTraverser;
+
+public class WrapPreparator extends ASTVisitor {
+
+ private final static Map<Operator, Integer> OPERATOR_PRECEDENCE;
+ static {
+ HashMap<Operator, Integer> precedence = new HashMap<Operator, Integer>();
+ precedence.put(Operator.TIMES, 1);
+ precedence.put(Operator.DIVIDE, 1);
+ precedence.put(Operator.REMAINDER, 1);
+ precedence.put(Operator.PLUS, 2);
+ precedence.put(Operator.MINUS, 2);
+ // shift and comparison operators left out intentionally for compatibility with
+ // the legacy formatter, which did not wrap these operators
+ precedence.put(Operator.AND, 6);
+ precedence.put(Operator.XOR, 7);
+ precedence.put(Operator.OR, 8);
+ precedence.put(Operator.CONDITIONAL_AND, 9);
+ precedence.put(Operator.CONDITIONAL_OR, 10);
+ // ternary and assignment operators not relevant to infix expressions
+ OPERATOR_PRECEDENCE = Collections.unmodifiableMap(precedence);
+ }
+
+ /** Penalty multiplier for wraps that are preferred */
+ private final static float PREFERRED = 7f / 8;
+
+ final TokenManager tm;
+ final DefaultCodeFormatterOptions options;
+ final int kind;
+
+ FieldAligner fieldAligner;
+
+ int importsStart = -1, importsEnd = -1;
+
+ /*
+ * temporary values used when calling {@link #handleWrap(int)} to avoid ArrayList initialization and long lists of
+ * parameters
+ */
+ private List<Integer> wrapIndexes = new ArrayList<Integer>();
+ private List<Float> wrapPenalties = new ArrayList<Float>();
+ private int wrapParentIndex = -1;
+ private int wrapGroupEnd = -1;
+
+ private int currentDepth = 0;
+
+ public WrapPreparator(TokenManager tokenManager, DefaultCodeFormatterOptions options, int kind) {
+ this.tm = tokenManager;
+ this.options = options;
+ this.kind = kind;
+ }
+
+ @Override
+ public boolean preVisit2(ASTNode node) {
+ this.currentDepth++;
+ boolean isMalformed = (node.getFlags() & ASTNode.MALFORMED) != 0;
+ if (isMalformed) {
+ this.tm.addDisableFormatTokenPair(this.tm.firstTokenIn(node, -1), this.tm.lastTokenIn(node, -1));
+ }
+ return !isMalformed;
+ }
+
+ @Override
+ public void postVisit(ASTNode node) {
+ this.currentDepth--;
+ }
+
+ @Override
+ public boolean visit(CompilationUnit node) {
+ List<ImportDeclaration> imports = node.imports();
+ if (!imports.isEmpty()) {
+ this.importsStart = this.tm.firstIndexIn(imports.get(0), -1);
+ this.importsEnd = this.tm.lastIndexIn(imports.get(imports.size() - 1), -1);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(NormalAnnotation node) {
+ handleArguments(node.values(), this.options.alignment_for_arguments_in_annotation);
+ return true;
+ }
+
+ @Override
+ public boolean visit(TypeDeclaration node) {
+ Type superclassType = node.getSuperclassType();
+ if (superclassType != null) {
+ this.wrapParentIndex = this.tm.lastIndexIn(node.getName(), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(superclassType, -1);
+ this.wrapIndexes.add(this.tm.firstIndexBefore(superclassType, TokenNameextends));
+ this.wrapIndexes.add(this.tm.firstIndexIn(superclassType, -1));
+ handleWrap(this.options.alignment_for_superclass_in_type_declaration, PREFERRED);
+ }
+
+ List<Type> superInterfaceTypes = node.superInterfaceTypes();
+ if (!superInterfaceTypes.isEmpty()) {
+ int implementsToken = node.isInterface() ? TokenNameextends : TokenNameimplements;
+ this.wrapParentIndex = this.tm.lastIndexIn(node.getName(), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(superInterfaceTypes.get(superInterfaceTypes.size() - 1), -1);
+ this.wrapIndexes.add(this.tm.firstIndexBefore(superInterfaceTypes.get(0), implementsToken));
+ for (Type type : superInterfaceTypes)
+ this.wrapIndexes.add(this.tm.firstIndexIn(type, -1));
+ handleWrap(this.options.alignment_for_superinterfaces_in_type_declaration, PREFERRED);
+ }
+
+ if (this.options.align_type_members_on_columns) {
+ if (this.fieldAligner == null) {
+ this.fieldAligner = new FieldAligner(this.tm, this.options);
+ }
+ this.fieldAligner.prepareAlign(node);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(MethodDeclaration node) {
+ List<SingleVariableDeclaration> parameters = node.parameters();
+ Type receiverType = node.getReceiverType();
+ if (!parameters.isEmpty() || receiverType != null) {
+ if (receiverType != null)
+ this.wrapIndexes.add(this.tm.firstIndexIn(receiverType, -1));
+ int wrappingOption = node.isConstructor() ? this.options.alignment_for_parameters_in_constructor_declaration
+ : this.options.alignment_for_parameters_in_method_declaration;
+ this.wrapGroupEnd = this.tm.lastIndexIn(
+ parameters.isEmpty() ? receiverType : parameters.get(parameters.size() - 1), -1);
+ handleArguments(parameters, wrappingOption);
+ }
+
+ List<Type> exceptionTypes = node.thrownExceptionTypes();
+ if (!exceptionTypes.isEmpty()) {
+ this.wrapParentIndex = this.tm.firstIndexBefore(exceptionTypes.get(0), TokenNameRPAREN);
+ this.wrapGroupEnd = this.tm.lastIndexIn(exceptionTypes.get(exceptionTypes.size() - 1), -1);
+ int wrappingOption = node.isConstructor()
+ ? this.options.alignment_for_throws_clause_in_constructor_declaration
+ : this.options.alignment_for_throws_clause_in_method_declaration;
+ for (Type exceptionType : exceptionTypes)
+ this.wrapIndexes.add(this.tm.firstIndexIn(exceptionType, -1));
+ // instead of the first exception type, wrap the "throws" token
+ this.wrapIndexes.set(0, this.tm.firstIndexBefore(exceptionTypes.get(0), TokenNamethrows));
+ handleWrap(wrappingOption, 0.5f);
+ }
+
+ if (!node.isConstructor()) {
+ List<TypeParameter> typeParameters = node.typeParameters();
+ if (!typeParameters.isEmpty())
+ this.wrapIndexes.add(this.tm.firstIndexIn(typeParameters.get(0), -1));
+ if (node.getReturnType2() != null)
+ this.wrapIndexes.add(this.tm.firstIndexIn(node.getReturnType2(), -1));
+ this.wrapIndexes.add(this.tm.firstIndexIn(node.getName(), -1));
+ this.wrapParentIndex = this.tm.findFirstTokenInLine(this.tm.firstIndexIn(node.getName(), -1));
+ this.wrapGroupEnd = this.tm.lastIndexIn(node.getName(), -1);
+ handleWrap(this.options.alignment_for_method_declaration);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(EnumDeclaration node) {
+ List<EnumConstantDeclaration> enumConstants = node.enumConstants();
+ if (!enumConstants.isEmpty()) {
+ for (EnumConstantDeclaration constant : enumConstants)
+ this.wrapIndexes.add(this.tm.firstIndexIn(constant, -1));
+ this.wrapParentIndex = this.tm.firstIndexBefore(enumConstants.get(0), TokenNameLBRACE);
+ this.wrapGroupEnd = this.tm.lastIndexIn(enumConstants.get(enumConstants.size() - 1), -1);
+ handleWrap(this.options.alignment_for_enum_constants, node);
+ }
+
+ List<Type> superInterfaceTypes = node.superInterfaceTypes();
+ if (!superInterfaceTypes.isEmpty()) {
+ this.wrapIndexes.add(this.tm.firstIndexBefore(superInterfaceTypes.get(0), TokenNameimplements));
+ for (Type type : superInterfaceTypes)
+ this.wrapIndexes.add(this.tm.firstIndexIn(type, -1));
+ this.wrapParentIndex = this.tm.lastIndexIn(node.getName(), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(superInterfaceTypes.get(superInterfaceTypes.size() - 1), -1);
+ this.wrapPenalties.add(PREFERRED);
+ handleWrap(this.options.alignment_for_superinterfaces_in_enum_declaration, node);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(EnumConstantDeclaration node) {
+ handleArguments(node.arguments(), this.options.alignment_for_arguments_in_enum_constant);
+ AnonymousClassDeclaration anonymousClass = node.getAnonymousClassDeclaration();
+ if (anonymousClass != null) {
+ forceContinuousWrapping(anonymousClass, this.tm.firstIndexIn(node.getName(), -1));
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(MethodInvocation node) {
+ handleArguments(node.arguments(), this.options.alignment_for_arguments_in_method_invocation);
+
+ boolean isInvocationChainRoot = !(node.getParent() instanceof MethodInvocation)
+ || node.getLocationInParent() != MethodInvocation.EXPRESSION_PROPERTY;
+ if (isInvocationChainRoot) {
+ Expression expression = node;
+ MethodInvocation invocation = node;
+ while (expression instanceof MethodInvocation) {
+ invocation = (MethodInvocation) expression;
+ expression = invocation.getExpression();
+ if (expression != null)
+ this.wrapIndexes.add(this.tm.firstIndexBefore(invocation.getName(), TokenNameDOT));
+ }
+ Collections.reverse(this.wrapIndexes);
+ this.wrapParentIndex = (expression != null) ? this.tm.lastIndexIn(expression, -1)
+ : this.tm.lastIndexIn(invocation, -1);
+ this.wrapGroupEnd = this.tm.firstIndexIn(node.getName(), -1);
+ handleWrap(this.options.alignment_for_selector_in_method_invocation);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(SuperMethodInvocation node) {
+ handleArguments(node.arguments(), this.options.alignment_for_arguments_in_method_invocation);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ClassInstanceCreation node) {
+ AnonymousClassDeclaration anonymousClass = node.getAnonymousClassDeclaration();
+ if (anonymousClass != null) {
+ forceContinuousWrapping(anonymousClass, this.tm.firstIndexIn(node, TokenNamenew));
+ }
+
+ int wrappingOption = node.getExpression() != null
+ ? this.options.alignment_for_arguments_in_qualified_allocation_expression
+ : this.options.alignment_for_arguments_in_allocation_expression;
+ handleArguments(node.arguments(), wrappingOption);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ConstructorInvocation node) {
+ handleArguments(node.arguments(), this.options.alignment_for_arguments_in_explicit_constructor_call);
+ return true;
+ }
+
+ @Override
+ public boolean visit(SuperConstructorInvocation node) {
+ handleArguments(node.arguments(), this.options.alignment_for_arguments_in_explicit_constructor_call);
+ return true;
+ }
+
+ @Override
+ public boolean visit(InfixExpression node) {
+ Integer operatorPrecedence = OPERATOR_PRECEDENCE.get(node.getOperator());
+ if (operatorPrecedence == null)
+ return true;
+ ASTNode parent = node.getParent();
+ if ((parent instanceof InfixExpression) && samePrecedence(node, (InfixExpression) parent))
+ return true; // this node has been handled higher in the AST
+
+ findTokensToWrap(node, 0);
+ this.wrapParentIndex = this.wrapIndexes.remove(0);
+ this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);
+ if ((this.options.alignment_for_binary_expression & Alignment.M_INDENT_ON_COLUMN) != 0)
+ this.wrapParentIndex--;
+ for (int i = this.wrapParentIndex; i >= 0; i--) {
+ if (!this.tm.get(i).isComment()) {
+ this.wrapParentIndex = i;
+ break;
+ }
+ }
+ handleWrap(this.options.alignment_for_binary_expression, node);
+ return true;
+ }
+
+ private void findTokensToWrap(InfixExpression node, int depth) {
+ Expression left = node.getLeftOperand();
+ if (left instanceof InfixExpression && samePrecedence(node, (InfixExpression) left)) {
+ findTokensToWrap((InfixExpression) left, depth + 1);
+ } else if (this.wrapIndexes.isEmpty() // always add first operand, it will be taken as wrap parent
+ || !this.options.wrap_before_binary_operator) {
+ this.wrapIndexes.add(this.tm.firstIndexIn(left, -1));
+ }
+
+ Expression right = node.getRightOperand();
+ List<Expression> extended = node.extendedOperands();
+ for (int i = -1; i < extended.size(); i++) {
+ Expression operand = (i == -1) ? right : extended.get(i);
+ if (operand instanceof InfixExpression && samePrecedence(node, (InfixExpression) operand)) {
+ findTokensToWrap((InfixExpression) operand, depth + 1);
+ }
+ int indexBefore = this.tm.firstIndexBefore(operand, -1);
+ while (this.tm.get(indexBefore).isComment())
+ indexBefore--;
+ assert node.getOperator().toString().equals(this.tm.toString(indexBefore));
+ int indexAfter = this.tm.firstIndexIn(operand, -1);
+ this.wrapIndexes.add(this.options.wrap_before_binary_operator ? indexBefore : indexAfter);
+
+ if (!this.options.join_wrapped_lines) {
+ // TODO there should be an option for never joining wraps on opposite side of the operator
+ if (this.options.wrap_before_binary_operator) {
+ if (this.tm.countLineBreaksBetween(this.tm.get(indexAfter - 1), this.tm.get(indexAfter)) > 0)
+ this.wrapIndexes.add(indexAfter);
+ } else {
+ if (this.tm.countLineBreaksBetween(this.tm.get(indexBefore), this.tm.get(indexBefore - 1)) > 0)
+ this.wrapIndexes.add(indexBefore);
+ }
+ }
+ }
+ }
+
+ private boolean samePrecedence(InfixExpression expression1, InfixExpression expression2) {
+ Integer precedence1 = OPERATOR_PRECEDENCE.get(expression1.getOperator());
+ Integer precedence2 = OPERATOR_PRECEDENCE.get(expression2.getOperator());
+ if (precedence1 == null || precedence2 == null)
+ return false;
+ return precedence1.equals(precedence2);
+ }
+
+ @Override
+ public boolean visit(ConditionalExpression node) {
+ this.wrapIndexes.add(this.tm.firstIndexAfter(node.getExpression(), TokenNameQUESTION));
+ this.wrapIndexes.add(this.tm.firstIndexAfter(node.getThenExpression(), TokenNameCOLON));
+ this.wrapParentIndex = this.tm.lastIndexIn(node.getExpression(), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);
+ handleWrap(this.options.alignment_for_conditional_expression);
+ return true;
+ }
+
+ @Override
+ public boolean visit(ArrayInitializer node) {
+ List<Expression> expressions = node.expressions();
+ if (!expressions.isEmpty()) {
+ for (Expression expression : expressions)
+ this.wrapIndexes.add(this.tm.firstIndexIn(expression, -1));
+ this.wrapParentIndex = this.tm.firstIndexBefore(expressions.get(0), TokenNameLBRACE);
+ this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);
+ handleWrap(this.options.alignment_for_expressions_in_array_initializer, node);
+ }
+ if (!this.options.join_wrapped_lines
+ && !this.options.insert_new_line_before_closing_brace_in_array_initializer) {
+ // if there is a line break before the closing brace, formatter should treat it as a valid wrap to preserve
+ int closingBraceIndex = this.tm.lastIndexIn(node, TokenNameRBRACE);
+ Token closingBrace = this.tm.get(closingBraceIndex);
+ if (this.tm.countLineBreaksBetween(this.tm.get(closingBraceIndex - 1), closingBrace) == 1) {
+ int openingBraceIndex = this.tm.firstIndexIn(node, TokenNameLBRACE);
+ closingBrace.setWrapPolicy(
+ new WrapPolicy(0, openingBraceIndex, this.currentDepth, 1, true, false, -1, false));
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(Assignment node) {
+ this.wrapIndexes.add(this.tm.firstIndexIn(node.getRightHandSide(), -1));
+
+ int operatorIndex = this.tm.firstIndexBefore(node.getRightHandSide(), -1);
+ while (this.tm.get(operatorIndex).isComment())
+ operatorIndex--;
+ assert node.getOperator().toString().equals(this.tm.toString(operatorIndex));
+
+ this.wrapParentIndex = operatorIndex;
+ this.wrapGroupEnd = this.tm.lastIndexIn(node.getRightHandSide(), -1);
+ handleWrap(this.options.alignment_for_assignment);
+ return true;
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationFragment node) {
+ if (node.getInitializer() != null) {
+ this.wrapIndexes.add(this.tm.firstIndexIn(node.getInitializer(), -1));
+ this.wrapParentIndex = this.tm.firstIndexBefore(node.getInitializer(), TokenNameEQUAL);
+ this.wrapGroupEnd = this.tm.lastIndexIn(node.getInitializer(), -1);
+ handleWrap(this.options.alignment_for_assignment);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(IfStatement node) {
+ if (!(node.getThenStatement() instanceof Block)) {
+ int thenIndex = this.tm.firstIndexIn(node.getThenStatement(), -1);
+ if (this.tm.get(thenIndex).getLineBreaksBefore() == 0)
+ this.wrapIndexes.add(thenIndex);
+ }
+ Statement elseStatement = node.getElseStatement();
+ if (elseStatement != null && !(elseStatement instanceof Block)) {
+ int elseIndex = this.tm.firstIndexIn(elseStatement, -1);
+ if (this.tm.get(elseIndex).getLineBreaksBefore() == 0)
+ this.wrapIndexes.add(elseIndex);
+ }
+ if (!this.wrapIndexes.isEmpty()) {
+ this.wrapParentIndex = this.tm.firstIndexAfter(node.getExpression(), TokenNameRPAREN);
+ this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);
+ handleWrap(this.options.alignment_for_compact_if, node);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(TryStatement node) {
+ handleArguments(node.resources(), this.options.alignment_for_resources_in_try);
+ return true;
+ }
+
+ @Override
+ public boolean visit(UnionType node) {
+ List<Type> types = node.types();
+ if (this.options.wrap_before_or_operator_multicatch && !types.isEmpty()) {
+ for (Type type : types) {
+ if (this.wrapIndexes.isEmpty()) {
+ this.wrapIndexes.add(this.tm.firstIndexIn(type, -1));
+ } else {
+ this.wrapIndexes.add(this.tm.firstIndexBefore(type, TokenNameOR));
+ }
+ }
+ this.wrapParentIndex = this.tm.firstIndexBefore(node, TokenNameLPAREN);
+ this.wrapGroupEnd = this.tm.lastIndexIn(types.get(types.size() - 1), -1);
+ handleWrap(this.options.alignment_for_union_type_in_multicatch);
+ } else {
+ handleArguments(types, this.options.alignment_for_union_type_in_multicatch);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(LambdaExpression node) {
+ if (node.getBody() instanceof Block) {
+ forceContinuousWrapping(node.getBody(), this.tm.firstIndexIn(node, -1));
+ }
+ if (node.hasParentheses()) {
+ List<VariableDeclaration> parameters = node.parameters();
+ // the legacy formatter didn't like wrapping lambda parameters, so neither do we
+ this.currentDepth++;
+ handleArguments(parameters, this.options.alignment_for_parameters_in_method_declaration);
+ this.currentDepth--;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean visit(FieldDeclaration node) {
+ handleVariableDeclarations(node.fragments());
+ return true;
+ }
+
+ @Override
+ public boolean visit(VariableDeclarationStatement node) {
+ handleVariableDeclarations(node.fragments());
+ return true;
+ }
+
+ /**
+ * Makes sure all new lines within given node will have wrap policy so that
+ * wrap executor will fix their indentation if necessary.
+ */
+ private void forceContinuousWrapping(ASTNode node, int parentIndex) {
+ int from = this.tm.firstIndexIn(node, -1);
+ int to = this.tm.lastIndexIn(node, -1);
+ Token wrapParent = this.tm.get(parentIndex);
+ Token previous = null;
+ for (int i = from; i <= to; i++) {
+ Token token = this.tm.get(i);
+ if ((token.getLineBreaksBefore() > 0 || (previous != null && previous.getLineBreaksAfter() > 0))
+ && token.getWrapPolicy() == null) {
+ int indent = (token.getIndent() - wrapParent.getIndent());
+ token.setWrapPolicy(new WrapPolicy(indent, parentIndex, true));
+ }
+ previous = token;
+ }
+ }
+
+ private void handleVariableDeclarations(List<VariableDeclarationFragment> fragments) {
+ if (fragments.size() > 1) {
+ for (int i = 1; i < fragments.size(); i++)
+ this.wrapIndexes.add(this.tm.firstIndexIn(fragments.get(i), -1));
+ this.wrapParentIndex = this.tm.firstIndexIn(fragments.get(0), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(fragments.get(fragments.size() - 1), -1);
+ handleWrap(this.options.alignment_for_multiple_fields);
+ }
+ }
+
+ private void handleArguments(List<? extends ASTNode> arguments, int wrappingOption) {
+ for (ASTNode argument : arguments)
+ this.wrapIndexes.add(this.tm.firstIndexIn(argument, -1));
+ // wrapIndexes may have been filled with additional values even if arguments is empty
+ if (!this.wrapIndexes.isEmpty()) {
+ Token firstToken = this.tm.get(this.wrapIndexes.get(0));
+ this.wrapParentIndex = this.tm.findIndex(firstToken.originalStart - 1, TokenNameLPAREN, false);
+ if (!arguments.isEmpty() && this.wrapGroupEnd < 0)
+ this.wrapGroupEnd = this.tm.lastIndexIn(arguments.get(arguments.size() - 1), -1);
+ assert this.wrapGroupEnd >= 0;
+ handleWrap(wrappingOption, 1 / PREFERRED);
+ }
+ }
+
+ private void handleWrap(int wrappingOption) {
+ handleWrap(wrappingOption, null);
+ }
+
+ private void handleWrap(int wrappingOption, float firstPenaltyMultiplier) {
+ this.wrapPenalties.add(firstPenaltyMultiplier);
+ handleWrap(wrappingOption, null);
+ }
+
+ private void handleWrap(int wrappingOption, ASTNode parentNode) {
+ if (this.wrapIndexes.isEmpty())
+ return;
+ assert this.wrapParentIndex >= 0;
+ float penalty = this.wrapPenalties.isEmpty() ? 1 : this.wrapPenalties.get(0);
+ WrapPolicy policy = getWrapPolicy(wrappingOption, penalty, true, parentNode);
+ if (policy == null) {
+ this.wrapIndexes.clear();
+ this.wrapPenalties.clear();
+ this.wrapParentIndex = this.wrapGroupEnd = -1;
+ return;
+ }
+ setTokenWrapPolicy(this.wrapIndexes.get(0), policy, true);
+
+ boolean wrapPreceedingComments = !(parentNode instanceof InfixExpression)
+ || !this.options.wrap_before_binary_operator;
+ for (int i = 1; i < this.wrapIndexes.size(); i++) {
+ penalty = this.wrapPenalties.size() > i ? this.wrapPenalties.get(i) : 1;
+ if (penalty != policy.penaltyMultiplier || i == 1)
+ policy = getWrapPolicy(wrappingOption, penalty, false, parentNode);
+ setTokenWrapPolicy(this.wrapIndexes.get(i), policy, wrapPreceedingComments);
+ }
+
+ boolean forceWrap = (wrappingOption & Alignment.M_FORCE) != 0;
+ if (forceWrap) {
+ boolean satisfied = false;
+ for (int index : this.wrapIndexes) {
+ Token token = this.tm.get(index);
+ if (token.getWrapPolicy().isTopPriority()) {
+ token.breakBefore();
+ satisfied = true;
+ }
+ }
+ if (!satisfied) {
+ boolean canWrapFirst = (wrappingOption & Alignment.M_NEXT_PER_LINE_SPLIT) != Alignment.M_NEXT_PER_LINE_SPLIT;
+ if (canWrapFirst)
+ this.tm.get(this.wrapIndexes.get(0)).breakBefore();
+ }
+ }
+ this.wrapIndexes.clear();
+ this.wrapPenalties.clear();
+ this.wrapParentIndex = this.wrapGroupEnd = -1;
+ }
+
+ private void setTokenWrapPolicy(int index, WrapPolicy policy, boolean wrapPreceedingComments) {
+ if (wrapPreceedingComments) {
+ for (int i = index - 1; i >= 0; i--) {
+ Token previous = this.tm.get(i);
+ if (!previous.isComment())
+ break;
+ if (previous.getLineBreaksAfter() == 0 && i == index - 1)
+ index = i;
+ if (previous.getLineBreaksBefore() > 0)
+ previous.setWrapPolicy(policy);
+ }
+ }
+
+ Token token = this.tm.get(index);
+ token.setWrapPolicy(policy);
+ if (this.options.join_wrapped_lines
+ && (token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC)) {
+ // allow wrap preparator to decide if this comment should be wrapped
+ token.clearLineBreaksBefore();
+ }
+
+ // extend this policy to a token that is in the next line because of comments
+ for (int i = index + 1; i < this.tm.size(); i++) {
+ Token next = this.tm.get(i);
+ WrapPolicy policy2 = next.getWrapPolicy();
+ if (policy2 != null && policy2.isForced && policy2.extraIndent == 0) {
+ next.setWrapPolicy(policy);
+ } else if (next.tokenType != TokenNameCOMMENT_LINE && next.tokenType != TokenNameCOMMENT_BLOCK) {
+ break;
+ }
+ }
+ }
+
+ private WrapPolicy getWrapPolicy(int wrappingOption, float penaltyMultiplier, boolean isFirst, ASTNode parentNode) {
+ assert this.wrapParentIndex >= 0 && this.wrapGroupEnd >= 0;
+ int extraIndent = this.options.continuation_indentation;
+ boolean indentOnColumn = (wrappingOption & Alignment.M_INDENT_ON_COLUMN) != 0;
+ boolean isAlreadyWrapped = false;
+ if (indentOnColumn) {
+ extraIndent = 0;
+ } else if (parentNode instanceof EnumDeclaration) {
+ // special behavior for compatibility with legacy formatter
+ extraIndent = ((wrappingOption & Alignment.M_INDENT_BY_ONE) != 0) ? 2 : 1;
+ isAlreadyWrapped = isFirst;
+ } else if (parentNode instanceof IfStatement) {
+ extraIndent = 1;
+ this.wrapParentIndex = this.tm.firstIndexIn(parentNode, -1); // only if !indoentOnColumn
+ } else if ((wrappingOption & Alignment.M_INDENT_BY_ONE) != 0) {
+ extraIndent = 1;
+ } else if (parentNode instanceof ArrayInitializer) {
+ extraIndent = this.options.continuation_indentation_for_array_initializer;
+ }
+
+ boolean isTopPriority = false;
+ switch (wrappingOption & Alignment.SPLIT_MASK) {
+ case Alignment.M_NO_ALIGNMENT:
+ return null;
+ case Alignment.M_COMPACT_FIRST_BREAK_SPLIT:
+ isTopPriority = isFirst;
+ break;
+ case Alignment.M_ONE_PER_LINE_SPLIT:
+ isTopPriority = true;
+ break;
+ case Alignment.M_NEXT_SHIFTED_SPLIT:
+ isTopPriority = true;
+ if (!isFirst)
+ extraIndent++;
+ break;
+ case Alignment.M_NEXT_PER_LINE_SPLIT:
+ isTopPriority = !isFirst;
+ break;
+ }
+
+ if (isAlreadyWrapped)
+ isTopPriority = false; // to avoid triggering top priority wrapping
+ int topPriorityGroupEnd = isTopPriority ? this.wrapGroupEnd : -1;
+ extraIndent *= this.options.indentation_size;
+ return new WrapPolicy(extraIndent, this.wrapParentIndex, this.currentDepth, penaltyMultiplier, isFirst,
+ indentOnColumn, topPriorityGroupEnd, false);
+ }
+
+ public void finishUp(ASTNode astRoot) {
+ preserveExistingLineBreaks();
+ new WrapExecutor(this.tm, this.options).executeWraps();
+ if (this.fieldAligner != null)
+ this.fieldAligner.alignComments();
+ wrapComments();
+ fixEnumConstantIndents(astRoot);
+ }
+
+ private void preserveExistingLineBreaks() {
+ // normally n empty lines = n+1 line breaks, but not at the file start and end
+ Token first = this.tm.get(0);
+ int startingBreaks = first.getLineBreaksBefore();
+ first.clearLineBreaksBefore();
+ first.putLineBreaksBefore(startingBreaks - 1);
+
+ this.tm.traverse(0, new TokenTraverser() {
+ DefaultCodeFormatterOptions options2 = WrapPreparator.this.options;
+
+ @Override
+ protected boolean token(Token token, int index) {
+ int lineBreaks = getLineBreaksBetween(getPrevious(), token);
+ if (index > WrapPreparator.this.importsStart && index < WrapPreparator.this.importsEnd) {
+ lineBreaks = lineBreaks > 1 ? (this.options2.blank_lines_between_import_groups + 1) : 0;
+ } else {
+ lineBreaks = Math.min(lineBreaks, this.options2.number_of_empty_lines_to_preserve + 1);
+ }
+ if (lineBreaks <= getLineBreaksBefore())
+ return true;
+
+ if (!this.options2.join_wrapped_lines && token.isWrappable() && lineBreaks == 1) {
+ token.breakBefore();
+ } else if (lineBreaks > 1) {
+ if (index == 0)
+ lineBreaks--;
+ token.putLineBreaksBefore(lineBreaks);
+ }
+ return true;
+ }
+
+ private int getLineBreaksBetween(Token token1, Token token2) {
+ if (token1 != null) {
+ List<Token> structure1 = token1.getInternalStructure();
+ if (structure1 != null && !structure1.isEmpty())
+ token1 = structure1.get(structure1.size() - 1);
+ }
+ List<Token> structure2 = token2.getInternalStructure();
+ if (structure2 != null && !structure2.isEmpty())
+ token2 = structure2.get(0);
+ int lineBreaks = WrapPreparator.this.tm.countLineBreaksBetween(token1, token2);
+ if (token1 == null)
+ lineBreaks++;
+ return lineBreaks;
+ }
+ });
+
+ Token last = this.tm.get(this.tm.size() - 1);
+ last.clearLineBreaksAfter();
+ int endingBreaks = this.tm.countLineBreaksBetween(last, null);
+ endingBreaks = Math.min(endingBreaks, this.options.number_of_empty_lines_to_preserve);
+ if (endingBreaks > 0) {
+ last.putLineBreaksAfter(endingBreaks);
+ } else if ((this.kind & CodeFormatter.K_COMPILATION_UNIT) != 0
+ && this.options.insert_new_line_at_end_of_file_if_missing) {
+ last.breakAfter();
+ }
+ }
+
+ private void wrapComments() {
+ CommentWrapExecutor commentWrapper = new CommentWrapExecutor(this.tm, this.options);
+ boolean isNLSTagInLine = false;
+ for (int i = 0; i < this.tm.size(); i++) {
+ Token token = this.tm.get(i);
+ if (token.getLineBreaksBefore() > 0 || token.getLineBreaksAfter() > 0)
+ isNLSTagInLine = false;
+ if (token.hasNLSTag()) {
+ assert token.tokenType == TokenNameStringLiteral;
+ isNLSTagInLine = true;
+ }
+ List<Token> structure = token.getInternalStructure();
+ if (structure != null && !structure.isEmpty() && !isNLSTagInLine) {
+ int startPosition = this.tm.getPositionInLine(i);
+ if (token.tokenType == TokenNameCOMMENT_LINE) {
+ commentWrapper.wrapLineComment(token, startPosition);
+ } else {
+ assert token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC;
+ commentWrapper.wrapMultiLineComment(token, startPosition, false, false);
+ }
+ }
+ }
+ }
+
+ private void fixEnumConstantIndents(ASTNode astRoot) {
+ if (this.options.use_tabs_only_for_leading_indentations) {
+ // enum constants should be indented like other declarations, not like wrapped elements
+ astRoot.accept(new ASTVisitor() {
+
+ @Override
+ public boolean visit(EnumConstantDeclaration node) {
+ WrapPreparator.this.tm.firstTokenIn(node, TokenNameIdentifier).setWrapPolicy(null);
+ return true;
+ }
+ });
+ }
+ }
+}
diff --git a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/options.properties b/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/options.properties
deleted file mode 100644
index 40f9549..0000000
--- a/org.aspectj.ajde/source/org/aspectj/org/eclipse/jdt/internal/formatter/options.properties
+++ /dev/null
@@ -1,75 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-newline.openingBrace.number=1
-newline.openingBrace.category=Newline
-newline.openingBrace.name=I&nsert new line before opening brace
-newline.openingBrace.possibleValues=2|Insert|Do not insert
-newline.openingBrace.description=When Insert, a new line is inserted before an opening brace, otherwise nothing is inserted
-
-newline.controlStatement.number=2
-newline.controlStatement.category=Newline
-newline.controlStatement.name=Insert new &line in control statement
-newline.controlStatement.possibleValues=2|Insert|Do not insert
-newline.controlStatement.description=When Insert, a new line is inserted between } and else, catch, finally
-
-newline.clearAll.number=3
-newline.clearAll.category=Newline
-newline.clearAll.name=Clear all &blank lines
-newline.clearAll.possibleValues=2|Clear|Preserve one
-newline.clearAll.description=When Clear, all blank lines are removed. When Preserve one, only one is kept and all others removed.
-
-newline.elseIf.number=4
-newline.elseIf.category=Newline
-newline.elseIf.name=&Keep else if on the same line
-newline.elseIf.possibleValues=2|Yes|No
-newline.elseIf.description=When Yes, a blank line is inserted between a else and a if when they are contiguous
-
-newline.emptyBlock.number=5
-newline.emptyBlock.category=Newline
-newline.emptyBlock.name=In&sert a new line inside an empty block
-newline.emptyBlock.possibleValues=2|Insert|Do not insert
-newline.emptyBlock.description=When insert, a line break is inserted between contiguous { and }, if } is not followed by a keyword.
-
-line.split.number=6
-line.split.category=Line splitting
-line.split.name=Ma&ximum line length
-line.split.possibleValues=-1
-line.split.description=Enable splitting of long lines (exceeding the configurable length). Length of 0 will disable line splitting
-
-style.compactAssignment.number=7
-style.compactAssignment.category=Style
-style.compactAssignment.name=&Compact assignment
-style.compactAssignment.possibleValues=2|Compact|Normal
-style.compactAssignment.description=Assignments can be formatted asymmetrically, e.g. 'int x= 2;', when Normal, a space is inserted before the assignment operator
-
-style.reuseExistingLayout.number=8
-style.reuseExistingLayout.category=Style
-style.reuseExistingLayout.name=&Reuse existing layout
-style.reuseExistingLayout.possibleValues=2|Reuse|Do not reuse
-style.reuseExistingLayout.description=If the user has formatted his code a certain way, the formatter does not try to reformat it
-
-tabulation.char.number=9
-tabulation.char.category=Style
-tabulation.char.name=Indentation is represented by &tab
-tabulation.char.possibleValues=2|Tab|Spaces
-tabulation.char.description=Either choose to indent with tab characters or spaces
-
-tabulation.size.number=10
-tabulation.size.category=Style
-tabulation.size.name=&Amount of spaces representing a tab
-tabulation.size.possibleValues=-1
-tabulation.size.description=Tabulation size in term of space characters
-
-space.castexpression.number=11
-space.castexpression.category=Style
-space.castexpression.name=&Insert a space in cast expression
-space.castexpression.size.possibleValues=2|Insert|Do not insert
-space.castexpression.description=When insert, a space is added between the closing parenthesis and the expression of the cast expression
diff --git a/org.aspectj.weaver/classes/META-INF/MANIFEST.MF b/org.aspectj.weaver/classes/META-INF/MANIFEST.MF
index 0bbecca..665c09a 100644
--- a/org.aspectj.weaver/classes/META-INF/MANIFEST.MF
+++ b/org.aspectj.weaver/classes/META-INF/MANIFEST.MF
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Name: org/aspectj/weaver/
Specification-Title: AspectJ Weaver Classes
-Specification-Version: 1.8.6
+Specification-Version: DEVELOPMENT
Specification-Vendor: aspectj.org
Implementation-Title: org.aspectj.weaver
-Implementation-Version: 1.8.6
+Implementation-Version: DEVELOPMENT
Implementation-Vendor: aspectj.org
Premain-Class: org.aspectj.weaver.loadtime.Agent
Can-Redefine-Classes: true
diff --git a/org.aspectj.weaver/classes/org/aspectj/bridge/Version.class b/org.aspectj.weaver/classes/org/aspectj/bridge/Version.class
index 36881f4..42802f2 100644
--- a/org.aspectj.weaver/classes/org/aspectj/bridge/Version.class
+++ b/org.aspectj.weaver/classes/org/aspectj/bridge/Version.class
Binary files differ
diff --git a/org.aspectj.weaver/classes/org/aspectj/weaver/Dump.class b/org.aspectj.weaver/classes/org/aspectj/weaver/Dump.class
index 84d5e1f..48a19b4 100644
--- a/org.aspectj.weaver/classes/org/aspectj/weaver/Dump.class
+++ b/org.aspectj.weaver/classes/org/aspectj/weaver/Dump.class
Binary files differ
diff --git a/org.aspectj.weaver/classes/org/aspectj/weaver/tools/WeavingAdaptor.class b/org.aspectj.weaver/classes/org/aspectj/weaver/tools/WeavingAdaptor.class
index d359efd..3df93a1 100644
--- a/org.aspectj.weaver/classes/org/aspectj/weaver/tools/WeavingAdaptor.class
+++ b/org.aspectj.weaver/classes/org/aspectj/weaver/tools/WeavingAdaptor.class
Binary files differ
diff --git a/org.aspectj.weaver/source/org/aspectj/bridge/Version.java b/org.aspectj.weaver/source/org/aspectj/bridge/Version.java
index 5c789c1..33d6315 100644
--- a/org.aspectj.weaver/source/org/aspectj/bridge/Version.java
+++ b/org.aspectj.weaver/source/org/aspectj/bridge/Version.java
@@ -30,14 +30,14 @@
public static final long NOTIME = 0L;
/** set by build script */
- public static final String text = "1.8.6";
+ public static final String text = "DEVELOPMENT";
// VersionUptodate.java scans for "static final String text = "
/**
* Time text set by build script using SIMPLE_DATE_FORMAT.
* (if DEVELOPMENT version, invalid)
*/
- public static final String time_text = "Monday Jun 8, 2015 at 15:42:44 GMT";
+ public static final String time_text = "Monday Jun 29, 2015 at 18:26:11 GMT";
/**
* time in seconds-since-... format, used by programmatic clients.
diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java
index a76f7ef..23eed38 100644
--- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java
+++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java
@@ -13,6 +13,8 @@
import org.aspectj.asm.IProgramElement;
import org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
+import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
import org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
@@ -140,4 +142,9 @@
return null;
}
+ public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker arg0, Object arg1,
+ LookupEnvironment arg2) {
+ return arg0;
+ }
+
}
diff --git a/org.eclipse.ajdt.releng/build.properties b/org.eclipse.ajdt.releng/build.properties
index d13158e..a6ea373 100644
--- a/org.eclipse.ajdt.releng/build.properties
+++ b/org.eclipse.ajdt.releng/build.properties
@@ -22,7 +22,9 @@
# 1.8.5.20141218084900 - 1.8.5 dev
# 1.8.5.20150128171000 - 1.8.5 release
# 1.8.6.20150608154200 - 1.8.6 release
-ajde.version=1.8.6.20150608154200
+# 1.8.7.20150629114800 - 1.8.7 snapshot (AspectJ rebased on Mars)
+ajde.version=1.8.7.20150629114800
+
builder=.