Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2019-02-28 10:47:51 +0000
committerJay Arthanareeswaran2019-02-28 10:47:51 +0000
commit58f84fa8bd45fe7d13fa8fec999d2aa78465dd08 (patch)
tree2ae05235113bdb4f12f4c82bc39ee9b28ac0ed68
parentb5ede0b8c3524c2cc07a9aabd9abf63d242ffdd3 (diff)
parent348aad642ce79be7112961b7d8acaa520a45e279 (diff)
downloadeclipse.jdt.core-58f84fa8bd45fe7d13fa8fec999d2aa78465dd08.tar.gz
eclipse.jdt.core-58f84fa8bd45fe7d13fa8fec999d2aa78465dd08.tar.xz
eclipse.jdt.core-58f84fa8bd45fe7d13fa8fec999d2aa78465dd08.zip
Merge remote-tracking branch 'origin/master' into BETA_JAVA_12P20190228-2320
# Conflicts: # org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java # org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java # org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java # org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java Change-Id: I380ca2e4f653563c8a739270e5c742f647ffcbe9
-rw-r--r--org.eclipse.jdt.apt.core/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.apt.core/pom.xml2
-rw-r--r--org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/BuildEnv.java240
-rw-r--r--org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/generatedfile/GeneratedSourceFolderManager.java2
-rw-r--r--org.eclipse.jdt.apt.pluggable.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.apt.pluggable.tests/pom.xml4
-rw-r--r--org.eclipse.jdt.compiler.apt/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.compiler.apt/pom.xml4
-rw-r--r--org.eclipse.jdt.compiler.tool/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.compiler.tool/pom.xml4
-rw-r--r--org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.core.tests.builder/plugin.xml10
-rw-r--r--org.eclipse.jdt.core.tests.builder/pom.xml2
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java1
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParallelBuildTests.java100
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TimeStampBuilder.java64
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java19
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java7
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java18
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java108
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java87
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java64
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java9
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java42
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java36
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java6
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java2
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java128
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java133
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java79
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java35
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/A_out.java15
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/B_out.java15
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/C_out.java17
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/D_out.java19
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/E_out.java35
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/F_out.java35
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/G_out.java35
-rw-r--r--org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/in.java9
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java2
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties4
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java56
-rw-r--r--org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java27
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java1
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java7
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java23
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java30
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java10
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java25
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java10
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java24
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java4
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java4
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java14
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java12
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java48
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java7
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java3
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java42
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java9
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java12
-rw-r--r--org.eclipse.jdt.core/schema/compiler.dtd3
78 files changed, 1304 insertions, 557 deletions
diff --git a/org.eclipse.jdt.apt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.apt.core/META-INF/MANIFEST.MF
index 68fae92d26..9afc9a12e3 100644
--- a/org.eclipse.jdt.apt.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.apt.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.apt.core; singleton:=true
-Bundle-Version: 3.6.200.qualifier
+Bundle-Version: 3.6.300.qualifier
Bundle-Localization: plugin
Export-Package: com.sun.mirror.apt,
com.sun.mirror.declaration,
diff --git a/org.eclipse.jdt.apt.core/pom.xml b/org.eclipse.jdt.apt.core/pom.xml
index c05dcd6bd7..6aa46001b7 100644
--- a/org.eclipse.jdt.apt.core/pom.xml
+++ b/org.eclipse.jdt.apt.core/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.apt.core</artifactId>
- <version>3.6.200-SNAPSHOT</version>
+ <version>3.6.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/BuildEnv.java b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/BuildEnv.java
index c8c022c482..c4da45e2d8 100644
--- a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/BuildEnv.java
+++ b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/BuildEnv.java
@@ -18,12 +18,7 @@ import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
@@ -43,52 +38,45 @@ import org.eclipse.jdt.apt.core.internal.util.Visitors.AnnotationVisitor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.compiler.BuildContext;
import org.eclipse.jdt.core.compiler.CategorizedProblem;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-
+import org.eclipse.jdt.core.compiler.BuildContext;
+import org.eclipse.jdt.core.dom.*;
import com.sun.mirror.apt.Filer;
import com.sun.mirror.declaration.AnnotationTypeDeclaration;
import com.sun.mirror.declaration.PackageDeclaration;
import com.sun.mirror.declaration.TypeDeclaration;
public class BuildEnv extends AbstractCompilationEnv
-{
+{
private boolean _hasRaisedErrors = false;
- private final BuildFilerImpl _filer;
+ private final BuildFilerImpl _filer;
/**
* Set of strings that indicate new type dependencies introduced on the file
* each string is a fully-qualified type name.
*/
private Set<String> _typeDependencies = new HashSet<>();
-
+
/**
- * Indicates whether we are in batch mode or not. This gets flipped only
- * during build and could be flipped back and forth.
+ * Indicates whether we are in batch mode or not. This gets flipped only
+ * during build and could be flipped back and forth.
*/
private boolean _batchMode = false; // off by default.
- /**
+ /**
* Holds all the files that contains annotation that are to be processed during build.
- * If we are not in batch mode, <code>super._file</code> holds the file
- * being processed at the time.
- */
+ * If we are not in batch mode, <code>super._file</code> holds the file
+ * being processed at the time.
+ */
private BuildContext[] _filesWithAnnotation = null;
-
+
/**
* These are files that are part of a build but does not have annotations on it.
- * During batch mode processing, these files still also need to be included.
+ * During batch mode processing, these files still also need to be included.
*/
private BuildContext[] _additionFiles = null;
- /**
+ /**
* This is intialized when <code>_batchMode</code> is set to be <code>true</code> or
* when batch processing is expected. <p>
* It is also set in build mode for perf reason rather than parsing and resolving
@@ -97,29 +85,29 @@ public class BuildEnv extends AbstractCompilationEnv
*/
private CompilationUnit[] _astRoots = null;
private List<MarkerInfo> _markerInfos = null;
-
+
/**
* Constructor for creating a processor environment used during build.
* @param filesWithAnnotations
* @param additionalFiles
* @param units
* @param javaProj
- * @param isTestCode
+ * @param isTestCode
* @param phase
*/
BuildEnv(
final BuildContext[] filesWithAnnotations,
final BuildContext[] additionalFiles,
final IJavaProject javaProj, boolean isTestCode) {
-
+
super(null, null, javaProj, Phase.BUILD, isTestCode);
_filer = new BuildFilerImpl(this);
_filesWithAnnotation = filesWithAnnotations;
_additionFiles = additionalFiles;
_problems = new ArrayList<>();
_markerInfos = new ArrayList<>();
-
- if (AptPlugin.DEBUG_COMPILATION_ENV) AptPlugin.trace(
+
+ if (AptPlugin.DEBUG_COMPILATION_ENV) AptPlugin.trace(
"constructed " + this + " for " + _filesWithAnnotation.length + " files"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -139,12 +127,12 @@ public class BuildEnv extends AbstractCompilationEnv
@Override
public TypeDeclaration getTypeDeclaration(String name)
{
- checkValid();
+ checkValid();
TypeDeclaration decl = super.getTypeDeclaration(name);
-
- if (!_batchMode)
+
+ if (!_batchMode)
addTypeDependency(name);
-
+
return decl;
}
@@ -154,7 +142,7 @@ public class BuildEnv extends AbstractCompilationEnv
*/
public boolean hasRaisedErrors(){
return _hasRaisedErrors;
- }
+ }
public static InputStreamReader getFileReader( final IFile file ) throws IOException, CoreException {
return new InputStreamReader(getInputStream(file), file.getCharset());
@@ -179,7 +167,7 @@ public class BuildEnv extends AbstractCompilationEnv
*/
@Override
public void close(){
- if( isClosed() )
+ if( isClosed() )
return;
_markerInfos = null;
_astRoot = null;
@@ -187,13 +175,13 @@ public class BuildEnv extends AbstractCompilationEnv
_astRoots = null;
_filesWithAnnotation = null;
_problems = null;
- _modelCompUnit2astCompUnit.clear();
+ _modelCompUnit2astCompUnit.clear();
_hasRaisedErrors = false;
super.close();
}
-
+
/**
- *
+ *
* @param resource null to indicate current resource
* @param start the starting offset of the marker
* @param end -1 to indicate unknow ending offset.
@@ -202,21 +190,21 @@ public class BuildEnv extends AbstractCompilationEnv
* @param line the line number of where the marker should be
*/
@Override
- void addMessage(IFile resource,
- int start,
+ void addMessage(IFile resource,
+ int start,
int end,
- Severity severity,
- String msg,
+ Severity severity,
+ String msg,
int line,
String[] arguments)
{
checkValid();
-
+
if( resource == null )
resource = getFile();
-
+
_hasRaisedErrors |= severity == MessagerImpl.Severity.ERROR;
-
+
// Eclipse doesn't support INFO-level IProblems, so we send them to the log instead.
if ( severity == Severity.INFO) {
StringBuilder sb = new StringBuilder();
@@ -248,69 +236,69 @@ public class BuildEnv extends AbstractCompilationEnv
AptPlugin.log(status);
return;
}
-
+
if( resource == null ){
assert _batchMode : "not in batch mode but don't know about current resource"; //$NON-NLS-1$
addMarker(start, end, severity, msg, line, arguments);
}
- else
+ else
addProblem(resource, start, end, severity, msg, line, arguments);
}
-
+
private void addProblem(
- IFile resource,
- int start,
+ IFile resource,
+ int start,
int end,
- Severity severity,
- String msg,
+ Severity severity,
+ String msg,
int line,
String[] arguments)
- {
-
+ {
+
APTProblem problem = createProblem(resource, start, end, severity, msg, line, arguments);
_problems.add(problem);
}
-
+
private void addMarker(
- int start,
+ int start,
int end,
- Severity severity,
- String msg,
+ Severity severity,
+ String msg,
int line,
String[] arguments)
- {
-
+ {
+
// Note that the arguments are ignored -- no quick-fix for markers.
_markerInfos.add(new MarkerInfo(start, end, severity, msg, line));
}
-
+
@Override
public Map<String, AnnotationTypeDeclaration> getAnnotationTypes()
{
checkValid();
- assert _astRoot != null && _file != null && !_batchMode :
+ assert _astRoot != null && _file != null && !_batchMode :
"operation not available under batch mode."; //$NON-NLS-1$
return super.getAnnotationTypes();
}
-
+
/**
* Return all annotations at declaration level within all compilation unit(s)
- * associated with this environment. All the files associated with this environment will
+ * associated with this environment. All the files associated with this environment will
* be parsed and resolved for all declaration level elements at the return of this call.
- *
+ *
* @param file2Annotations populated by this method to map files to the annotation types
* if contains. May be null.
* @return the map containing all annotation types found within this environment.
*/
public Map<String, AnnotationTypeDeclaration> getAllAnnotationTypes(
final Map<BuildContext, Set<AnnotationTypeDeclaration>> file2Annotations) {
-
+
checkValid();
- if( _filesWithAnnotation == null )
+ if( _filesWithAnnotation == null )
return getAnnotationTypes();
-
+
final List<Annotation> instances = new ArrayList<>();
- final Map<String, AnnotationTypeDeclaration> decls =
+ final Map<String, AnnotationTypeDeclaration> decls =
new HashMap<>();
final AnnotationVisitor visitor = new AnnotationVisitor(instances);
for( int astIndex=0, len=_astRoots.length; astIndex<len; astIndex++ ){
@@ -318,13 +306,13 @@ public class BuildEnv extends AbstractCompilationEnv
System.err.println();
_astRoots[astIndex].accept(visitor);
final Set<AnnotationTypeDeclaration> perFileAnnos = new HashSet<>();
-
+
for (int instanceIndex=0, size = instances.size(); instanceIndex < size; instanceIndex++) {
final Annotation instance = instances.get(instanceIndex);
final ITypeBinding annoType = instance.resolveTypeBinding();
if (annoType == null)
continue;
- final TypeDeclarationImpl decl =
+ final TypeDeclarationImpl decl =
Factory.createReferenceType(annoType, this);
if (decl != null && decl.kind() == EclipseMirrorObject.MirrorKind.TYPE_ANNOTATION){
final AnnotationTypeDeclaration annoDecl = (AnnotationTypeDeclaration)decl;
@@ -336,37 +324,37 @@ public class BuildEnv extends AbstractCompilationEnv
file2Annotations.put(_filesWithAnnotation[astIndex], perFileAnnos);
visitor.reset();
}
-
+
return decls;
}
/**
* @return - the extra type dependencies for the files under compilation
*/
- public Set<String> getTypeDependencies() { return _typeDependencies; }
-
+ public Set<String> getTypeDependencies() { return _typeDependencies; }
+
/**
- * Switch to batch processing mode.
- * Note: Call to this method will cause all files associated with this environment to be
+ * Switch to batch processing mode.
+ * Note: Call to this method will cause all files associated with this environment to be
* read and parsed.
*/
- public void beginBatchProcessing(){
+ public void beginBatchProcessing(){
if( _phase != Phase.BUILD )
throw new IllegalStateException("No batch processing outside build."); //$NON-NLS-1$
-
+
if( _batchMode ) return;
checkValid();
-
+
_batchMode = true;
_file = null;
_astRoot = null;
}
-
+
public void completedBatchProcessing(){
postMarkers();
completedProcessing();
}
-
+
void createASTs(BuildContext[] cpResults){
final int len = cpResults.length;
final ICompilationUnit[] units = new ICompilationUnit[len];
@@ -378,17 +366,17 @@ public class BuildEnv extends AbstractCompilationEnv
createASTs(_javaProject, units, _requestor = new CallbackRequestor(units));
}
- public void beginFileProcessing(BuildContext result){
+ public void beginFileProcessing(BuildContext result){
if( result == null )
throw new IllegalStateException("missing compilation result"); //$NON-NLS-1$
_batchMode = false;
final IFile file = result.getFile();
if( file.equals(_file) ) // this is a no-op
return;
-
+
_astRoot = null;
_file = null;
-
+
// need to match up the file with the ast.
if( _filesWithAnnotation != null ){
for( int i=0, len=_filesWithAnnotation.length; i<len; i++ ){
@@ -398,37 +386,37 @@ public class BuildEnv extends AbstractCompilationEnv
}
}
}
-
+
if( _file == null || _astRoot == null)
throw new IllegalStateException(
"file " + //$NON-NLS-1$
- file.getName() +
+ file.getName() +
" is not in the list to be processed."); //$NON-NLS-1$
}
-
+
public void completedFileProcessing(){
completedProcessing();
}
-
+
@Override
protected void completedProcessing(){
_problems.clear();
_typeDependencies.clear();
super.completedProcessing();
}
-
+
@Override
public List<? extends CategorizedProblem> getProblems(){
if( !_problems.isEmpty() )
EnvUtil.updateProblemLength(_problems, getAstCompilationUnit());
return _problems;
}
-
+
// Implementation for EclipseAnnotationProcessorEnvironment
@Override
public CompilationUnit getAST()
{
- if( _batchMode )
+ if( _batchMode )
return null;
return _astRoot;
}
@@ -436,12 +424,12 @@ public class BuildEnv extends AbstractCompilationEnv
@Override
public void addTypeDependency(final String fullyQualifiedTypeName )
{
- if(!_batchMode){
+ if(!_batchMode){
_typeDependencies.add( fullyQualifiedTypeName );
}
}
// End of implementation for EclipseAnnotationProcessorEnvironment
-
+
/**
* Include all the types from all files, files with and without annotations on it
* if we are in batch mode. Otherwise, just the types from the file that's currently
@@ -455,15 +443,15 @@ public class BuildEnv extends AbstractCompilationEnv
final List<AbstractTypeDeclaration> typeDecls = new ArrayList<>();
for( int i=0, len=_astRoots.length; i<len; i++ )
typeDecls.addAll( _astRoots[i].types() );
-
+
getTypeDeclarationsFromAdditionFiles(typeDecls);
-
+
return typeDecls;
}
-
+
private void getTypeDeclarationsFromAdditionFiles(List<AbstractTypeDeclaration> typeDecls){
if( _additionFiles == null || _additionFiles.length == 0 ) return;
-
+
final int len = _additionFiles.length;
final ICompilationUnit[] units = new ICompilationUnit[len];
for( int i=0; i<len; i++ ){
@@ -473,7 +461,7 @@ public class BuildEnv extends AbstractCompilationEnv
}
BaseRequestor r = new BaseRequestor(units);
createASTs(_javaProject, units, r);
-
+
CompilationUnit[] asts = r.asts;
for( CompilationUnit ast : asts ){
if( ast != null ){
@@ -481,19 +469,19 @@ public class BuildEnv extends AbstractCompilationEnv
}
}
}
-
+
@Override
protected Map<ASTNode, List<Annotation>> getASTNodesWithAnnotations()
{
if( !_batchMode )
return super.getASTNodesWithAnnotations();
final Map<ASTNode, List<Annotation>> astNode2Anno = new HashMap<>();
- final AnnotatedNodeVisitor visitor = new AnnotatedNodeVisitor(astNode2Anno);
+ final AnnotatedNodeVisitor visitor = new AnnotatedNodeVisitor(astNode2Anno);
for( int i=0, len=_astRoots.length; i<len; i++ )
_astRoots[i].accept( visitor );
return astNode2Anno;
}
-
+
@Override
protected IFile getFileForNode(final ASTNode node)
{
@@ -506,12 +494,12 @@ public class BuildEnv extends AbstractCompilationEnv
}
throw new IllegalStateException();
}
-
+
/**
* Go through the list of compilation unit in this environment and looking for
* the declaration node of the given binding.
- * @param binding
- * @return the compilation unit that defines the given binding or null if no
+ * @param binding
+ * @return the compilation unit that defines the given binding or null if no
* match is found.
*/
@Override
@@ -519,7 +507,7 @@ public class BuildEnv extends AbstractCompilationEnv
{
if( !_batchMode )
return super.searchLocallyForBinding(binding);
-
+
for( int i=0, len=_astRoots.length; i<len; i++ ){
ASTNode node = _astRoots[i].findDeclaringNode(binding);
if( node != null)
@@ -527,12 +515,12 @@ public class BuildEnv extends AbstractCompilationEnv
}
return null;
}
-
+
/**
* Go through the list of compilation unit in this environment and looking for
* the declaration node of the given binding.
- * @param binding
- * @return the compilation unit that defines the given binding or null if no
+ * @param binding
+ * @return the compilation unit that defines the given binding or null if no
* match is found.
*/
@Override
@@ -540,7 +528,7 @@ public class BuildEnv extends AbstractCompilationEnv
{
if( !_batchMode )
return super.searchLocallyForIFile(binding);
-
+
for( int i=0, len=_astRoots.length; i<len; i++ ){
ASTNode node = _astRoots[i].findDeclaringNode(binding);
if( node != null)
@@ -548,7 +536,7 @@ public class BuildEnv extends AbstractCompilationEnv
}
return null;
}
-
+
/**
* @param file
* @return the compilation unit associated with the given file.
@@ -558,7 +546,7 @@ public class BuildEnv extends AbstractCompilationEnv
@Override
public CompilationUnit getASTFrom(final IFile file)
{
- if( file == null )
+ if( file == null )
return null;
else if( file.equals(_file) )
return _astRoot;
@@ -570,15 +558,15 @@ public class BuildEnv extends AbstractCompilationEnv
}
return null;
}
-
+
/**
* @return the current ast being processed if in per-file mode.
* If in batch mode, one of the asts being processed (no guarantee which
- * one will be returned.
+ * one will be returned.
*/
@Override
protected AST getCurrentDietAST(){
-
+
if( _astRoot != null )
return _astRoot.getAST();
else{
@@ -587,7 +575,7 @@ public class BuildEnv extends AbstractCompilationEnv
return _astRoots[0].getAST();
}
}
-
+
void postMarkers()
{
if( _markerInfos == null || _markerInfos.size() == 0 )
@@ -598,8 +586,8 @@ public class BuildEnv extends AbstractCompilationEnv
final IWorkspaceRunnable runnable = new IWorkspaceRunnable(){
@Override
public void run(IProgressMonitor monitor)
- {
- for( MarkerInfo markerInfo : _markerInfos ){
+ {
+ for( MarkerInfo markerInfo : _markerInfos ){
try{
final IMarker marker = _javaProject.getProject().createMarker(AptPlugin.APT_BATCH_PROCESSOR_PROBLEM_MARKER);
markerInfo.copyIntoMarker(marker);
@@ -611,7 +599,7 @@ public class BuildEnv extends AbstractCompilationEnv
}
};
IWorkspace ws = _javaProject.getProject().getWorkspace();
- ws.run(runnable, _javaProject.getProject(), IWorkspace.AVOID_UPDATE, null);
+ ws.run(runnable, null);
}
catch(CoreException e){
AptPlugin.log(e, "Failed to post markers"); //$NON-NLS-1$
@@ -620,17 +608,17 @@ public class BuildEnv extends AbstractCompilationEnv
_markerInfos.clear();
}
}
-
+
public BuildContext[] getFilesWithAnnotation()
{
return _filesWithAnnotation;
}
-
+
public BuildContext[] getFilesWithoutAnnotation()
{
return _additionFiles;
}
-
+
private class CallbackRequestor extends BaseRequestor {
CallbackRequestor(ICompilationUnit[] parseUnits) {
super(parseUnits);
@@ -641,7 +629,7 @@ public class BuildEnv extends AbstractCompilationEnv
// then assign the asts, then begin dispatch
_astRoots = asts;
_callback.run(BuildEnv.this);
- }
+ }
}
-
+
}
diff --git a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/generatedfile/GeneratedSourceFolderManager.java b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/generatedfile/GeneratedSourceFolderManager.java
index f709eafa6c..697c1b2dd2 100644
--- a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/generatedfile/GeneratedSourceFolderManager.java
+++ b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/generatedfile/GeneratedSourceFolderManager.java
@@ -488,7 +488,7 @@ public class GeneratedSourceFolderManager {
};
IWorkspace ws = ResourcesPlugin.getWorkspace();
try{
- ws.run(runnable, srcFolder.getProject(), IWorkspace.AVOID_UPDATE, null);
+ ws.run(runnable, ws.getRoot(), IWorkspace.AVOID_UPDATE, null);
}catch(CoreException e){
AptPlugin.log(e, "Runnable for deleting old generated source folder " + srcFolder.getName() + " failed."); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/org.eclipse.jdt.apt.pluggable.tests/META-INF/MANIFEST.MF b/org.eclipse.jdt.apt.pluggable.tests/META-INF/MANIFEST.MF
index 381ea02118..922bd06b63 100644
--- a/org.eclipse.jdt.apt.pluggable.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.apt.pluggable.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.apt.pluggable.tests;singleton:=true
-Bundle-Version: 3.4.500.qualifier
+Bundle-Version: 3.4.600.qualifier
Bundle-Activator: org.eclipse.jdt.apt.pluggable.tests.Apt6TestsPlugin
Bundle-Localization: plugin
Require-Bundle: org.junit,
diff --git a/org.eclipse.jdt.apt.pluggable.tests/pom.xml b/org.eclipse.jdt.apt.pluggable.tests/pom.xml
index 915f64c3b3..069cbd4f71 100644
--- a/org.eclipse.jdt.apt.pluggable.tests/pom.xml
+++ b/org.eclipse.jdt.apt.pluggable.tests/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2016 Eclipse Foundation and others.
+ Copyright (c) 2012, 2019 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -20,7 +20,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.apt.pluggable.tests</artifactId>
- <version>3.4.500-SNAPSHOT</version>
+ <version>3.4.600-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<testSuite>${project.artifactId}</testSuite>
diff --git a/org.eclipse.jdt.compiler.apt/META-INF/MANIFEST.MF b/org.eclipse.jdt.compiler.apt/META-INF/MANIFEST.MF
index a6aa7eafff..036b41ac0f 100644
--- a/org.eclipse.jdt.compiler.apt/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.compiler.apt/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %fragmentName
Bundle-SymbolicName: org.eclipse.jdt.compiler.apt;singleton:=true
-Bundle-Version: 1.3.400.qualifier
+Bundle-Version: 1.3.500.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: %providerName
Fragment-Host: org.eclipse.jdt.core;bundle-version="[3.5.0,4.0.0)"
diff --git a/org.eclipse.jdt.compiler.apt/pom.xml b/org.eclipse.jdt.compiler.apt/pom.xml
index 2085c1f45b..26554c71ca 100644
--- a/org.eclipse.jdt.compiler.apt/pom.xml
+++ b/org.eclipse.jdt.compiler.apt/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2017 Eclipse Foundation and others.
+ Copyright (c) 2012, 2019 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.compiler.apt</artifactId>
- <version>1.3.400-SNAPSHOT</version>
+ <version>1.3.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/org.eclipse.jdt.compiler.tool/META-INF/MANIFEST.MF b/org.eclipse.jdt.compiler.tool/META-INF/MANIFEST.MF
index ed4c732faa..2f6dc5168d 100644
--- a/org.eclipse.jdt.compiler.tool/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.compiler.tool/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %fragmentName
Bundle-SymbolicName: org.eclipse.jdt.compiler.tool;singleton:=true
-Bundle-Version: 1.2.400.qualifier
+Bundle-Version: 1.2.500.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: compiler_tool_fragment
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/org.eclipse.jdt.compiler.tool/pom.xml b/org.eclipse.jdt.compiler.tool/pom.xml
index 593c61847f..a8bac6c868 100644
--- a/org.eclipse.jdt.compiler.tool/pom.xml
+++ b/org.eclipse.jdt.compiler.tool/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2017 Eclipse Foundation and others.
+ Copyright (c) 2012, 2019 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.compiler.tool</artifactId>
- <version>1.2.400-SNAPSHOT</version>
+ <version>1.2.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF
index d37bc9eae7..587766262c 100644
--- a/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.tests.builder/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.core.tests.builder; singleton:=true
-Bundle-Version: 3.10.400.qualifier
+Bundle-Version: 3.10.500.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.jdt.core.tests.builder
diff --git a/org.eclipse.jdt.core.tests.builder/plugin.xml b/org.eclipse.jdt.core.tests.builder/plugin.xml
index a2cf6324a2..bf08c103ed 100644
--- a/org.eclipse.jdt.core.tests.builder/plugin.xml
+++ b/org.eclipse.jdt.core.tests.builder/plugin.xml
@@ -24,14 +24,4 @@
<managedMarker markerType="org.eclipse.jdt.core.tests.compile.problem"/>
</compilationParticipant>
</extension>
- <extension
- id="TimeStampBuilder"
- point="org.eclipse.core.resources.builders">
- <builder
- hasNature="false">
- <run
- class="org.eclipse.jdt.core.tests.builder.TimeStampBuilder">
- </run>
- </builder>
- </extension>
</plugin>
diff --git a/org.eclipse.jdt.core.tests.builder/pom.xml b/org.eclipse.jdt.core.tests.builder/pom.xml
index a29d9bf91f..5e3392f8e7 100644
--- a/org.eclipse.jdt.core.tests.builder/pom.xml
+++ b/org.eclipse.jdt.core.tests.builder/pom.xml
@@ -19,7 +19,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core.tests.builder</artifactId>
- <version>3.10.400-SNAPSHOT</version>
+ <version>3.10.500-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java
index 0c45e7ed5a..ec9718a8e5 100644
--- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java
+++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java
@@ -544,7 +544,6 @@ public class BuilderTests extends TestCase {
TestAttributeBuilderTests.class,
Bug530366Test.class,
Bug531382Test.class,
- ParallelBuildTests.class,
LeakTestsBefore9.class,
};
List<Class<?>> list = new ArrayList<>(Arrays.asList(classes));
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParallelBuildTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParallelBuildTests.java
deleted file mode 100644
index d964ae6da7..0000000000
--- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParallelBuildTests.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2018 Red Hat 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:
- * Mickael Istria (Red Hat Inc.) - Initial implementation
- *******************************************************************************/
-package org.eclipse.jdt.core.tests.builder;
-
-import java.util.Collections;
-
-import org.eclipse.core.internal.events.BuildCommand;
-import org.eclipse.core.resources.ICommand;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.core.builder.JavaBuilder;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ParallelBuildTests extends BuilderTests {
-
- private int initialMaxParallelBuilds;
-
- public ParallelBuildTests(String name) {
- super(name);
- }
-
- public static junit.framework.Test suite() {
- return buildTestSuite(ParallelBuildTests.class);
- }
-
- @Before
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- TimeStampBuilder.clear();
- this.initialMaxParallelBuilds = env.getWorkspace().getDescription().getMaxConcurrentBuilds();
- InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).putBoolean(JavaBuilder.PREF_NULL_SCHEDULING_RULE, true);
- }
-
- @After
- @Override
- protected void tearDown() throws Exception {
- setMaxParallelBuilds(this.initialMaxParallelBuilds);
- InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).remove(JavaBuilder.PREF_NULL_SCHEDULING_RULE);
- super.tearDown();
- }
-
- @Test
- public void testJDTBuildAllowParallelBuildsForOtherProjects() throws CoreException {
- IProject javaProject1 = env.getProject(env.addProject(getClass().getSimpleName() + "_javaProject1"));
- addBuilder(javaProject1.getProject());
- //
- IProject javaProject2 = env.getProject(env.addProject(getClass().getSimpleName() + "_javaProject2"));
- env.addRequiredProject(javaProject2.getFullPath(), javaProject1.getFullPath());
- addBuilder(javaProject2.getProject());
- //
- IProject rawProject1 = env.getWorkspace().getRoot().getProject(getClass().getSimpleName() + System.currentTimeMillis());
- rawProject1.create(new NullProgressMonitor());
- rawProject1.open(new NullProgressMonitor());
- addBuilder(rawProject1);
- IProject rawProject2 = env.getWorkspace().getRoot().getProject(getClass().getSimpleName() + System.currentTimeMillis());
- rawProject2.create(new NullProgressMonitor());
- rawProject2.open(new NullProgressMonitor());
- addBuilder(rawProject2);
- setMaxParallelBuilds(3);
-
- env.fullBuild();
- // verify that rawProject could build in parallel
- assertTrue(TimeStampBuilder.start(rawProject1) < TimeStampBuilder.end(rawProject2));
- assertTrue(TimeStampBuilder.start(rawProject2) < TimeStampBuilder.end(rawProject1));
- }
-
- private void setMaxParallelBuilds(int n) throws CoreException {
- IWorkspaceDescription desc = env.getWorkspace().getDescription();
- desc.setMaxConcurrentBuilds(n);
- env.getWorkspace().setDescription(desc);
- }
-
- private void addBuilder(IProject project) throws CoreException {
- IProjectDescription desc1 = project.getDescription();
- ICommand[] newCommands = new ICommand[desc1.getBuildSpec().length + 1];
- System.arraycopy(desc1.getBuildSpec(), 0, newCommands, 0, desc1.getBuildSpec().length);
- BuildCommand builderCommand = new BuildCommand();
- builderCommand.setBuilderName(TimeStampBuilder.ID);
- builderCommand.setArguments(Collections.singletonMap(TimeStampBuilder.PAUSE_DURATION, Integer.toString(1000)));
- newCommands[newCommands.length - 1] = builderCommand;
- desc1.setBuildSpec(newCommands);
- project.setDescription(desc1, new NullProgressMonitor());
- }
-}
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TimeStampBuilder.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TimeStampBuilder.java
deleted file mode 100644
index 48fb76554f..0000000000
--- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TimeStampBuilder.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2018 Red Hat 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:
- * Mickael Istria (Red Hat Inc.) - Initial implementation
- *******************************************************************************/
-package org.eclipse.jdt.core.tests.builder;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-public class TimeStampBuilder extends IncrementalProjectBuilder {
-
- public static final String ID = TimeStampBuilder.class.getName();
- public static final String PAUSE_DURATION = "pauseDuration";
- private static final Map<IProject, Long> starts = Collections.synchronizedMap(new HashMap<>());
- private static final Map<IProject, Long> ends = Collections.synchronizedMap(new HashMap<>());
-
- @Override
- protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
- starts.put(getProject(), Long.valueOf(System.currentTimeMillis()));
- try {
- int pauseDuration = 1000;
- if (args.containsKey(PAUSE_DURATION)) {
- pauseDuration = Integer.parseInt(args.get(PAUSE_DURATION));
- }
- Thread.sleep(pauseDuration);
- ends.put(getProject(), Long.valueOf(System.currentTimeMillis()));
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- return new IProject[0];
- }
-
- @Override
- public ISchedulingRule getRule(int kind, Map<String, String> args) {
- return null;
- }
-
- public static long end(IProject project) throws CoreException {
- return ends.get(project).longValue();
- }
-
- public static long start(IProject project) throws CoreException {
- return starts.get(project).longValue();
- }
-
- public static void clear() {
- starts.clear();
- ends.clear();
- }
-
-}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
index 91068fbde9..2c248093e2 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/JavadocCompletionParserTest.java
@@ -163,6 +163,7 @@ protected void verifyCompletionOnJavadocTag(char[] tag, char[][] expectedTags, b
}
protected void verifyAllTagsCompletion() {
+ char[][] allTagsFinal =null;
char[][] allTags = {
// Block tags
TAG_AUTHOR, TAG_DEPRECATED, TAG_EXCEPTION, TAG_PARAM, TAG_RETURN, TAG_SEE, TAG_VERSION, TAG_CATEGORY,
@@ -172,6 +173,15 @@ protected void verifyAllTagsCompletion() {
TAG_LINK,
TAG_DOC_ROOT,
};
+ char[][] allTagsJava9Plus = {
+ // Block tags
+ TAG_AUTHOR, TAG_DEPRECATED, TAG_EXCEPTION, TAG_PARAM, TAG_RETURN, TAG_SEE, TAG_VERSION, TAG_CATEGORY,
+ TAG_SINCE,
+ TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_FIELD , TAG_THROWS, TAG_USES, TAG_PROVIDES,
+ // Inline tags
+ TAG_LINK,
+ TAG_DOC_ROOT
+ };
char[][] additionalTags = null;
if(this.complianceLevel == ClassFileConstants.JDK1_4) {
additionalTags = new char[][] {
@@ -188,13 +198,14 @@ protected void verifyAllTagsCompletion() {
TAG_CODE, TAG_LITERAL, TAG_SYSTEM_PROPERTY
};
}
+ allTagsFinal = this.complianceLevel > ClassFileConstants.JDK1_8 ? allTagsJava9Plus : allTags;
if (additionalTags != null) {
- int length = allTags.length;
+ int length = allTagsFinal.length;
int add = additionalTags.length;
- System.arraycopy(allTags, 0, allTags = new char[length+add][], 0, length);
- System.arraycopy(additionalTags, 0, allTags, length, add);
+ System.arraycopy(allTagsFinal, 0, allTagsFinal = new char[length+add][], 0, length);
+ System.arraycopy(additionalTags, 0, allTagsFinal, length, add);
}
- verifyCompletionOnJavadocTag(null, allTags, false);
+ verifyCompletionOnJavadocTag(null, allTagsFinal, false);
}
/**
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index 01f318f6a7..a60834331f 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -936,7 +936,9 @@ protected static class JavacTestOptions {
JavacBug8044196 = RUN_JAVAC ? // likely https://bugs.openjdk.java.net/browse/JDK-8044196, intermittently masked by https://bugs.openjdk.java.net/browse/JDK-8029161
new JavacHasABug(MismatchType.EclipseErrorsJavacNone, ClassFileConstants.JDK9, 0000, true) : null,
JavacBug6337964 = RUN_JAVAC ? // https://bugs.eclipse.org/bugs/show_bug.cgi?id=112433
- new JavacHasABug(MismatchType.JavacErrorsEclipseNone, ClassFileConstants.JDK1_6, 1045/*guessed*/, true) : null;
+ new JavacHasABug(MismatchType.JavacErrorsEclipseNone, ClassFileConstants.JDK1_6, 1045/*guessed*/, true) : null,
+ JavacBug8144832 = RUN_JAVAC ? // https://bugs.openjdk.java.net/browse/JDK-8144832
+ new JavacHasABug(MismatchType.JavacErrorsEclipseNone, ClassFileConstants.JDK9, 0000) : null;
// bugs that have been fixed but that we've not identified
public static JavacHasABug
@@ -958,9 +960,6 @@ protected static class JavacTestOptions {
ClassFileConstants.JDK9, 0100 /* 9.0.1 or better */) : null;
// bugs that have neither been fixed nor formally identified but which outcomes are obvious enough to clear any doubts
public static JavacHasABug
- JavacGeneratesByteCodeUponWhichJavaThrowsAnException = RUN_JAVAC ?
- new JavacHasABug(
- MismatchType.StandardOutputMismatch) : null,
JavacThrowsAnException = RUN_JAVAC ? // some of these are transient - that is, depend on the system on which the test is run, aka stack overflow
new JavacHasABug(
MismatchType.JavacErrorsEclipseNone) : null,
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
index 7107d367de..1ccbeb201b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -984,7 +984,7 @@ public void test012b(){
String logContents = Util.fileContent(logFileName);
String expectedLogContents =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.005 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_005.dtd\">\n" +
+ "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.006 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_006.dtd\">\n" +
"<compiler copyright=\"{2}\" name=\"{1}\" version=\"{3}\">\n" +
" <command_line>\n" +
" <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" +
@@ -2528,13 +2528,13 @@ public void test039(){
"----------\n" +
"4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
" X<String> x2 = new X<String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Discouraged access: The constructor \'X<String>()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
+ " ^\n" +
+ "Discouraged access: The type \'X<String>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
"----------\n" +
"5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java (at line 4)\n" +
" X<String> x2 = new X<String>();\n" +
" ^\n" +
- "Discouraged access: The type \'X<String>\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
+ "Discouraged access: The constructor \'X<String>()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---/bin1\')\n" +
"----------\n" +
"5 problems (5 warnings)\n",
false);
@@ -5332,17 +5332,17 @@ public void test148_access_restrictions(){
"----------\n" +
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
" ko = new KO();\n" +
- " ^^^^^^^^\n" +
- "Access restriction: The constructor \'KO()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ " ^^\n" +
+ "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
"----------\n" +
"3. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 5)\n" +
" ko = new KO();\n" +
" ^^\n" +
- "Access restriction: The type \'KO\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
+ "Access restriction: The constructor \'KO()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
"----------\n" +
"4. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 6)\n" +
" ko.bar();\n" +
- " ^^^^^^^^\n" +
+ " ^^^\n" +
"Access restriction: The method \'KO.bar()\' is not API (restriction on classpath entry \'---OUTPUT_DIR_PLACEHOLDER---\')\n" +
"----------\n" +
"5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" +
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
index e723cdbad6..5deac455aa 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2017 IBM Corporation and others.
+ * Copyright (c) 2003, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -21,6 +21,7 @@ import java.util.Map;
import junit.framework.Test;
import org.eclipse.jdt.core.ToolFactory;
+import org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest.JavacTestOptions.Excuse;
import org.eclipse.jdt.core.tests.util.Util;
import org.eclipse.jdt.core.util.ClassFileBytesDisassembler;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -1497,7 +1498,7 @@ public void test036() {
"no base" /* expected output string */,
"" /* expected error string */,
// javac options
- JavacTestOptions.JavacHasABug.JavacGeneratesByteCodeUponWhichJavaThrowsAnException /* javac test options */);
+ JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
}
public void test037() {
this.runNegativeTest(
@@ -1828,7 +1829,8 @@ public void test048() {
public void test049() {
CompilerOptions options = new CompilerOptions(getCompilerOptions());
if (options.sourceLevel < ClassFileConstants.JDK1_5) return;
- this.runNegativeTest(
+ Runner runner = new Runner();
+ runner.testFiles =
new String[] {
"A.java",
"public class A {\n" +
@@ -1844,14 +1846,18 @@ public void test049() {
" class Member2<U> extends Other<U>.Member {\n" +
" }\n" +
"}\n"
- },
+ };
+ runner.expectedCompilerLog =
"----------\n" +
"1. WARNING in A.java (at line 3)\n" +
" Other<?>.Member m = (Other<?>.Member) om2;\n" +
" ^^^^^^^^^^^^^^^^^^^^^\n" +
"Unnecessary cast from Other2<?>.Member2<capture#1-of ?> to Other<?>.Member\n" +
- "----------\n"
- );
+ "----------\n";
+ runner.javacTestOptions =
+ Excuse.EclipseHasSomeMoreWarnings; // javac is inconsistent: accepting both assignments, not issuing a warning though in simpler cases it does
+ // note that javac 1.6 doesn't even accept the syntax of this cast
+ runner.runWarningTest();
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=302919
public void test050() {
@@ -2521,7 +2527,9 @@ public void testBug428274() {
public void testBug428274b() {
if (this.complianceLevel < ClassFileConstants.JDK1_5)
return; // uses generics
- String source =
+ Runner runner = new Runner();
+ runner.testFiles = new String[] {
+ "Junk4.java",
"public class Junk4<T> {\n" +
" void setValue(T n) {\n" +
" int rounded = (int) Math.round((double) n);\n" +
@@ -2532,26 +2540,22 @@ public void testBug428274b() {
" j.setValue(Double.valueOf(3.3));\n" +
" j.setValue(Double.valueOf(3.7));\n" +
" }\n" +
- "}\n";
+ "}\n"
+ };
if (this.complianceLevel < ClassFileConstants.JDK1_7) {
- runNegativeTest(
- new String[] {
- "Junk4.java",
- source
- },
+ runner.expectedCompilerLog =
"----------\n" +
"1. ERROR in Junk4.java (at line 3)\n" +
" int rounded = (int) Math.round((double) n);\n" +
" ^^^^^^^^^^\n" +
"Cannot cast from T to double\n" +
- "----------\n");
+ "----------\n";
+ runner.runNegativeTest();
} else {
- runConformTest(
- new String[] {
- "Junk4.java",
- source
- },
- "3\n4");
+ runner.expectedOutputString =
+ "3\n4";
+ runner.javacTestOptions = JavacTestOptions.JavacHasABug.JavacBug8144832;
+ runner.runConformTest();
}
}
// note: spec allows all reference types, but neither javac nor common sense accept arrays :)
@@ -3232,9 +3236,10 @@ public void test461706() {
public void test461706a() {
if (this.complianceLevel < ClassFileConstants.JDK1_8)
return;
- Map customOptions = getCompilerOptions();
- customOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.ERROR);
- this.runNegativeTest(
+ Runner runner = new Runner();
+ runner.customOptions = getCompilerOptions();
+ runner.customOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.WARNING);
+ runner.testFiles =
new String[] {
"Bug.java",
"import java.util.ArrayList;\n" +
@@ -3261,16 +3266,15 @@ public void test461706a() {
" .orElse(ICondition.TRUE);\n" +
" }\n" +
"}"
- },
+ };
+ runner.expectedCompilerLog =
"----------\n" +
- "1. ERROR in Bug.java (at line 20)\n" +
+ "1. WARNING in Bug.java (at line 20)\n" +
" .map(x -> (ICondition)x)\n" +
" ^^^^^^^^^^^^^\n" +
"Unnecessary cast from Bug.ICondition to Bug.ICondition\n" +
- "----------\n",
- null,
- true,
- customOptions);
+ "----------\n";
+ runner.runWarningTest();
}
public void testAnonymous_bug520727() {
String[] source = {
@@ -3297,6 +3301,52 @@ public void testAnonymous_bug520727() {
runConformTest(source,"");
}
}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=543727 False positive "Unnecessary cast"
+public void test543727() {
+ if (this.complianceLevel < ClassFileConstants.JDK1_7)
+ return;
+ Map customOptions = getCompilerOptions();
+ customOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.ERROR);
+ this.runConformTest(
+ new String[] {
+ "Bug.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class Bug {\n" +
+ " public static void main(String[] args) {\n" +
+ " List<Comparable<?>> vector = new ArrayList<>();\n" +
+ " vector.add(0);\n" +
+ " if (vector.get(0) == (Integer)0) {\n" +
+ " System.out.print(\"SUCCESS\");\n" +
+ " }\n" +
+ " }" +
+ "}\n",
+ },
+ "SUCCESS");
+}
+public void test543727_notequals() {
+ if (this.complianceLevel < ClassFileConstants.JDK1_7)
+ return;
+ Map customOptions = getCompilerOptions();
+ customOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.ERROR);
+ this.runConformTest(
+ new String[] {
+ "Bug.java",
+ "import java.util.ArrayList;\n" +
+ "import java.util.List;\n" +
+ "public class Bug {\n" +
+ " public static void main(String[] args) {\n" +
+ " List<Comparable<?>> vector = new ArrayList<>();\n" +
+ " vector.add(0);\n" +
+ " if (vector.get(0) != (Integer)1) {\n" +
+ " System.out.print(\"SUCCESS\");\n" +
+ " }\n" +
+ " }" +
+ "}\n",
+ },
+ "SUCCESS");
+}
+
public static Class testClass() {
return CastTest.class;
}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
index 1979b4bbdd..1504327072 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
@@ -9485,4 +9485,91 @@ public void testBug508834_comment0() {
};
runner.runConformTest();
}
+ public void testBug540846() {
+ Runner runner = new Runner();
+ runner.testFiles = new String[] {
+ "Test.java",
+ "import java.util.*;\n" +
+ "import java.util.stream.*;\n" +
+ "import java.math.*;\n" +
+ "\n" +
+ "public class Test {\n" +
+ " private List<Object> getRowValues(Map<String, BigDecimal> record, Stream<String> factors) {\n" +
+ " return Stream.concat(\n" +
+ " factors.map(f -> {\n" +
+ " if (f.equals(\"x\")) {\n" +
+ " return record.get(f);\n" +
+ " } else {\n" +
+ " return \"NM\";\n" +
+ " }\n" +
+ " }),\n" +
+ " Stream.of(BigDecimal.ONE)\n" +
+ " )\n" +
+ " .map(v -> (v instanceof BigDecimal) ? ((BigDecimal) v).setScale(10, BigDecimal.ROUND_HALF_UP) : v)\n" +
+ " .collect(Collectors.toList());\n" +
+ " }\n" +
+ "}\n"
+ };
+ runner.runConformTest();
+ }
+ public void testBug538192() {
+ Runner runner = new Runner();
+ runner.testFiles = new String[] {
+ "Test.java",
+ "import java.util.*;\n" +
+ "import java.util.function.Function;\n" +
+ "interface ListFunc<T> extends Function<List<String>, T> {}\n" +
+ "interface MapFunc<T> extends Function<Map<String,String>, T> {}\n" +
+ "class DTT {\n" +
+ " public <T> DTT(Class<T> c, ListFunc<T> f) {}\n" +
+ " public <T> DTT(Class<T> c, MapFunc<T> f) {} \n" +
+ "}\n" +
+ "public class Test {\n" +
+ " void test() {\n" +
+ " new DTT(Integer.class, (Map<String, String> row) -> Integer.valueOf(0));\n" +
+ " }\n" +
+ "}\n"
+ };
+ runner.runConformTest();
+ }
+ public void testBug536860() {
+ runConformTest(
+ new String[] {
+ "Snippet.java",
+ "import java.io.IOException;\n" +
+ "import java.io.InputStream;\n" +
+ "import java.nio.file.Path;\n" +
+ "import java.util.Map;\n" +
+ "import java.util.concurrent.Callable;\n" +
+ "import java.util.function.Function;\n" +
+ "\n" +
+ "interface EntityReader<T, S> { }\n" +
+ "class ExtraIOUtils {\n" +
+ " public static Callable<InputStream> getInputStreamProvider() {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n" +
+ "\n" +
+ "public class Snippet {\n" +
+ " public <T> EntityReader<T, Path> createEntityReader(\n" +
+ " Function<? super String, ? extends String> colNameMapper,\n" +
+ " Function<? super String[], ? extends T> instantiator,\n" +
+ " Map<String, ?> runtimeValues)\n" +
+ " throws IOException {\n" +
+ " EntityReader<T, ?> streamReader =\n" +
+ " createEntityStreamReader(\n" +
+ " ExtraIOUtils.getInputStreamProvider(),\n" +
+ " colNameMapper, instantiator, runtimeValues);\n" +
+ " return null;\n" +
+ " }\n" +
+ " public <T> EntityReader<T, Callable<InputStream>> createEntityStreamReader(\n" +
+ " Callable<InputStream> streamProvider,\n" +
+ " Function<? super String, ? extends String> colNameMapper, Function<? super String[], ? extends T> instantiator,\n" +
+ " Map<String, ?> runtimeValues)\n" +
+ " throws IOException {\n" +
+ " return null;\n" +
+ " }\n" +
+ "}\n"
+ });
+ }
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
index 36879049c5..36ec699cc1 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java
@@ -14773,4 +14773,68 @@ public void testBug159565g() throws JavaModelException {
String input = getCompilationUnit("Formatter", "", "test159565", "in.java").getSource();
formatSource(input, getCompilationUnit("Formatter", "", "test159565", "G_out.java").getSource());
}
+/**
+ * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
+ */
+public void testBug541011a() throws JavaModelException {
+ this.formatterPrefs.page_width = 80;
+ String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
+ formatSource(input, getCompilationUnit("Formatter", "", "test541011", "A_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
+ */
+public void testBug541011b() throws JavaModelException {
+ this.formatterPrefs.page_width = 80;
+ this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_COMPACT_SPLIT;
+ String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
+ formatSource(input, getCompilationUnit("Formatter", "", "test541011", "B_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
+ */
+public void testBug541011c() throws JavaModelException {
+ this.formatterPrefs.page_width = 80;
+ this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT;
+ String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
+ formatSource(input, getCompilationUnit("Formatter", "", "test541011", "C_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
+ */
+public void testBug541011d() throws JavaModelException {
+ this.formatterPrefs.page_width = 80;
+ this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
+ String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
+ formatSource(input, getCompilationUnit("Formatter", "", "test541011", "D_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
+ */
+public void testBug541011e() throws JavaModelException {
+ this.formatterPrefs.page_width = 80;
+ this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
+ this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE;
+ String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
+ formatSource(input, getCompilationUnit("Formatter", "", "test541011", "E_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
+ */
+public void testBug541011f() throws JavaModelException {
+ this.formatterPrefs.page_width = 80;
+ this.formatterPrefs.alignment_for_conditional_expression_chain = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
+ this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
+ String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
+ formatSource(input, getCompilationUnit("Formatter", "", "test541011", "F_out.java").getSource());
+}
+/**
+ * https://bugs.eclipse.org/541011 - [formatter] Option to wrap chained conditionals as one group
+ */
+public void testBug541011g() throws JavaModelException {
+ this.formatterPrefs.page_width = 80;
+ this.formatterPrefs.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT + Alignment.M_FORCE + Alignment.M_INDENT_ON_COLUMN;
+ String input = getCompilationUnit("Formatter", "", "test541011", "in.java").getSource();
+ formatSource(input, getCompilationUnit("Formatter", "", "test541011", "G_out.java").getSource());
+}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
index cb69901f1c..1b39e0b558 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java
@@ -641,6 +641,15 @@ public abstract class AbstractJavaModelTests extends SuiteOfTestCases {
exported);
addClasspathEntry(project, entry);
}
+
+ protected void addModularProjectEntry(IJavaProject project, IJavaProject depProject) throws JavaModelException {
+ addClasspathEntry(project, newModularProjectEntry(depProject));
+ }
+
+ protected IClasspathEntry newModularProjectEntry(IJavaProject depProject) {
+ return JavaCore.newProjectEntry(depProject.getPath(), null, false, moduleAttribute(), false);
+ }
+
protected void assertSortedElementsEqual(String message, String expected, IJavaElement[] elements) {
sortElements(elements);
assertElementsEqual(message, expected, elements);
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java
index 59b37f6f23..994a526d58 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AccessRestrictionsTests.java
@@ -167,7 +167,7 @@ public void test001() throws CoreException {
"----------\n" +
"1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
" foo(); // accesses X1.foo, should trigger an error\n" +
- " ^^^^^\n" +
+ " ^^^\n" +
"Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
@@ -352,7 +352,7 @@ public void test003() throws CoreException {
"----------\n" +
"3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
" foo(); // error\n" +
- " ^^^^^\n" +
+ " ^^^\n" +
"Access restriction: The method \'X1.C1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n" +
"4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
@@ -362,13 +362,13 @@ public void test003() throws CoreException {
"----------\n" +
"5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
" new C1(0); // error\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
"----------\n" +
"6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
" new C1(0); // error\n" +
" ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -531,7 +531,7 @@ public void test005() throws CoreException {
"----------\n" +
"1. ERROR in /P2/src/r/Y.java (at line 4)\n" +
" (new q.X2()).foo(); // accesses p.X1#foo, should trigger an error\n" +
- " ^^^^^^^^^^^^^^^^^^\n" +
+ " ^^^\n" +
"Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
@@ -617,13 +617,13 @@ public void test006() throws CoreException {
"----------\n" +
"3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
" X<String> x2 = new X<String>();\n" +
- " ^^^^^^^^^^^^^^^\n" +
- "Access restriction: The constructor \'X<String>()\' is not API (restriction on required project \'P1\')\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
"----------\n" +
"4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
" X<String> x2 = new X<String>();\n" +
" ^\n" +
- "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
+ "Access restriction: The constructor \'X<String>()\' is not API (restriction on required project \'P1\')\n" +
"----------\n");
} finally {
if (x != null) {
@@ -709,13 +709,13 @@ public void test007() throws CoreException {
"----------\n" +
"3. ERROR in /P2/src/p/Y.java (at line 4)\n" +
" X<String> x2 = new X<String>(\"\");\n" +
- " ^^^^^^^^^^^^^^^^^\n" +
- "Access restriction: The constructor \'X<String>(String)\' is not API (restriction on required project \'P1\')\n" +
+ " ^\n" +
+ "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
"----------\n" +
"4. ERROR in /P2/src/p/Y.java (at line 4)\n" +
" X<String> x2 = new X<String>(\"\");\n" +
" ^\n" +
- "Access restriction: The type \'X<String>\' is not API (restriction on required project \'P1\')\n" +
+ "Access restriction: The constructor \'X<String>(String)\' is not API (restriction on required project \'P1\')\n" +
"----------\n");
} finally {
if (x != null) {
@@ -800,7 +800,7 @@ public void test008() throws CoreException {
"----------\n" +
"1. ERROR in /P2/src/p/Y.java (at line 4)\n" +
" foo(); // accesses X1.foo, should trigger an error\n" +
- " ^^^^^\n" +
+ " ^^^\n" +
"Access restriction: The method \'X1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
@@ -996,7 +996,7 @@ public void test010() throws CoreException {
"----------\n" +
"3. ERROR in /P2/src/p/Y.java (at line 6)\n" +
" foo(); // error\n" +
- " ^^^^^\n" +
+ " ^^^\n" +
"Access restriction: The method \'X1.C1.foo()\' is not API (restriction on required project \'P1\')\n" +
"----------\n" +
"4. ERROR in /P2/src/p/Y.java (at line 11)\n" +
@@ -1006,13 +1006,13 @@ public void test010() throws CoreException {
"----------\n" +
"5. ERROR in /P2/src/p/Y.java (at line 12)\n" +
" new C1(0); // error\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
+ " ^^\n" +
+ "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
"----------\n" +
"6. ERROR in /P2/src/p/Y.java (at line 12)\n" +
" new C1(0); // error\n" +
" ^^\n" +
- "Access restriction: The type \'X1.C1\' is not API (restriction on required project \'P1\')\n" +
+ "Access restriction: The constructor \'X1.C1(int)\' is not API (restriction on required project \'P1\')\n" +
"----------\n"
);
} finally {
@@ -1070,17 +1070,17 @@ public void test011() throws CoreException {
"----------\n" +
"2. ERROR in /P1/src/q/Y.java (at line 4)\n" +
" p.X x = new p.X();\n" +
- " ^^^^^^^^^\n" +
- "Access restriction: The constructor \'X()\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
+ " ^^^\n" +
+ "Access restriction: The type \'X\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
"----------\n" +
"3. ERROR in /P1/src/q/Y.java (at line 4)\n" +
" p.X x = new p.X();\n" +
" ^^^\n" +
- "Access restriction: The type \'X\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
+ "Access restriction: The constructor \'X()\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
"----------\n" +
"4. ERROR in /P1/src/q/Y.java (at line 5)\n" +
" x.foo();\n" +
- " ^^^^^^^\n" +
+ " ^^^\n" +
"Access restriction: The method \'X.foo()\' is not API (restriction on required library \'AccessRestrictions/lib.jar\')\n" +
"----------\n" +
"5. ERROR in /P1/src/q/Y.java (at line 6)\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
index 118f3c6287..304d2120df 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java
@@ -35,6 +35,7 @@ import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.eval.IEvaluationContext;
+import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.internal.codeassist.CompletionEngine;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.core.eval.EvaluationContextWrapper;
@@ -25887,4 +25888,39 @@ public void testBug533740d() throws JavaModelException {
"super[KEYWORD]{super, null, null, super, null, 51}",
requestor.getResults());
}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=496354
+public void testBug496354() throws Exception {
+ this.workingCopies = new ICompilationUnit[1];
+ this.workingCopies[0] = getWorkingCopy(
+ "Completion/src/Foo.java",
+ "package test;\n" +
+ "import java.io.IOException;\n" +
+ "import java.lang.annotation.ElementType;\n" +
+ "import java.lang.annotation.Target;\n" +
+ "import java.util.ArrayList;\n" +
+ "@Target(ElementType.METHOD)\n" +
+ "@interface T {\n" +
+ " int val1() default 1;\n" +
+ " int val2() default -1;\n" +
+ "}\n" +
+ "public class Foo {\n" +
+ " @T()\n" +
+ " public int add(int x, int y) {\n" +
+ " return x + y;\n" +
+ " };\n" +
+ "}\n");
+
+ COMPLETION_PROJECT.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, "");
+ COMPLETION_PROJECT.setOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, "");
+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
+ requestor.allowAllRequiredProposals();
+ String str = this.workingCopies[0].getSource();
+ String completeBehind = "@T(";
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
+ assertResults(
+ "val1[ANNOTATION_ATTRIBUTE_REF]{val1=, LT;, I, val1, null, 52}\n" +
+ "val2[ANNOTATION_ATTRIBUTE_REF]{val2=, LT;, I, val2, null, 52}",
+ requestor.getResults());
+}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
index 45025486f1..77022c605f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests3.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 IBM Corporation and others.
+ * Copyright (c) 2017, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -185,7 +185,7 @@ public void testBug425035a() throws CoreException {
this.workingCopies[2].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
"Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value, La.Annotation;, [La.Values;, value, null, 52}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , La.Annotation;, [La.Values;, value, null, 52}\n" +
"Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
"OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
@@ -431,7 +431,7 @@ public void testBug425035_method_a() throws CoreException {
assertResults(
"Test[TYPE_REF]{Test, b, Lb.Test;, null, null, 52}\n" +
"i[FIELD_REF]{i, Lb.Test;, I, i, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value, La.Annotation;, [La.Values;, value, null, 52}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , La.Annotation;, [La.Values;, value, null, 52}\n" +
"Values[TYPE_REF]{a.Values, a, La.Values;, null, null, 99}\n" +
"OTHER_VALUE[FIELD_REF]{Values.OTHER_VALUE, La.Values;, La.Values;, OTHER_VALUE, null, 104}\n" +
"SOME_VALUE[FIELD_REF]{Values.SOME_VALUE, La.Values;, La.Values;, SOME_VALUE, null, 104}",
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
index b9fc44645b..0fc84e4d81 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests9.java
@@ -1578,7 +1578,7 @@ public void testBug530911() throws Exception {
unit.codeComplete(cursorLocation, requestor);
String expected = "NonNull[TYPE_REF]{NonNull, p, Lp.NonNull;, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value, Ljava.lang.annotation.Target;, [Ljava.lang.annotation.ElementType;, value, 52}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , Ljava.lang.annotation.Target;, [Ljava.lang.annotation.ElementType;, value, 52}\n" +
"ElementType[TYPE_REF]{ElementType, java.lang.annotation, Ljava.lang.annotation.ElementType;, null, 102}\n" +
"ANNOTATION_TYPE[FIELD_REF]{ElementType.ANNOTATION_TYPE, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, ANNOTATION_TYPE, 104}\n" +
"CONSTRUCTOR[FIELD_REF]{ElementType.CONSTRUCTOR, Ljava.lang.annotation.ElementType;, Ljava.lang.annotation.ElementType;, CONSTRUCTOR, 104}\n" +
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java
index b6be9e6fe1..2aa1dccdfb 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -2455,7 +2455,7 @@ public void test0088() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0088.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0088.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0089() throws JavaModelException {
@@ -2478,7 +2478,7 @@ public void test0089() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0089.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0089.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0090() throws JavaModelException {
@@ -2501,7 +2501,7 @@ public void test0090() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0090.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0090.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0091() throws JavaModelException {
@@ -2526,7 +2526,7 @@ public void test0091() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0091.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0091.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0092() throws JavaModelException {
@@ -2549,7 +2549,7 @@ public void test0092() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0092.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0092.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0093() throws JavaModelException {
@@ -2573,7 +2573,7 @@ public void test0093() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0093.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0093.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0094() throws JavaModelException {
@@ -2595,7 +2595,7 @@ public void test0094() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0094.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0094.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0095() throws JavaModelException {
@@ -2618,7 +2618,7 @@ public void test0095() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0095.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0095.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0096() throws JavaModelException {
@@ -2641,7 +2641,7 @@ public void test0096() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0096.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0096.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0097() throws JavaModelException {
@@ -2666,7 +2666,7 @@ public void test0097() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0097.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0097.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0098() throws JavaModelException {
@@ -2689,7 +2689,7 @@ public void test0098() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0098.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0098.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0099() throws JavaModelException {
@@ -2713,7 +2713,7 @@ public void test0099() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0099.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0099.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0100() throws JavaModelException {
@@ -2735,7 +2735,7 @@ public void test0100() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0100.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0100.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0101() throws JavaModelException {
@@ -2758,7 +2758,7 @@ public void test0101() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0101.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0101.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0102() throws JavaModelException {
@@ -2781,7 +2781,7 @@ public void test0102() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0102.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0102.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0103() throws JavaModelException {
@@ -2806,7 +2806,7 @@ public void test0103() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0103.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0103.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0104() throws JavaModelException {
@@ -2829,7 +2829,7 @@ public void test0104() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0104.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0104.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0105() throws JavaModelException {
@@ -2853,7 +2853,7 @@ public void test0105() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0105.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0105.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0106() throws JavaModelException {
@@ -2875,7 +2875,7 @@ public void test0106() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0106.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0106.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0107() throws JavaModelException {
@@ -2898,7 +2898,7 @@ public void test0107() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0107.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0107.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0108() throws JavaModelException {
@@ -2921,7 +2921,7 @@ public void test0108() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0108.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0108.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0109() throws JavaModelException {
@@ -2946,7 +2946,7 @@ public void test0109() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0109.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0109.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0110() throws JavaModelException {
@@ -2969,7 +2969,7 @@ public void test0110() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0110.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0110.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0111() throws JavaModelException {
@@ -2993,7 +2993,7 @@ public void test0111() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0111.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0111.TestAnnotation;, Ljava.lang.String;, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0112() throws JavaModelException {
@@ -3016,7 +3016,7 @@ public void test0112() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0112.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0112.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0113() throws JavaModelException {
@@ -3040,7 +3040,7 @@ public void test0113() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0113.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0113.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0114() throws JavaModelException {
@@ -3064,7 +3064,7 @@ public void test0114() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0114.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0114.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0115() throws JavaModelException {
@@ -3090,7 +3090,7 @@ public void test0115() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0115.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0115.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0116() throws JavaModelException {
@@ -3114,7 +3114,7 @@ public void test0116() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0116.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0116.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0117() throws JavaModelException {
@@ -3139,7 +3139,7 @@ public void test0117() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0117.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0117.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0118() throws JavaModelException {
@@ -3162,7 +3162,7 @@ public void test0118() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0118.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0118.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0119() throws JavaModelException {
@@ -3186,7 +3186,7 @@ public void test0119() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0119.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0119.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0120() throws JavaModelException {
@@ -3210,7 +3210,7 @@ public void test0120() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0120.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0120.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0121() throws JavaModelException {
@@ -3236,7 +3236,7 @@ public void test0121() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0121.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0121.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0122() throws JavaModelException {
@@ -3260,7 +3260,7 @@ public void test0122() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0122.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0122.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0123() throws JavaModelException {
@@ -3285,7 +3285,7 @@ public void test0123() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0123.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0123.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0124() throws JavaModelException {
@@ -3308,7 +3308,7 @@ public void test0124() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0124.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0124.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0125() throws JavaModelException {
@@ -3332,7 +3332,7 @@ public void test0125() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0125.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0125.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0126() throws JavaModelException {
@@ -3356,7 +3356,7 @@ public void test0126() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0126.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0126.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0127() throws JavaModelException {
@@ -3382,7 +3382,7 @@ public void test0127() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0127.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0127.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0128() throws JavaModelException {
@@ -3406,7 +3406,7 @@ public void test0128() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0128.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0128.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0129() throws JavaModelException {
@@ -3431,7 +3431,7 @@ public void test0129() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0129.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0129.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0130() throws JavaModelException {
@@ -3454,7 +3454,7 @@ public void test0130() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0130.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0130.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0131() throws JavaModelException {
@@ -3478,7 +3478,7 @@ public void test0131() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0131.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0131.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0132() throws JavaModelException {
@@ -3502,7 +3502,7 @@ public void test0132() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0132.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0132.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0133() throws JavaModelException {
@@ -3528,7 +3528,7 @@ public void test0133() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0133.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0133.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0134() throws JavaModelException {
@@ -3552,7 +3552,7 @@ public void test0134() throws JavaModelException {
this.wc.codeComplete(cursorLocation, requestor);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0134.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0134.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
requestor.getResults());
}
public void test0135() throws JavaModelException {
@@ -3571,7 +3571,7 @@ public void test0135() throws JavaModelException {
"foo");
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0135.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0135.TestAnnotation;, Ljava.lang.String;, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED + R_UNQUALIFIED) + "}",
result.proposals);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84554
@@ -6219,8 +6219,8 @@ public void test0196b() throws JavaModelException {
result.context);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0196.ZZAnnot;, I, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0196.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0196.ZZAnnot;, I, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0196.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
result.proposals);
}
public void test0197() throws JavaModelException {
@@ -6266,8 +6266,8 @@ public void test0197b() throws JavaModelException {
result.context);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0197.ZZAnnot;, I, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0197.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0197.ZZAnnot;, I, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0197.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
result.proposals);
}
public void test0198() throws JavaModelException {
@@ -6313,8 +6313,8 @@ public void test0198b() throws JavaModelException {
result.context);
assertResults(
- "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1, Ltest0198.ZZAnnot;, I, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0198.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ "foo1[ANNOTATION_ATTRIBUTE_REF]{foo1 = , Ltest0198.ZZAnnot;, I, foo1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0198.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
result.proposals);
}
public void test0199() throws JavaModelException {
@@ -6358,7 +6358,7 @@ public void test0199b() throws JavaModelException {
result.context);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0199.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0199.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
result.proposals);
}
public void test0200() throws JavaModelException {
@@ -6404,7 +6404,7 @@ public void test0200b() throws JavaModelException {
result.context);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0200.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0200.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
result.proposals);
}
public void test0201() throws JavaModelException {
@@ -6450,7 +6450,7 @@ public void test0201b() throws JavaModelException {
result.context);
assertResults(
- "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2, Ltest0201.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ "foo2[ANNOTATION_ATTRIBUTE_REF]{foo2 = , Ltest0201.ZZAnnot;, I, foo2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
result.proposals);
}
public void test0202() throws JavaModelException {
@@ -8080,8 +8080,8 @@ public void test0260() throws JavaModelException {
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
assertResults(
- "oneTwoThree[ANNOTATION_ATTRIBUTE_REF]{oneTwoThree, Lcamelcase.Annot;, Ljava.lang.String;, oneTwoThree, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "oTTAttribute[ANNOTATION_ATTRIBUTE_REF]{oTTAttribute, Lcamelcase.Annot;, Ljava.lang.String;, oTTAttribute, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
+ "oneTwoThree[ANNOTATION_ATTRIBUTE_REF]{oneTwoThree = , Lcamelcase.Annot;, Ljava.lang.String;, oneTwoThree, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CAMEL_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
+ "oTTAttribute[ANNOTATION_ATTRIBUTE_REF]{oTTAttribute = , Lcamelcase.Annot;, Ljava.lang.String;, oTTAttribute, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
requestor.getResults());
} finally {
JavaCore.setOptions(this.oldOptions);
@@ -13894,9 +13894,9 @@ public void testBug343865a() throws JavaModelException {
cu.codeComplete(cursorLocation, requestor);
assertResults(
- "name[ANNOTATION_ATTRIBUTE_REF]{name, Ltestxxx.YAAnnot;, Ljava.lang.String;, name, null, " +
+ "name[ANNOTATION_ATTRIBUTE_REF]{name = , Ltestxxx.YAAnnot;, Ljava.lang.String;, name, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
- "val[ANNOTATION_ATTRIBUTE_REF]{val, Ltestxxx.YAAnnot;, I, val, null, " +
+ "val[ANNOTATION_ATTRIBUTE_REF]{val = , Ltestxxx.YAAnnot;, I, val, null, " +
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
requestor.getResults());
}
@@ -14558,7 +14558,7 @@ public void testBug526590() throws JavaModelException {
assertResults(
"Bug526590[TYPE_REF]{Bug526590, testbug526590, Ltestbug526590.Bug526590;, null, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value, Ltestbug526590.QQAnnotation;, [Ljava.lang.String;, value, null, 52}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , Ltestbug526590.QQAnnotation;, [Ljava.lang.String;, value, null, 52}\n" +
"String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, 82}",
requestor.getResults());
}
@@ -14590,7 +14590,7 @@ public void testBug526590b() throws JavaModelException {
assertResults(
"Bug526590[TYPE_REF]{Bug526590, testbug526590, Ltestbug526590.Bug526590;, null, null, 52}\n" +
- "value[ANNOTATION_ATTRIBUTE_REF]{value, Ltestbug526590.QQAnnotation;, [Ljava.lang.String;, value, null, 52}\n" +
+ "value[ANNOTATION_ATTRIBUTE_REF]{value = , Ltestbug526590.QQAnnotation;, [Ljava.lang.String;, value, null, 52}\n" +
"String[TYPE_REF]{String, java.lang, Ljava.lang.String;, null, null, 82}",
requestor.getResults());
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
index 3acc9fdd6f..81d316fc7b 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java
@@ -8,6 +8,10 @@
*
* SPDX-License-Identifier: EPL-2.0
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -41,7 +45,6 @@ import org.eclipse.jdt.core.IModuleDescription;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IProblemRequestor;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.WorkingCopyOwner;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.CompilationUnit;
@@ -103,12 +106,6 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
deleteProject("P1");
}
- void addModularProjectEntry(IJavaProject project, IJavaProject depProject) throws JavaModelException {
- addClasspathEntry(project, newModularProjectEntry(depProject));
- }
- IClasspathEntry newModularProjectEntry(IJavaProject depProject) {
- return JavaCore.newProjectEntry(depProject.getPath(), null, false, moduleAttribute(), false);
- }
// Test that the java.base found as a module package fragment root in the project
public void test001() throws CoreException {
try {
@@ -703,8 +700,14 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
public void testConvertToModule() throws CoreException, IOException {
Hashtable<String, String> javaCoreOptions = JavaCore.getOptions();
try {
- IJavaProject project = setUpJavaProject("ConvertToModule", JavaCore.VERSION_9);
- assertEquals("9", project.getOption("org.eclipse.jdt.core.compiler.compliance", true));
+ IJavaProject project = setUpJavaProject("ConvertToModule");
+ Map<String, String> options = new HashMap<>();
+ // Make sure the new options map doesn't reset.
+ options.put(CompilerOptions.OPTION_Compliance, "9");
+ options.put(CompilerOptions.OPTION_Source, "9");
+ options.put(CompilerOptions.OPTION_TargetPlatform, "9");
+ options.put(CompilerOptions.OPTION_Release, "enabled");
+ project.setOptions(options);
project.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
IPackageFragmentRoot[] roots = project.getPackageFragmentRoots();
IPackageFragmentRoot theRoot = null;
@@ -4408,6 +4411,12 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
IClasspathEntry dep = JavaCore.newProjectEntry(p1.getPath(), null, false, new IClasspathAttribute[] {modAttr}, false);
IJavaProject p2 = setupModuleProject("com.greetings", src, new IClasspathEntry[] {dep});
getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = p2.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ sortMarkers(markers);
+ assertMarkers("markers on com.greetings",
+ "The package bundle.org conflicts with a package accessible from another module: org.astro",
+ markers);
+
src = new String[] {
"src/module-info.java",
"module test {\n" +
@@ -4427,8 +4436,8 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
};
IClasspathEntry dep2 = JavaCore.newProjectEntry(p2.getPath(), null, false, new IClasspathAttribute[] {modAttr}, false);
IJavaProject p3 = setupModuleProject("test", src, new IClasspathEntry[] {dep, dep2});
- getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
- IMarker[] markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ p3.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ markers = p3.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
assertMarkers("Unexpected markers", "", markers);
} finally {
this.deleteProject("test");
@@ -7949,6 +7958,108 @@ public class ModuleBuilderTests extends ModifyingResourceTests {
}
}
+ public void testBug544126() throws CoreException, IOException {
+ String outputDirectory = Util.getOutputDirectory();
+ IJavaProject p = createJava9Project("p");
+ try {
+ String jar1Path = outputDirectory + File.separator + "auto1Lib.jar";
+ createJar(
+ new String[] {
+ "org/test/Root.java",
+ "package org.test;\n" +
+ "public class Root {}\n"
+ },
+ jar1Path);
+ String jar2Path = outputDirectory + File.separator + "auto2Lib.jar";
+ createJar(
+ new String[] {
+ "org/test/ext/Ext.java",
+ "package org.test.ext;\n" +
+ "public class Ext {}\n"
+ },
+ jar2Path);
+ addModularLibraryEntry(p, new Path(jar1Path), null);
+ addModularLibraryEntry(p, new Path(jar2Path), null);
+ createFolder("p/src/test");
+ String testPath = "p/src/test/Test.java";
+ String testSource =
+ "package test;\n" +
+ "import org.test.Root;\n" +
+ "public class Test {\n" +
+ " public static void main(String[] args) { \n" +
+ " System.out.println(new Root());\n" +
+ " }\n" +
+ "}\n";
+ createFile(testPath, testSource);
+ createFile("p/src/module-info.java",
+ "module test {\n" +
+ " requires auto1Lib;\n" +
+ " requires auto2Lib;\n" +
+ "}\n");
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ assertNoErrors();
+
+ this.problemRequestor.initialize(testSource.toCharArray());
+ getCompilationUnit(testPath).getWorkingCopy(this.wcOwner, null);
+ assertProblems("unexpected problems",
+ "----------\n" +
+ "----------\n",
+ this.problemRequestor);
+ } finally {
+ deleteProject(p);
+ File outputDir = new File(outputDirectory);
+ if (outputDir.exists())
+ Util.flushDirectoryContent(outputDir);
+ }
+ }
+
+ public void testBug544432() throws CoreException {
+ IJavaProject prjA = createJava9Project("A");
+ IJavaProject prjB = createJava9Project("B");
+ try {
+ createFolder("A/src/com/a");
+ createFile("A/src/com/a/A.java",
+ "package com.a;\n" +
+ "\n" +
+ "public class A {}\n");
+ createFile("A/src/module-info.java",
+ "open module com.a {\n" +
+ " exports com.a;\n" +
+ "}\n");
+
+ addModularProjectEntry(prjB, prjA);
+ createFolder("B/src/com/a/b");
+ String bPath = "B/src/com/a/b/B.java";
+ String bSource =
+ "package com.a.b;\n" +
+ "import com.a.A;\n" +
+ "public class B {\n" +
+ " \n" +
+ " public static void main(String[] args) {\n" +
+ " A a = new A();\n" +
+ " System.out.println(a);\n" +
+ " }\n" +
+ "}\n";
+ createFile(bPath, bSource);
+ createFile("B/src/module-info.java",
+ "open module com.a.b {\n" +
+ " requires com.a;\n" +
+ "}\n");
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ assertNoErrors();
+
+ this.problemRequestor.initialize(bSource.toCharArray());
+ getCompilationUnit(bPath).getWorkingCopy(this.wcOwner, null);
+ assertProblems("unexpected problems",
+ "----------\n" +
+ "----------\n",
+ this.problemRequestor);
+ } finally {
+ deleteProject(prjA);
+ deleteProject(prjB);
+ }
+ }
+
public void testReleaseOption1() throws Exception {
Hashtable<String, String> options = JavaCore.getOptions();
IJavaProject p = createJava9Project("p");
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
index 16166b5a8d..7c7f99d85c 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests9.java
@@ -570,4 +570,83 @@ public void testBug543092b() throws Exception {
deleteProject(p);
}
}
+public void testBug544017() throws CoreException {
+ if (!isJRE9) {
+ System.err.println("Test "+getName()+" requires a JRE 9");
+ return;
+ }
+ IJavaProject testa = createJava9Project("testa");
+ IJavaProject testb = createJava9Project("testb");
+ IJavaProject testmain = createJava9Project("testmain");
+ try {
+ createFolder("testb/src/com/example/sub/b");
+ createFile("testb/src/com/example/sub/b/B.java",
+ "package com.example.sub.b;\n" +
+ "public class B {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"B\");\n" +
+ " }\n" +
+ "}\n");
+ createFile("testb/src/module-info.java",
+ "open module com.example.sub.b {\n" +
+ " exports com.example.sub.b;\n" +
+ "}\n");
+
+ addModularProjectEntry(testa, testb);
+ createFolder("testa/src/com/example/sub/a");
+ createFile("testa/src/com/example/sub/a/A.java",
+ "package com.example.sub.a;\n" +
+ "public class A {\n" +
+ " public static void main(String[] args) {\n" +
+ " System.out.println(\"A\");\n" +
+ " }\n" +
+ "}\n");
+ createFile("testa/src/module-info.java",
+ "open module com.example.sub.a {\n" +
+ " exports com.example.sub.a;\n" +
+ " requires com.example.sub.b;\n" +
+ "}\n");
+
+ addModularProjectEntry(testmain, testa);
+ addModularProjectEntry(testmain, testb);
+ createFolder("testmain/src/com/example");
+ createFile("testmain/src/module-info.java",
+ "open module com.example {\n" +
+ " requires com.example.sub.a;\n" +
+ " requires com.example.sub.b;\n" +
+ "}\n");
+ String pathExample = "testmain/src/com/example/Example.java";
+ String sourceExample =
+ "package com.example;\n" +
+ "import com.example.sub.a.A;\n" +
+ "import com.example.sub.b.B;\n" +
+ "\n" +
+ "public class Example {\n" +
+ " public static void main(String[] args) {\n" +
+ " A.main(null);\n" +
+ " B.main(null);\n" +
+ " }\n" +
+ "}\n";
+ createFile(pathExample, sourceExample);
+
+ getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ IMarker[] markers = testmain.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE);
+ assertMarkers("markers in testmain",
+ "",
+ markers);
+
+ ICompilationUnit wc = getCompilationUnit(pathExample).getWorkingCopy(this.wcOwner, null);
+ wc.getBuffer().append(" ");
+ this.problemRequestor.initialize((sourceExample+" ").toCharArray());
+ wc.reconcile(AST_INTERNAL_JLS11, true, this.wcOwner, null);
+ assertProblems("Expecting no problems",
+ "----------\n" +
+ "----------\n",
+ this.problemRequestor);
+ } finally {
+ deleteProject(testa);
+ deleteProject(testb);
+ deleteProject(testmain);
+ }
+}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java
index 1057346ead..58791869f0 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingModuleDeclarationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 IBM Corporation and others.
+ * Copyright (c) 2017, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -364,4 +364,37 @@ public class ASTRewritingModuleDeclarationTest extends ASTRewritingTest {
}
}
+ public void testBug542106_since_9() throws Exception {
+ IJavaProject javaProject = null;
+ try {
+ javaProject = createProject("P_9", JavaCore.VERSION_9);
+ IPackageFragmentRoot currentSourceFolder = getPackageFragmentRoot("P_9", "src");
+ IPackageFragment pack1= currentSourceFolder.getPackageFragment(Util.EMPTY_STRING);
+ String content =
+ "import java.util.*;\n" +
+ "import java.util.function.Consumer;\n" +
+ "module first {\n" +
+ "}";
+ ICompilationUnit cu= pack1.createCompilationUnit("module-info.java", content, false, null);
+ CompilationUnit astRoot= createAST(cu);
+ ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
+ AST ast= astRoot.getAST();
+ ListRewrite listRewrite = rewrite.getListRewrite(astRoot, CompilationUnit.IMPORTS_PROPERTY);
+ {
+ listRewrite.remove((ImportDeclaration) astRoot.imports().get(0), null);
+ ImportDeclaration newImport = ast.newImportDeclaration();
+ newImport.setName(ast.newName("java.io.Serializable"));
+ listRewrite.insertFirst(newImport, null);
+ }
+ String preview= evaluateRewrite(cu, rewrite);
+ content =
+ "import java.io.Serializable;\n" +
+ "import java.util.function.Consumer;\n" +
+ "module first {\n" +
+ "}";
+ assertEqualString(preview, content);
+ } finally {
+ if (javaProject != null) deleteProject(javaProject);
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/A_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/A_out.java
new file mode 100644
index 0000000000..a41e1d02a8
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/A_out.java
@@ -0,0 +1,15 @@
+class C {
+ void f() {
+ return argument ? 100000 : 200000;
+ boolean someValue1 = condition1() ? value1
+ : condition2() ? value2 : condition3 ? value3 : value4;
+ boolean someValue2 = condition1() ? value1
+ : (condition2() ? value2 : condition3 ? value3 : value4);
+ boolean otherValue1 = condition1
+ ? condition2 ? condition3 ? value4 : value3 : value2
+ : value1;
+ boolean otherValue2 = condition1
+ ? (condition2 ? condition3 ? value4 : value3 : value2)
+ : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/B_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/B_out.java
new file mode 100644
index 0000000000..fb351ad9d6
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/B_out.java
@@ -0,0 +1,15 @@
+class C {
+ void f() {
+ return argument ? 100000 : 200000;
+ boolean someValue1 = condition1() ? value1 : condition2() ? value2
+ : condition3 ? value3 : value4;
+ boolean someValue2 = condition1() ? value1
+ : (condition2() ? value2 : condition3 ? value3 : value4);
+ boolean otherValue1 = condition1
+ ? condition2 ? condition3 ? value4 : value3 : value2
+ : value1;
+ boolean otherValue2 = condition1
+ ? (condition2 ? condition3 ? value4 : value3 : value2)
+ : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/C_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/C_out.java
new file mode 100644
index 0000000000..d73ac71267
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/C_out.java
@@ -0,0 +1,17 @@
+class C {
+ void f() {
+ return argument ? 100000 : 200000;
+ boolean someValue1 = condition1() ? value1
+ : condition2() ? value2
+ : condition3 ? value3
+ : value4;
+ boolean someValue2 = condition1() ? value1
+ : (condition2() ? value2 : condition3 ? value3 : value4);
+ boolean otherValue1 = condition1
+ ? condition2 ? condition3 ? value4 : value3 : value2
+ : value1;
+ boolean otherValue2 = condition1
+ ? (condition2 ? condition3 ? value4 : value3 : value2)
+ : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/D_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/D_out.java
new file mode 100644
index 0000000000..3d4217839c
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/D_out.java
@@ -0,0 +1,19 @@
+class C {
+ void f() {
+ return argument ? 100000 : 200000;
+ boolean someValue1 = condition1() ? value1
+ : condition2() ? value2
+ : condition3 ? value3
+ : value4;
+ boolean someValue2 = condition1() ? value1
+ : (condition2() ? value2
+ : condition3 ? value3
+ : value4);
+ boolean otherValue1 = condition1
+ ? condition2 ? condition3 ? value4 : value3 : value2
+ : value1;
+ boolean otherValue2 = condition1
+ ? (condition2 ? condition3 ? value4 : value3 : value2)
+ : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/E_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/E_out.java
new file mode 100644
index 0000000000..8687c40352
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/E_out.java
@@ -0,0 +1,35 @@
+class C {
+ void f() {
+ return argument
+ ? 100000
+ : 200000;
+ boolean someValue1 = condition1()
+ ? value1
+ : condition2()
+ ? value2
+ : condition3
+ ? value3
+ : value4;
+ boolean someValue2 = condition1()
+ ? value1
+ : (condition2()
+ ? value2
+ : condition3
+ ? value3
+ : value4);
+ boolean otherValue1 = condition1
+ ? condition2
+ ? condition3
+ ? value4
+ : value3
+ : value2
+ : value1;
+ boolean otherValue2 = condition1
+ ? (condition2
+ ? condition3
+ ? value4
+ : value3
+ : value2)
+ : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/F_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/F_out.java
new file mode 100644
index 0000000000..34bdfc122d
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/F_out.java
@@ -0,0 +1,35 @@
+class C {
+ void f() {
+ return argument
+ ? 100000
+ : 200000;
+ boolean someValue1 = condition1()
+ ? value1
+ : condition2()
+ ? value2
+ : condition3
+ ? value3
+ : value4;
+ boolean someValue2 = condition1()
+ ? value1
+ : (condition2()
+ ? value2
+ : condition3
+ ? value3
+ : value4);
+ boolean otherValue1 = condition1
+ ? condition2
+ ? condition3
+ ? value4
+ : value3
+ : value2
+ : value1;
+ boolean otherValue2 = condition1
+ ? (condition2
+ ? condition3
+ ? value4
+ : value3
+ : value2)
+ : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/G_out.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/G_out.java
new file mode 100644
index 0000000000..47713f69e9
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/G_out.java
@@ -0,0 +1,35 @@
+class C {
+ void f() {
+ return argument
+ ? 100000
+ : 200000;
+ boolean someValue1 = condition1()
+ ? value1
+ : condition2()
+ ? value2
+ : condition3
+ ? value3
+ : value4;
+ boolean someValue2 = condition1()
+ ? value1
+ : (condition2()
+ ? value2
+ : condition3
+ ? value3
+ : value4);
+ boolean otherValue1 = condition1
+ ? condition2
+ ? condition3
+ ? value4
+ : value3
+ : value2
+ : value1;
+ boolean otherValue2 = condition1
+ ? (condition2
+ ? condition3
+ ? value4
+ : value3
+ : value2)
+ : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/in.java b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/in.java
new file mode 100644
index 0000000000..8bb256b4c0
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/workspace/Formatter/test541011/in.java
@@ -0,0 +1,9 @@
+class C {
+ void f() {
+ return argument ? 100000 : 200000;
+ boolean someValue1 = condition1() ? value1 : condition2() ? value2 : condition3 ? value3 : value4;
+ boolean someValue2 = condition1() ? value1 : (condition2() ? value2 : condition3 ? value3 : value4);
+ boolean otherValue1 = condition1 ? condition2 ? condition3 ? value4 : value3 : value2 : value1;
+ boolean otherValue2 = condition1 ? (condition2 ? condition3 ? value4 : value3 : value2) : value1;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
index 2234257ab2..26e1fc9595 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -191,7 +191,7 @@ public class Main implements ProblemSeverities, SuffixConstants {
private static final String INFO = "INFO"; //$NON-NLS-1$
public static final int XML = 1;
- private static final String XML_DTD_DECLARATION = "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.005 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_005.dtd\">"; //$NON-NLS-1$
+ private static final String XML_DTD_DECLARATION = "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.006 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_006.dtd\">"; //$NON-NLS-1$
static {
try {
Class<?> c = IProblem.class;
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
index c02926b66d..37a2143e9d 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties
@@ -66,7 +66,7 @@ configure.duplicateTarget = duplicate target compliance setting specification: {
configure.unsupportedReleaseOption = option --release is supported only when run with JDK 9 or above
configure.unsupportedWithRelease = option {0} is not supported when --release is used
configure.unsupportedReleaseVersion = release version {0} is not supported
-configure.source = source level should be comprised in between ''1.3'' and ''1.9'' (or ''5'', ''5.0'', ..., ''9'' or ''9.0''): {0}
+configure.source = source level should be in ''1.1''...''1.8'',''9''...''11'' (or ''5.0''..''11.0''): {0}
configure.invalidSystem = invalid location for system libraries: {0}
configure.unsupportedOption = option {0} not supported at compliance level 9 and above
configure.duplicateOutputPath = duplicate output path specification: {0}
@@ -83,7 +83,7 @@ configure.invalidDebugOption = invalid debug option: {0}
configure.invalidWarningConfiguration = invalid warning configuration: ''{0}''
configure.invalidWarning = invalid warning token: ''{0}''. Ignoring warning and compiling
configure.invalidWarningOption = invalid warning option: ''{0}''. Must specify a warning token
-configure.targetJDK = target level should be comprised in between ''1.1'' and ''1.9'' (or ''5'', ''5.0'', ..., ''9'' or ''9.0'') or cldc1.1: {0}
+configure.targetJDK = target level should be in ''1.1''...''1.8'',''9''...''11'' (or ''5.0''..''11.0'') or cldc1.1: {0}
configure.incompatibleTargetForSource = Target level ''{0}'' is incompatible with source level ''{1}''. A target level ''{1}'' or better is required
configure.incompatibleTargetForGenericSource = Target level ''{0}'' is incompatible with source level ''{1}''. A source level ''1.5'' or better is required
configure.incompatibleComplianceForSource = Compliance level ''{0}'' is incompatible with source level ''{1}''. A compliance level ''{1}'' or better is required
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
index 099d883256..ba6cc119a2 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java
@@ -26,6 +26,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -50,6 +51,7 @@ import org.eclipse.jdt.core.WorkingCopyOwner;
import org.eclipse.jdt.core.compiler.CategorizedProblem;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
@@ -57,9 +59,10 @@ import org.eclipse.jdt.core.search.SearchMatch;
import org.eclipse.jdt.core.search.SearchParticipant;
import org.eclipse.jdt.core.search.SearchPattern;
import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.internal.codeassist.complete.AssistNodeParentAnnotationArrayInitializer;
+import org.eclipse.jdt.internal.codeassist.complete.CompletionJavadoc;
import org.eclipse.jdt.internal.codeassist.complete.CompletionNodeDetector;
import org.eclipse.jdt.internal.codeassist.complete.CompletionNodeFound;
-import org.eclipse.jdt.internal.codeassist.complete.AssistNodeParentAnnotationArrayInitializer;
import org.eclipse.jdt.internal.codeassist.complete.CompletionOnAnnotationOfType;
import org.eclipse.jdt.internal.codeassist.complete.CompletionOnArgumentName;
import org.eclipse.jdt.internal.codeassist.complete.CompletionOnBranchStatementLabel;
@@ -2234,7 +2237,8 @@ public final class CompletionEngine
}
}
}
-
+ // javadoc tag completion in module-info file
+ contextAccepted = completeJavadocTagInModuleInfo(parsedUnit);
if (parsedUnit.types != null) {
try {
this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
@@ -2337,6 +2341,43 @@ public final class CompletionEngine
}
}
+ private boolean completeJavadocTagInModuleInfo(CompilationUnitDeclaration parsedUnit) {
+ boolean contextAccepted = false;
+ if (this.parser.assistNodeParent instanceof CompletionJavadoc && parsedUnit.isModuleInfo() ) {
+ try {
+ this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
+ if(this.parser.assistNode instanceof CompletionOnJavadocTag) {
+ ((CompletionOnJavadocTag)this.parser.assistNode).filterPossibleTags(parsedUnit.scope);
+ }
+ throw new CompletionNodeFound(this.parser.assistNode, null, parsedUnit.scope);
+ }
+ catch (CompletionNodeFound e) {
+ if (e.astNode != null) {
+ // if null then we found a problem in the completion node
+ if(DEBUG) {
+ System.out.print("COMPLETION - Completion node : "); //$NON-NLS-1$
+ System.out.println(e.astNode.toString());
+ if(this.parser.assistNodeParent != null) {
+ System.out.print("COMPLETION - Parent Node : "); //$NON-NLS-1$
+ System.out.println(this.parser.assistNodeParent);
+ }
+ }
+ this.lookupEnvironment.unitBeingCompleted = parsedUnit; // better resilient to further error reporting
+ contextAccepted =
+ complete(
+ e.astNode,
+ this.parser.assistNodeParent,
+ this.parser.enclosingNode,
+ parsedUnit,
+ e.qualifiedBinding,
+ e.scope,
+ e.insideTypeAnnotation);
+ }
+ }
+ }
+ return contextAccepted;
+ }
+
private boolean checkForCNF(TypeReference ref, CompilationUnitDeclaration parsedUnit, boolean showAll) {
this.lookupEnvironment.buildTypeBindings(parsedUnit, null);
this.lookupEnvironment.completeTypeBindings(parsedUnit, true);
@@ -5313,7 +5354,16 @@ public final class CompletionEngine
proposal.setDeclarationSignature(getSignature(method.declaringClass));
proposal.setSignature(getSignature(method.returnType));
proposal.setName(method.selector);
- proposal.setCompletion(method.selector);
+ // add "=" to completion since it will always be needed
+ char[] completion= method.selector;
+ if (JavaCore.INSERT.equals(this.javaProject.getOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, true))) {
+ completion= CharOperation.concat(completion, new char[] {' '});
+ }
+ completion= CharOperation.concat(completion, new char[] {'='});
+ if (JavaCore.INSERT.equals(this.javaProject.getOption(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, true))) {
+ completion= CharOperation.concat(completion, new char[] {' '});
+ }
+ proposal.setCompletion(completion);
proposal.setFlags(method.modifiers);
proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java
index 15215c711d..b620240aec 100644
--- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java
+++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java
@@ -86,8 +86,12 @@ public class CompletionOnJavadocTag extends JavadocSingleNameReference implement
switch (kind) {
case Scope.COMPILATION_UNIT_SCOPE:
// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=255752
- // Check for FAKE_TYPE_NAME to allow proposals (@see CompletionParser#consumeCompilationUnit)
+ // Check for FAKE_TYPE_NAME to allow proposals (@see CompletionParser#consumeCompilationUnit)
CompilationUnitDeclaration compilationUnit = scope.referenceCompilationUnit();
+ if(compilationUnit != null && compilationUnit.isModuleInfo() ) {
+ specifiedTags = MODULE_TAGS;
+ break;
+ }
if (compilationUnit != null &&
(compilationUnit.types.length > 0 && compilationUnit.types[0].name == CompletionParser.FAKE_TYPE_NAME)) {
specifiedTags = CLASS_TAGS;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index 2e7a665500..9ec29d3e13 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -517,7 +517,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
* An access in the same compilation unit is allowed.
*/
public final boolean isMethodUseDeprecated(MethodBinding method, Scope scope,
- boolean isExplicitUse) {
+ boolean isExplicitUse, InvocationSite invocation) {
// ignore references insing Javadoc comments
if ((this.bits & ASTNode.InsideJavadoc) == 0 && method.isOrEnclosedByPrivateType() && !scope.isDefinedInMethod(method)) {
// ignore cases where method is used from inside itself (e.g. direct recursions)
@@ -534,7 +534,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds {
AccessRestriction restriction =
env.getAccessRestriction(method.declaringClass.erasure());
if (restriction != null) {
- scope.problemReporter().forbiddenReference(method, this,
+ scope.problemReporter().forbiddenReference(method, invocation,
restriction.classpathEntryType, restriction.classpathEntryName,
restriction.getProblemId());
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
index 7710fcfdee..d53c24f175 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java
@@ -503,7 +503,7 @@ public TypeBinding resolveType(BlockScope scope) {
if ((this.binding.tagBits & TagBits.HasMissingType) != 0) {
scope.problemReporter().missingTypeInConstructor(this, this.binding);
}
- if (isMethodUseDeprecated(this.binding, scope, true)) {
+ if (isMethodUseDeprecated(this.binding, scope, true, this)) {
scope.problemReporter().deprecatedMethod(this.binding, this);
}
if (checkInvocationArguments(scope, null, this.resolvedType, this.binding, this.arguments, this.argumentTypes, this.argsContainCast, this)) {
@@ -809,4 +809,12 @@ public ExpressionContext getExpressionContext() {
public InferenceContext18 freshInferenceContext(Scope scope) {
return new InferenceContext18(scope, this.arguments, this, this.outerInferenceContext);
}
+@Override
+public int nameSourceStart() {
+ return this.type.sourceStart;
+}
+@Override
+public int nameSourceEnd() {
+ return this.type.sourceEnd;
+}
} \ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
index c3bbd55075..bdf1ed81fe 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -936,10 +936,13 @@ public class EqualExpression extends BinaryExpression {
if (unnecessaryLeftCast || unnecessaryRightCast) {
TypeBinding alternateLeftType = unnecessaryLeftCast ? ((CastExpression)this.left).expression.resolvedType : leftType;
TypeBinding alternateRightType = unnecessaryRightCast ? ((CastExpression)this.right).expression.resolvedType : rightType;
- if (checkCastTypesCompatibility(scope, alternateLeftType, alternateRightType, null)
- || checkCastTypesCompatibility(scope, alternateRightType, alternateLeftType, null)) {
- if (unnecessaryLeftCast) scope.problemReporter().unnecessaryCast((CastExpression)this.left);
- if (unnecessaryRightCast) scope.problemReporter().unnecessaryCast((CastExpression)this.right);
+ // Bug 543727 - check if either cast is really needed
+ if (!isCastNeeded(alternateLeftType, alternateRightType)) {
+ if (checkCastTypesCompatibility(scope, alternateLeftType, alternateRightType, null)
+ || checkCastTypesCompatibility(scope, alternateRightType, alternateLeftType, null)) {
+ if (unnecessaryLeftCast) scope.problemReporter().unnecessaryCast((CastExpression)this.left);
+ if (unnecessaryRightCast) scope.problemReporter().unnecessaryCast((CastExpression)this.right);
+ }
}
}
// check whether comparing identical expressions
@@ -955,6 +958,20 @@ public class EqualExpression extends BinaryExpression {
scope.problemReporter().notCompatibleTypesError(this, leftType, rightType);
return null;
}
+
+ private boolean isCastNeeded(TypeBinding leftType, TypeBinding rightType) {
+ // Bug 543727 - if either type is parameterized and the other is a base type,
+ // a cast is necessary, even if boxing the base type will result in a compatible
+ // type.
+ if (leftType.isParameterizedType()) {
+ return rightType.isBaseType();
+ }
+ if (rightType.isParameterizedType()) {
+ return leftType.isBaseType();
+ }
+ return false;
+ }
+
@Override
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
index 0553640750..de4fc80b4d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -446,7 +446,7 @@ public class ExplicitConstructorCall extends Statement implements Invocation {
scope.problemReporter().missingTypeInConstructor(this, this.binding);
}
}
- if (isMethodUseDeprecated(this.binding, scope, this.accessMode != ExplicitConstructorCall.ImplicitSuper)) {
+ if (isMethodUseDeprecated(this.binding, scope, this.accessMode != ExplicitConstructorCall.ImplicitSuper, this)) {
scope.problemReporter().deprecatedMethod(this.binding, this);
}
if (checkInvocationArguments(scope, null, receiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this)) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java
index 7b69cf564b..d0c1c6d56a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -144,7 +144,7 @@ public class JavadocAllocationExpression extends AllocationExpression {
}
}
}
- if (isMethodUseDeprecated(this.binding, scope, true)) {
+ if (isMethodUseDeprecated(this.binding, scope, true, this)) {
scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers());
}
return allocationType;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java
index a1988de9bf..4fdc64dc71 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -172,7 +172,7 @@ public class JavadocMessageSend extends MessageSend {
}
}
}
- if (isMethodUseDeprecated(this.binding, scope, true)) {
+ if (isMethodUseDeprecated(this.binding, scope, true, this)) {
scope.problemReporter().javadocDeprecatedMethod(this.binding, this, scope.getDeclarationModifiers());
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
index 08067d8306..b252d45f42 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
@@ -481,6 +481,8 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
if (expected.isParameterizedType() && argument.isParameterizedType()) {
TypeBinding[] expectedArgs = ((ParameterizedTypeBinding)expected).typeArguments();
TypeBinding[] args = ((ParameterizedTypeBinding)argument).typeArguments();
+ if (args.length != expectedArgs.length)
+ return false;
for (int j = 0; j < args.length; j++) {
if (TypeBinding.notEquals(expectedArgs[j], args[j])) {
if (expectedArgs[j].isWildcard() && args[j].isUnboundWildcard()) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index 2421cfb906..2e52f5a05e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -898,7 +898,7 @@ public TypeBinding resolveType(BlockScope scope) {
}
// abstract private methods cannot occur nor abstract static............
}
- if (isMethodUseDeprecated(this.binding, scope, true))
+ if (isMethodUseDeprecated(this.binding, scope, true, this))
scope.problemReporter().deprecatedMethod(this.binding, this);
TypeBinding returnType;
@@ -1171,4 +1171,12 @@ public InferenceContext18 freshInferenceContext(Scope scope) {
public boolean isQualifiedSuper() {
return this.receiver.isQualifiedSuper();
}
+@Override
+public int nameSourceStart() {
+ return (int) (this.nameSourcePosition >>> 32);
+}
+@Override
+public int nameSourceEnd() {
+ return (int) this.nameSourcePosition;
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
index c81cf482ef..2a2aa534f1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java
@@ -301,6 +301,7 @@ public class ModuleDeclaration extends ASTNode implements ReferenceContext {
Map<String, Set<ModuleBinding>> pack2mods = new HashMap<>();
for (ModuleBinding requiredModule : this.binding.getAllRequiredModules()) {
for (PackageBinding exportedPackage : requiredModule.getExports()) {
+ exportedPackage = exportedPackage.getVisibleFor(requiredModule, true);
if (this.binding.canAccess(exportedPackage)) {
String packName = String.valueOf(exportedPackage.readableName());
Set<ModuleBinding> mods = pack2mods.get(packName);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
index bed5d38c3f..bd4ba12a44 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -561,7 +561,7 @@ public class QualifiedAllocationExpression extends AllocationExpression {
ReferenceBinding receiver = (ReferenceBinding) receiverType;
ReferenceBinding superType = receiver.isInterface() ? scope.getJavaLangObject() : receiver;
if (constructorBinding.isValidBinding()) {
- if (isMethodUseDeprecated(constructorBinding, scope, true)) {
+ if (isMethodUseDeprecated(constructorBinding, scope, true, this)) {
scope.problemReporter().deprecatedMethod(constructorBinding, this);
}
if (checkInvocationArguments(scope, null, superType, constructorBinding, this.arguments,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
index c7e4eb8909..d6d044c7a5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -799,7 +799,7 @@ public class ReferenceExpression extends FunctionalExpression implements IPolyEx
srcMethod.bits &= ~ASTNode.CanBeStatic;
}
- if (isMethodUseDeprecated(this.binding, scope, true))
+ if (isMethodUseDeprecated(this.binding, scope, true, this))
scope.problemReporter().deprecatedMethod(this.binding, this);
if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
index 6510e346c9..8c298b9264 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -341,6 +341,16 @@ public boolean isSubtypeOf(TypeBinding otherType, boolean simulatingBugJDK802652
return false;
}
return true;
+ case Binding.TYPE_PARAMETER:
+ // check compatibility with capture of ? super X
+ if (otherType.isCapture()) {
+ CaptureBinding otherCapture = (CaptureBinding) otherType;
+ TypeBinding otherLowerBound;
+ if ((otherLowerBound = otherCapture.lowerBound) != null) {
+ if (!otherLowerBound.isArrayType()) return false;
+ return isSubtypeOf(otherLowerBound, simulatingBugJDK8026527);
+ }
+ }
}
switch (otherType.leafComponentType().id) {
case TypeIds.T_JavaLangObject :
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
index 6c4cb11224..080b8f8a89 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
@@ -61,6 +61,11 @@ public class BinaryModuleBinding extends ModuleBinding {
public char[] nameForLookup() {
return ANY_NAMED;
}
+
+ @Override
+ public char[] nameForCUCheck() {
+ return this.moduleName;
+ }
}
private IPackageExport[] unresolvedExports;
@@ -108,7 +113,7 @@ public class BinaryModuleBinding extends ModuleBinding {
}
// TODO(SHMOD): handle null case
}
- if (count < this.requiresTransitive.length)
+ if (count < this.requires.length)
System.arraycopy(this.requires, 0, this.requires = new ModuleBinding[count], 0, count);
if (transitiveCount < this.requiresTransitive.length)
System.arraycopy(this.requiresTransitive, 0, this.requiresTransitive = new ModuleBinding[transitiveCount], 0, transitiveCount);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
index 0199eae16c..8993942d9b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java
@@ -213,7 +213,6 @@ void checkAndSetImports() {
if (this.referenceContext.moduleDeclaration != null) {
this.referenceContext.moduleDeclaration.resolveModuleDirectives(this);
- this.referenceContext.moduleDeclaration.resolvePackageDirectives(this);
}
if (this.referenceContext.imports == null) {
@@ -512,6 +511,7 @@ void faultInImports() {
public void faultInTypes() {
faultInImports();
if (this.referenceContext.moduleDeclaration != null) {
+ this.referenceContext.moduleDeclaration.resolvePackageDirectives(this);
this.referenceContext.moduleDeclaration.resolveTypeDirectives(this);
} else if (this.referenceContext.currentPackage != null) {
this.referenceContext.currentPackage.checkPackageConflict(this);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
index ce262d4ad0..649ff04324 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -217,6 +217,27 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
public boolean isSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527) {
if (TypeBinding.equalsEquals(this, other))
return true;
+ if (other instanceof ReferenceBinding) {
+ TypeBinding[] rightIntersectingTypes = ((ReferenceBinding) other).getIntersectingTypes();
+ if (rightIntersectingTypes != null && rightIntersectingTypes.length > 1) {
+ int numRequired = rightIntersectingTypes.length;
+ TypeBinding[] required = new TypeBinding[numRequired];
+ System.arraycopy(rightIntersectingTypes, 0, required, 0, numRequired);
+ for (int i = 0; i < this.length; i++) {
+ TypeBinding provided = this.intersectingTypes[i];
+ for (int j = 0; j < required.length; j++) {
+ if (required[j] == null) continue;
+ if (provided.isSubtypeOf(required[j], simulatingBugJDK8026527)) {
+ required[j] = null;
+ if (--numRequired == 0)
+ return true;
+ break;
+ }
+ }
+ }
+ return false;
+ }
+ }
for (int i = 0; i < this.intersectingTypes.length; i++) {
if (this.intersectingTypes[i].isSubtypeOf(other, false))
return true;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
index 8513fed83b..aa57e1214e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InvocationSite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -34,6 +34,8 @@ public interface InvocationSite {
void setFieldIndex(int depth);
int sourceEnd();
int sourceStart();
+ default int nameSourceStart() { return sourceStart(); }
+ default int nameSourceEnd() { return sourceEnd(); }
TypeBinding invocationTargetType();
boolean receiverIsImplicitThis();
boolean checkingPotentialCompatibility();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
index 66e02b7a3c..3b31a807a4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ModuleBinding.java
@@ -443,6 +443,13 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
}
/**
+ * Answer the name of this module as it should be used for hasCompilationUnit() checks.
+ */
+ public char[] nameForCUCheck() {
+ return nameForLookup();
+ }
+
+ /**
* Check if the specified package is owned by the current module and exported to the client module.
* True if the package appears in the list of exported packages and when the export is targeted,
* the module appears in the targets of the exports statement.
@@ -506,7 +513,7 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
// remember:
if (binding != null) {
this.environment.knownPackages.put(name, binding);
- binding = addPackage(binding, false);
+ binding = addPackage(binding, false); // no further lookup needed, binding is already complete (split?)
} else {
this.environment.knownPackages.put(name, LookupEnvironment.TheNotFoundPackage);
}
@@ -557,8 +564,16 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
declaringModuleNames = moduleEnv.getUniqueModulesDeclaringPackage(parentName, name, nameForLookup());
if (declaringModuleNames != null) {
if (CharOperation.containsEqual(declaringModuleNames, this.moduleName)) {
- // declared here, not yet known, so create it now:
- binding = new PackageBinding(subPkgCompoundName, parent, this.environment, this);
+ if (parent instanceof SplitPackageBinding) {
+ // parent.getPackage0() may have been too shy, so drill into the split:
+ PackageBinding singleParent = ((SplitPackageBinding) parent).getIncarnation(this);
+ if (singleParent != null)
+ binding = singleParent.getPackage0(name);
+ }
+ if (binding == null) {
+ // declared here, not yet known, so create it now:
+ binding = new PackageBinding(subPkgCompoundName, parent, this.environment, this);
+ }
} else if (considerRequiredModules) {
// visible but foreign (when current is unnamed or auto):
for (char[] declaringModuleName : declaringModuleNames) {
@@ -588,6 +603,8 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
// enrich with split-siblings from visible modules:
if (considerRequiredModules) {
+ if (parent != null && binding != null)
+ parent.addPackage(binding, this); // preliminarily add to avoid creating duplicates, will be updated below
binding = combineWithPackagesFromOtherRelevantModules(binding, subPkgCompoundName, declaringModuleNames);
}
if (binding == null || !binding.isValidBinding()) {
@@ -600,10 +617,13 @@ public class ModuleBinding extends Binding implements IUpdatableModule {
return null;
}
// remember
- if (parentName.length == 0)
+ if (parentName.length == 0) {
binding.environment.knownPackages.put(name, binding);
- else if (parent != null)
+ } else if (parent != null) {
binding = parent.addPackage(binding, this);
+ }
+ if (packageMayBeIncomplete)
+ return binding;
return addPackage(binding, false);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
index 4054281c71..33a2218c93 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/PackageBinding.java
@@ -442,13 +442,13 @@ public PackageBinding getVisibleFor(ModuleBinding module, boolean preferLocal) {
public boolean hasCompilationUnit(boolean checkCUs) {
if (this.knownTypes != null) {
for (ReferenceBinding knownType : this.knownTypes.valueTable) {
- if (knownType != null && knownType != LookupEnvironment.TheNotFoundType)
+ if (knownType != null && knownType != LookupEnvironment.TheNotFoundType && !knownType.isUnresolvedType())
return true;
}
}
if (this.environment.useModuleSystem) {
IModuleAwareNameEnvironment moduleEnv = (IModuleAwareNameEnvironment) this.environment.nameEnvironment;
- return moduleEnv.hasCompilationUnit(this.compoundName, this.enclosingModule.nameForLookup(), checkCUs);
+ return moduleEnv.hasCompilationUnit(this.compoundName, this.enclosingModule.nameForCUCheck(), checkCUs);
}
return false;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
index 36096a7365..373a684717 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
@@ -613,6 +613,10 @@ public class JavadocParser extends AbstractCommentParser {
valid = parseParam();
}
}
+ if (length == TAG_PROVIDES_LENGTH && CharOperation.equals(TAG_PROVIDES, tagName, 0, length)) {
+ this.tagValue = TAG_PROVIDES_VALUE;
+ this.tagWaitingForDescription = this.tagValue;
+ }
break;
case 'r':
if (length == TAG_RETURN_LENGTH && CharOperation.equals(TAG_RETURN, tagName, 0, length)) {
@@ -653,6 +657,12 @@ public class JavadocParser extends AbstractCommentParser {
}
}
break;
+ case 'u':
+ if (length == TAG_USES_LENGTH && CharOperation.equals(TAG_USES, tagName, 0, length)) {
+ this.tagValue = TAG_USES_VALUE;
+ this.tagWaitingForDescription = this.tagValue;
+ }
+ break;
case 'v':
if (length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName, 0, length)) {
this.tagValue = TAG_VALUE_VALUE;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
index d4e110de99..1e92374e21 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
@@ -49,6 +49,8 @@ public interface JavadocTagConstants {
public static final char[] TAG_VERSION = "version".toCharArray(); //$NON-NLS-1$
public static final char[] TAG_CATEGORY = "category".toCharArray(); //$NON-NLS-1$
public static final char[] TAG_SYSTEM_PROPERTY = "systemProperty".toCharArray(); //$NON-NLS-1$
+ public static final char[] TAG_USES = "uses".toCharArray(); //$NON-NLS-1$
+ public static final char[] TAG_PROVIDES = "provides".toCharArray(); //$NON-NLS-1$
// tags lengthes
public static final int TAG_DEPRECATED_LENGTH = TAG_DEPRECATED.length;
@@ -72,6 +74,8 @@ public interface JavadocTagConstants {
public static final int TAG_LITERAL_LENGTH = TAG_LITERAL.length;
public static final int TAG_DOC_ROOT_LENGTH = TAG_DOC_ROOT.length;
public static final int TAG_SYSTEM_PROPERTY_LENGTH = TAG_SYSTEM_PROPERTY.length;
+ public static final int TAG_USES_LENGTH = TAG_USES.length;
+ public static final int TAG_PROVIDES_LENGTH = TAG_PROVIDES.length;
// tags value
public static final int NO_TAG_VALUE = 0;
@@ -96,6 +100,8 @@ public interface JavadocTagConstants {
public static final int TAG_LITERAL_VALUE = 19;
public static final int TAG_DOC_ROOT_VALUE = 20;
public static final int TAG_SYSTEM_PROPERTY_VALUE=21;
+ public static final int TAG_USES_VALUE=21;
+ public static final int TAG_PROVIDES_VALUE=22;
public static final int TAG_OTHERS_VALUE = 100;
// Tag names array
public static final char[][] TAG_NAMES = {
@@ -160,7 +166,7 @@ public interface JavadocTagConstants {
// since 1.8
{},
// since 9
- {},
+ {TAG_USES, TAG_PROVIDES},
// since 10
{},
// since 11
@@ -295,4 +301,21 @@ public interface JavadocTagConstants {
TAG_LITERAL,
TAG_SYSTEM_PROPERTY
};
+ public static final char[][] MODULE_TAGS = {
+ TAG_SEE,
+ TAG_SINCE,
+ TAG_DEPRECATED,
+ TAG_SERIAL,
+ TAG_AUTHOR,
+ TAG_VERSION,
+ TAG_CATEGORY,
+ TAG_LINK,
+ TAG_LINKPLAIN,
+ TAG_DOC_ROOT,
+ TAG_VALUE,
+ TAG_CODE,
+ TAG_LITERAL,
+ TAG_USES,
+ TAG_PROVIDES
+ };
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index a761f81770..d9361bf5db 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -2462,7 +2462,7 @@ public void forbiddenReference(FieldBinding field, ASTNode location,
}
/** @param classpathEntryType one of {@link AccessRestriction#COMMAND_LINE},
* {@link AccessRestriction#LIBRARY}, {@link AccessRestriction#PROJECT} */
-public void forbiddenReference(MethodBinding method, ASTNode location,
+public void forbiddenReference(MethodBinding method, InvocationSite location,
byte classpathEntryType, String classpathEntryName, int problemId) {
int severity = computeSeverity(problemId);
if (severity == ProblemSeverities.Ignore) return;
@@ -2475,8 +2475,8 @@ public void forbiddenReference(MethodBinding method, ASTNode location,
classpathEntryName,
new String(method.shortReadableName())},
severity,
- location.sourceStart,
- location.sourceEnd);
+ location.nameSourceStart(),
+ location.nameSourceEnd());
else
this.handle(
problemId,
@@ -2487,8 +2487,8 @@ public void forbiddenReference(MethodBinding method, ASTNode location,
new String(method.shortReadableName()),
new String(method.declaringClass.shortReadableName())},
severity,
- location.sourceStart,
- location.sourceEnd);
+ location.nameSourceStart(),
+ location.nameSourceEnd());
}
/** @param classpathEntryType one of {@link AccessRestriction#COMMAND_LINE},
* {@link AccessRestriction#LIBRARY}, {@link AccessRestriction#PROJECT} */
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
index b32d738129..db4f964e6a 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java
@@ -1698,19 +1698,23 @@ public final class ASTRewriteAnalyzer extends ASTVisitor {
if (!hasChildrenChanges(node)) {
return doVisitUnchangedChildren(node);
}
-
- if (node.getAST().apiLevel() >= JLS9_INTERNAL && node.getModule() != null) {
- rewriteNode(node, CompilationUnit.MODULE_PROPERTY, 0, ASTRewriteFormatter.NONE);
- return false;
+ int startPos = 0;
+ boolean isModuleInfo = node.getAST().apiLevel() >= JLS9_INTERNAL && node.getModule() != null;
+
+ if (!isModuleInfo) {
+ startPos = rewriteNode(node, CompilationUnit.PACKAGE_PROPERTY, 0, ASTRewriteFormatter.NONE);
+
+ if (getChangeKind(node, CompilationUnit.PACKAGE_PROPERTY) == RewriteEvent.INSERTED) {
+ doTextInsert(0, getLineDelimiter(), getEditGroup(node, CompilationUnit.PACKAGE_PROPERTY));
+ }
}
- int startPos= rewriteNode(node, CompilationUnit.PACKAGE_PROPERTY, 0, ASTRewriteFormatter.NONE);
- if (getChangeKind(node, CompilationUnit.PACKAGE_PROPERTY) == RewriteEvent.INSERTED) {
- doTextInsert(0, getLineDelimiter(), getEditGroup(node, CompilationUnit.PACKAGE_PROPERTY));
+ startPos = rewriteParagraphList(node, CompilationUnit.IMPORTS_PROPERTY, startPos, 0, 0, 2);
+ if (isModuleInfo) {
+ rewriteNode(node, CompilationUnit.MODULE_PROPERTY, startPos, ASTRewriteFormatter.NONE);
+ } else {
+ rewriteParagraphList(node, CompilationUnit.TYPES_PROPERTY, startPos, 0, -1, 2);
}
-
- startPos= rewriteParagraphList(node, CompilationUnit.IMPORTS_PROPERTY, startPos, 0, 0, 2);
- rewriteParagraphList(node, CompilationUnit.TYPES_PROPERTY, startPos, 0, -1, 2);
return false;
}
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
index 2de2f1abcf..1536b4faf0 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetAllocationExpression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -279,7 +279,7 @@ public TypeBinding resolveType(BlockScope scope) {
return this.resolvedType;
}
}
- if (isMethodUseDeprecated(this.binding, scope, true)) {
+ if (isMethodUseDeprecated(this.binding, scope, true, this)) {
scope.problemReporter().deprecatedMethod(this.binding, this);
}
if (this.arguments != null) {
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
index 98d1f8631c..9a00586b24 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -337,7 +337,7 @@ public TypeBinding resolveType(BlockScope scope) {
}
// abstract private methods cannot occur nor abstract static............
}
- if (isMethodUseDeprecated(this.binding, scope, true))
+ if (isMethodUseDeprecated(this.binding, scope, true, this))
scope.problemReporter().deprecatedMethod(this.binding, this);
// from 1.5 compliance on, array#clone() returns the array type (but binding still shows Object)
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
index 4dde0c415e..e2f4edd280 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java
@@ -324,11 +324,25 @@ public class DefaultCodeFormatterConstants {
* - default: createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_DEFAULT)
* </pre>
* @see #createAlignmentValue(boolean, int, int)
+ * @see #FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION_CHAIN
* @since 3.0
*/
public static final String FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION = JavaCore.PLUGIN_ID + ".formatter.alignment_for_conditional_expression"; //$NON-NLS-1$
/**
* <pre>
+ * FORMATTER / Option for alignment of conditional expression chains. If disabled, chains are not recognized
+ * and only {@link #FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION} policy is used instead.
+ * - option id: "org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain"
+ * - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
+ * - default: createAlignmentValue(false, WRAP_NO_SPLIT, INDENT_DEFAULT)
+ * </pre>
+ * @see #createAlignmentValue(boolean, int, int)
+ * @see #FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION
+ * @since 3.17
+ */
+ public static final String FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION_CHAIN = JavaCore.PLUGIN_ID + ".formatter.alignment_for_conditional_expression_chain"; //$NON-NLS-1$
+ /**
+ * <pre>
* FORMATTER / Option for alignment of enum constants
* - option id: "org.eclipse.jdt.core.formatter.alignment_for_enum_constants"
* - possible values: values returned by <code>createAlignmentValue(boolean, int, int)</code> call
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
index 12b0b2f2f0..257f5c53fa 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java
@@ -134,6 +134,7 @@ public class DefaultCodeFormatterOptions {
public int alignment_for_compact_if;
public int alignment_for_compact_loop;
public int alignment_for_conditional_expression;
+ public int alignment_for_conditional_expression_chain;
public int alignment_for_enum_constants;
public int alignment_for_expressions_in_array_initializer;
public int alignment_for_expressions_in_for_loop_header;
@@ -518,6 +519,7 @@ public class DefaultCodeFormatterOptions {
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_IF, getAlignment(this.alignment_for_compact_if));
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_LOOP, getAlignment(this.alignment_for_compact_loop));
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION, getAlignment(this.alignment_for_conditional_expression));
+ options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION_CHAIN, getAlignment(this.alignment_for_conditional_expression_chain));
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS, getAlignment(this.alignment_for_enum_constants));
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER, getAlignment(this.alignment_for_expressions_in_array_initializer));
options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_FOR_LOOP_HEADER, getAlignment(this.alignment_for_expressions_in_for_loop_header));
@@ -965,6 +967,8 @@ public class DefaultCodeFormatterOptions {
this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
}
}
+ setInt(settings, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION_CHAIN,
+ v -> this.alignment_for_conditional_expression_chain = v);
final Object alignmentForEnumConstantsOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS);
if (alignmentForEnumConstantsOption != null) {
try {
@@ -2521,6 +2525,12 @@ public class DefaultCodeFormatterOptions {
* This method is used to handle deprecated preferences which might be replaced by
* one or more preferences.
* Depending on deprecated option handling policy, set the new formatting option(s).
+ * <p>
+ * Note: Also add deprecated preference keys in {@link org.eclipse.jdt.internal.core.JavaCorePreferenceInitializer#initializeDeprecatedOptions}
+ * so that the formatter recognizes those deprecated options when used with project specific formatter profiles.
+ * (see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=544776">Bug 544776</a>)
+ * </p>
+ *
* @param settings the given map
* @deprecated
*/
@@ -2778,6 +2788,7 @@ public class DefaultCodeFormatterOptions {
this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
this.alignment_for_compact_loop = 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_conditional_expression_chain = Alignment.M_NO_ALIGNMENT;
this.alignment_for_enum_constants = Alignment.M_NO_ALIGNMENT;
this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
this.alignment_for_expressions_in_for_loop_header = Alignment.M_NO_ALIGNMENT;
@@ -3127,6 +3138,7 @@ public class DefaultCodeFormatterOptions {
this.alignment_for_compact_if = Alignment.M_COMPACT_SPLIT;
this.alignment_for_compact_loop = Alignment.M_COMPACT_SPLIT;
this.alignment_for_conditional_expression = Alignment.M_NEXT_PER_LINE_SPLIT;
+ this.alignment_for_conditional_expression_chain = Alignment.M_NO_ALIGNMENT;
this.alignment_for_enum_constants = Alignment.M_COMPACT_SPLIT;
this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
this.alignment_for_expressions_in_for_loop_header = Alignment.M_NO_ALIGNMENT;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
index 0d39d3e9ed..5c12e80886 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/linewrap/WrapPreparator.java
@@ -682,16 +682,50 @@ public class WrapPreparator extends ASTVisitor {
@Override
public boolean visit(ConditionalExpression node) {
+ boolean chainsMatter = (this.options.alignment_for_conditional_expression_chain
+ & Alignment.SPLIT_MASK) != Alignment.M_NO_ALIGNMENT;
+ boolean isNextInChain = node.getParent() instanceof ConditionalExpression
+ && node == ((ConditionalExpression) node.getParent()).getElseExpression();
+ boolean isFirstInChain = node.getElseExpression() instanceof ConditionalExpression && !isNextInChain;
boolean wrapBefore = this.options.wrap_before_conditional_operator;
List<Integer> before = wrapBefore ? this.wrapIndexes : this.secondaryWrapIndexes;
List<Integer> after = wrapBefore ? this.secondaryWrapIndexes : this.wrapIndexes;
- before.add(this.tm.firstIndexAfter(node.getExpression(), TokenNameQUESTION));
- before.add(this.tm.firstIndexAfter(node.getThenExpression(), TokenNameCOLON));
- after.add(this.tm.firstIndexIn(node.getThenExpression(), -1));
- after.add(this.tm.firstIndexIn(node.getElseExpression(), -1));
- this.wrapParentIndex = this.tm.lastIndexIn(node.getExpression(), -1);
- this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);
- handleWrap(this.options.alignment_for_conditional_expression);
+ if (!chainsMatter || (!isFirstInChain && !isNextInChain)) {
+ before.add(this.tm.firstIndexAfter(node.getExpression(), TokenNameQUESTION));
+ before.add(this.tm.firstIndexAfter(node.getThenExpression(), TokenNameCOLON));
+ after.add(this.tm.firstIndexIn(node.getThenExpression(), -1));
+ after.add(this.tm.firstIndexIn(node.getElseExpression(), -1));
+ this.wrapParentIndex = this.tm.lastIndexIn(node.getExpression(), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);
+ handleWrap(this.options.alignment_for_conditional_expression);
+
+ } else if (isFirstInChain) {
+ List<ConditionalExpression> chain = new ArrayList<>();
+ chain.add(node);
+ ConditionalExpression next = node;
+ while (next.getElseExpression() instanceof ConditionalExpression) {
+ next = (ConditionalExpression) next.getElseExpression();
+ chain.add(next);
+ }
+
+ for (ConditionalExpression conditional : chain) {
+ before.add(this.tm.firstIndexAfter(conditional.getThenExpression(), TokenNameCOLON));
+ after.add(this.tm.firstIndexIn(conditional.getElseExpression(), -1));
+ }
+ this.wrapParentIndex = this.tm.firstIndexIn(node.getExpression(), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(node, -1);
+ handleWrap(this.options.alignment_for_conditional_expression_chain);
+
+ this.currentDepth++;
+ for (ConditionalExpression conditional : chain) {
+ before.add(this.tm.firstIndexAfter(conditional.getExpression(), TokenNameQUESTION));
+ after.add(this.tm.firstIndexIn(conditional.getThenExpression(), -1));
+ this.wrapParentIndex = this.tm.firstIndexIn(conditional.getExpression(), -1);
+ this.wrapGroupEnd = this.tm.lastIndexIn(conditional.getThenExpression(), -1);
+ handleWrap(this.options.alignment_for_conditional_expression);
+ }
+ this.currentDepth--;
+ }
return true;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index 73e2344885..33e9b72cef 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -160,7 +160,6 @@ import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
@@ -4603,11 +4602,7 @@ public final class JavaCore extends Plugin {
};
mainMonitor.subTask(Messages.javamodel_building_after_upgrade);
try {
- ResourcesPlugin.getWorkspace().run(
- runnable,
- new MultiRule(Arrays.stream(projects).map(IJavaProject::getResource).toArray(ISchedulingRule[]::new)),
- IWorkspace.AVOID_UPDATE,
- mainMonitor.split(1));
+ ResourcesPlugin.getWorkspace().run(runnable, mainMonitor.split(1));
} catch (CoreException e) {
// could not touch all projects
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
index 29f746a9ff..0aa71bebef 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
@@ -34,7 +34,6 @@ import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.SourceElementParser;
@@ -902,7 +901,7 @@ public class DeltaProcessor {
}
};
try {
- ResourcesPlugin.getWorkspace().run(runnable, new MultiRule(projectsToTouch), IWorkspace.AVOID_UPDATE, monitor);
+ ResourcesPlugin.getWorkspace().run(runnable, monitor);
} catch (CoreException e) {
throw new JavaModelException(e);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
index b9ea184e5b..8dc48f566f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -133,6 +133,9 @@ public class JavaCorePreferenceInitializer extends AbstractPreferenceInitializer
}
/**
+ * Note: For deprecated formatter options, you may also add migration to their replacement options in
+ * {@link org.eclipse.jdt.internal.formatter.DefaultCodeFormatterOptions#setDeprecatedOptions}.
+ *
* @deprecated As using deprecated options
*/
private void initializeDeprecatedOptions() {
@@ -153,5 +156,42 @@ public class JavaCorePreferenceInitializer extends AbstractPreferenceInitializer
DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE,
DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER
});
+
+ deprecatedOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION,
+ new String[] {
+ DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ADDITIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION,
+ DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BITWISE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_LOGICAL_OPERATOR,
+ });
+ deprecatedOptions.put(DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BINARY_OPERATOR,
+ new String[] {
+ DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_MULTIPLICATIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_ADDITIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_STRING_CONCATENATION,
+ DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BITWISE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_LOGICAL_OPERATOR,
+ });
+ deprecatedOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR,
+ new String[] {
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_MULTIPLICATIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ADDITIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_STRING_CONCATENATION,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SHIFT_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_RELATIONAL_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BITWISE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_LOGICAL_OPERATOR,
+ });
+ deprecatedOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR,
+ new String[] {
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_MULTIPLICATIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ADDITIVE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_STRING_CONCATENATION,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SHIFT_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_RELATIONAL_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BITWISE_OPERATOR,
+ DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_LOGICAL_OPERATOR,
+ });
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
index 359c9e8a24..8de8ebe731 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -2980,9 +2980,9 @@ public class JavaModelManager implements ISaveParticipant, IContentTypeChangeLis
ArchiveValidity validity = getArchiveValidity(path);
IOException reason;
switch (validity) {
- case BAD_FORMAT: reason = new ZipException(); break;
- case FILE_NOT_FOUND: reason = new FileNotFoundException(); break;
- case UNABLE_TO_READ: reason = new IOException(); break;
+ case BAD_FORMAT: reason = new ZipException("Bad format in archive: " + path); break; //$NON-NLS-1$
+ case FILE_NOT_FOUND: reason = new FileNotFoundException("Archive not found for path: " + path); break; //$NON-NLS-1$
+ case UNABLE_TO_READ: reason = new IOException("Unable to read archive: " + path); break; //$NON-NLS-1$
default: reason = null;
}
if (reason != null) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
index 592f193cfa..27c8f298b1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJar.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -325,7 +325,9 @@ public boolean isPackage(String qualifiedPackageName, String moduleName) {
public boolean hasCompilationUnit(String pkgName, String moduleName) {
for (Enumeration<? extends ZipEntry> e = this.zipFile.entries(); e.hasMoreElements(); ) {
String fileName = e.nextElement().getName();
- if (fileName.startsWith(pkgName) && fileName.toLowerCase().endsWith(SuffixConstants.SUFFIX_STRING_class))
+ if (fileName.startsWith(pkgName)
+ && fileName.toLowerCase().endsWith(SuffixConstants.SUFFIX_STRING_class)
+ && fileName.indexOf('/', pkgName.length()+1) == -1)
return true;
}
return false;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
index 9455dbac6e..fdef682456 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
@@ -77,11 +77,14 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
initialize();
loadModules(this);
}
-
+ /*
+ * JDK 11 doesn't contain release 5. Hence
+ * if the compliance is below 6, we simply return the lowest supported
+ * release, which is 6.
+ */
private String getReleaseOptionFromCompliance(String comp) {
if (JavaCore.compareJavaVersions(comp, JavaCore.VERSION_1_5) <= 0) {
- // For a JDK 9 and above, the minimum release we support is "6"
- return this.isJRE12Plus ? "7" : "6"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "6"; //$NON-NLS-1$
}
int index = comp.indexOf("1."); //$NON-NLS-1$
if (index != -1) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
index abf0ebc7a7..907c1d627c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java
@@ -16,8 +16,7 @@ package org.eclipse.jdt.internal.core.builder;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.preferences.InstanceScope;
+
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.compiler.*;
import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
@@ -31,7 +30,6 @@ import java.util.*;
@SuppressWarnings({"rawtypes", "unchecked"})
public class JavaBuilder extends IncrementalProjectBuilder {
-public static final String PREF_NULL_SCHEDULING_RULE = "useNullSchedulingRule"; //$NON-NLS-1$
IProject currentProject;
JavaProject javaProject;
IWorkspaceRoot workspaceRoot;
@@ -809,12 +807,4 @@ public String toString() {
? "JavaBuilder for unknown project" //$NON-NLS-1$
: "JavaBuilder for " + this.currentProject.getName(); //$NON-NLS-1$
}
-
- @Override
- public ISchedulingRule getRule(int kind, Map<String, String> args) {
- if (InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).getBoolean(PREF_NULL_SCHEDULING_RULE, false)) {
- return null;
- }
- return super.getRule(kind, args);
- }
}
diff --git a/org.eclipse.jdt.core/schema/compiler.dtd b/org.eclipse.jdt.core/schema/compiler.dtd
index e83ee0a263..bb57d15ab7 100644
--- a/org.eclipse.jdt.core/schema/compiler.dtd
+++ b/org.eclipse.jdt.core/schema/compiler.dtd
@@ -69,7 +69,8 @@
optionKey CDATA #IMPLIED
>
<!ATTLIST classfile path CDATA #REQUIRED>
-<!ATTLIST error message CDATA #REQUIRED>
+<!ATTLIST error message CDATA #REQUIRED
+ path CDATA #IMPLIED>
<!ATTLIST warning message CDATA #REQUIRED>
<!ATTLIST problem_summary problems CDATA #REQUIRED
errors CDATA #REQUIRED

Back to the top