Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2019-11-26 07:56:18 +0000
committerManoj Palat2019-11-26 07:56:18 +0000
commit169a38539df99e192fd0daf768512ca97178a498 (patch)
tree7ce59251a189cf4a65a8c3f6725b21bbabd16691
parent77f679000de0c40dd48ba8bc1f223327448fe3e1 (diff)
parent530d24dc4b78515d46c914d8f9167dd995e74ad6 (diff)
downloadeclipse.jdt.core-169a38539df99e192fd0daf768512ca97178a498.tar.gz
eclipse.jdt.core-169a38539df99e192fd0daf768512ca97178a498.tar.xz
eclipse.jdt.core-169a38539df99e192fd0daf768512ca97178a498.zip
Merge branch 'master' into BETA_JAVA14Y20191126-0500
-rw-r--r--org.eclipse.jdt.annotation/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jdt.annotation/pom.xml2
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jarbin267940 -> 267785 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java11
-rw-r--r--org.eclipse.jdt.compiler.apt/pom.xml44
-rw-r--r--org.eclipse.jdt.compiler.tool/pom.xml44
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java22
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java961
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java111
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java33
-rw-r--r--org.eclipse.jdt.core/antadapter/META-INF/eclipse.inf3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java23
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java24
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IJavadocTypeReference.java27
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java163
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java16
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java14
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java45
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java113
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java109
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties12
-rw-r--r--org.eclipse.jdt.core/forceQualifierUpdate.txt1
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java24
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java57
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java16
-rw-r--r--org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java7
-rw-r--r--org.eclipse.jdt.core/jdtCompilerAdapter.jarbin14525 -> 14367 bytes
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java9
30 files changed, 1842 insertions, 66 deletions
diff --git a/org.eclipse.jdt.annotation/META-INF/MANIFEST.MF b/org.eclipse.jdt.annotation/META-INF/MANIFEST.MF
index 539c360070..7fcce087a0 100644
--- a/org.eclipse.jdt.annotation/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.annotation/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Localization: bundle
Bundle-SymbolicName: org.eclipse.jdt.annotation
-Bundle-Version: 2.2.300.qualifier
+Bundle-Version: 2.2.400.qualifier
Export-Package: org.eclipse.jdt.annotation
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: %providerName
diff --git a/org.eclipse.jdt.annotation/pom.xml b/org.eclipse.jdt.annotation/pom.xml
index 9a644a3d72..c9369c5cdf 100644
--- a/org.eclipse.jdt.annotation/pom.xml
+++ b/org.eclipse.jdt.annotation/pom.xml
@@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.annotation</artifactId>
- <version>2.2.300-SNAPSHOT</version>
+ <version>2.2.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
index c0e46191a6..9cc48c8cac 100644
--- a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
+++ b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java
index afbf62b9fb..61e8434ebb 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017, 2018 IBM Corporation.
+ * Copyright (c) 2017, 2019 IBM Corporation.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -82,8 +82,13 @@ public class Java9ElementProcessor extends BaseProcessor {
this.isJre10 = true;
} else if (property.equals(CompilerOptions.VERSION_11)) {
this.isJre11 = true;
- } else if (property.equals(CompilerOptions.VERSION_12)) {
- this.isJre12 = true;
+ } else {
+ char c = '.';
+ if (property.indexOf(c) == -1) {
+ int ver12 = Integer.parseInt(CompilerOptions.VERSION_12);
+ int current = Integer.parseInt(property);
+ if (current >= ver12) this.isJre12 = true;
+ }
}
}
// Always return false from this processor, because it supports "*".
diff --git a/org.eclipse.jdt.compiler.apt/pom.xml b/org.eclipse.jdt.compiler.apt/pom.xml
index 0000e2e2f5..26133e0856 100644
--- a/org.eclipse.jdt.compiler.apt/pom.xml
+++ b/org.eclipse.jdt.compiler.apt/pom.xml
@@ -99,4 +99,48 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>eclipse-sign</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-ecj</id>
+ <phase>package</phase>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ <target>
+ <exec dir="${basedir}/../org.eclipse.jdt.core/target/" executable="curl">
+ <arg value="--output"/>
+ <arg value="org.eclipse.jdt.core-3.20.0-SNAPSHOT-batch-compiler.jar"/>
+ <arg value="--form"/>
+ <arg value="file=@org.eclipse.jdt.core-3.20.0-SNAPSHOT-batch-compiler.jar"/>
+ <arg value="--silent"/>
+ <arg value="--show-error"/>
+ <arg value="--fail"/>
+ <arg value="http://build.eclipse.org:31338/sign"/>
+ </exec>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
diff --git a/org.eclipse.jdt.compiler.tool/pom.xml b/org.eclipse.jdt.compiler.tool/pom.xml
index 84ce3524bb..29632bfb9a 100644
--- a/org.eclipse.jdt.compiler.tool/pom.xml
+++ b/org.eclipse.jdt.compiler.tool/pom.xml
@@ -85,6 +85,7 @@
<include name="**/*"/>
</fileset>
</zip>
+
<delete dir="${unjarDestBin}" failonerror="false"/>
<!-- no source bundle for ecj, as jdt.core pom.xml does not generate it -->
@@ -99,4 +100,47 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>eclipse-sign</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sign-ecj</id>
+ <phase>package</phase>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ <target>
+ <exec dir="${basedir}/../org.eclipse.jdt.core/target/" executable="curl">
+ <arg value="--output"/>
+ <arg value="org.eclipse.jdt.core-3.20.0-SNAPSHOT-batch-compiler.jar"/>
+ <arg value="--form"/>
+ <arg value="file=@org.eclipse.jdt.core-3.20.0-SNAPSHOT-batch-compiler.jar"/>
+ <arg value="--silent"/>
+ <arg value="--show-error"/>
+ <arg value="--fail"/>
+ <arg value="http://build.eclipse.org:31338/sign"/>
+ </exec>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
index 7f98631e2d..5fee6971d0 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java
@@ -706,9 +706,11 @@ public void test011_problem_categories() {
expectedProblemAttributes.put("JavadocAmbiguousMethodReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocAmbiguousType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocDuplicateProvidesTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocDuplicateUsesTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocEmptyReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocGenericConstructorTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocGenericMethodTypeArgumentMismatch", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
@@ -723,6 +725,8 @@ public void test011_problem_categories() {
expectedProblemAttributes.put("JavadocInvalidParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidParamTagName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidParamTagTypeParameter", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidProvidesClass", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidProvidesClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidSeeArgs", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidSeeHref", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
@@ -730,6 +734,8 @@ public void test011_problem_categories() {
expectedProblemAttributes.put("JavadocInvalidTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidThrowsClass", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidUsesClass", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidUsesClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidValueReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMalformedSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMessagePrefix", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL));
@@ -738,11 +744,15 @@ public void test011_problem_categories() {
expectedProblemAttributes.put("JavadocMissingIdentifier", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMissingParamName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMissingParamTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingProvidesClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingProvidesTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMissingReturnTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMissingSeeReference", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMissingTagDescription", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMissingThrowsClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocMissingThrowsTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingUsesClassName", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingUsesTag", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocNoMessageSendOnArrayType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocNoMessageSendOnBaseType", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
expectedProblemAttributes.put("JavadocNonGenericConstructor", new ProblemAttributes(CategorizedProblem.CAT_JAVADOC));
@@ -1689,9 +1699,11 @@ public void test012_compiler_problems_tuning() {
expectedProblemAttributes.put("JavadocAmbiguousMethodReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocAmbiguousType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocDuplicateProvidesTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocDuplicateThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocDuplicateUsesTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocEmptyReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocGenericConstructorTypeArgumentMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocGenericMethodTypeArgumentMismatch", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
@@ -1706,6 +1718,8 @@ public void test012_compiler_problems_tuning() {
expectedProblemAttributes.put("JavadocInvalidParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidParamTagName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidParamTagTypeParameter", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidProvidesClass", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidProvidesClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidSeeArgs", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidSeeHref", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
@@ -1713,6 +1727,8 @@ public void test012_compiler_problems_tuning() {
expectedProblemAttributes.put("JavadocInvalidTag", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidThrowsClass", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidUsesClass", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocInvalidUsesClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocInvalidValueReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocMalformedSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocMessagePrefix", SKIP);
@@ -1721,11 +1737,17 @@ public void test012_compiler_problems_tuning() {
expectedProblemAttributes.put("JavadocMissingIdentifier", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocMissingParamName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocMissingParamTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS));
+ expectedProblemAttributes.put("JavadocMissingProvidesClass", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingProvidesClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingProvidesTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS));
expectedProblemAttributes.put("JavadocMissingReturnTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS));
expectedProblemAttributes.put("JavadocMissingSeeReference", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocMissingTagDescription", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocMissingThrowsClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocMissingThrowsTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS));
+ expectedProblemAttributes.put("JavadocMissingUsesClass", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingUsesClassName", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
+ expectedProblemAttributes.put("JavadocMissingUsesTag", new ProblemAttributes(JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS));
expectedProblemAttributes.put("JavadocNoMessageSendOnArrayType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocNoMessageSendOnBaseType", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
expectedProblemAttributes.put("JavadocNonGenericConstructor", new ProblemAttributes(JavaCore.COMPILER_PB_INVALID_JAVADOC));
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java
new file mode 100644
index 0000000000..00ecdbcc13
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java
@@ -0,0 +1,961 @@
+/*******************************************************************************
+ * Copyright (c) 2019 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Red Hat Inc. - copied from ModuleCompilationTests and used for Javadoc
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.compiler.regression;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.file.DirectoryNotEmptyException;
+import java.nio.file.FileSystems;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jdt.core.tests.util.Util;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.Test;
+
+public class JavadocTestForModule extends AbstractBatchCompilerTest {
+
+ static {
+// TESTS_NAMES = new String[] { "testBug549855a" };
+ // TESTS_NUMBERS = new int[] { 1 };
+ // TESTS_RANGE = new int[] { 298, -1 };
+ }
+
+ public JavadocTestForModule(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ return buildMinimalComplianceTestSuite(testClass(), F_9);
+ }
+
+ public static Class<?> testClass() {
+ return JavadocTestForModule.class;
+ }
+
+ protected void writeFileCollecting(List<String> collectedFiles, String directoryName, String fileName, String source) {
+ writeFile(directoryName, fileName, source);
+ collectedFiles.add(directoryName+File.separator+fileName);
+ }
+
+ protected void writeFile(String directoryName, String fileName, String source) {
+ File directory = new File(directoryName);
+ if (!directory.exists()) {
+ if (!directory.mkdirs()) {
+ System.out.println("Could not create " + directoryName);
+ return;
+ }
+ }
+ String filePath = directory.getAbsolutePath() + File.separator + fileName;
+ try {
+ BufferedWriter writer = new BufferedWriter(new FileWriter(filePath));
+ writer.write(source);
+ writer.flush();
+ writer.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return;
+ }
+ }
+
+ class Runner extends AbstractRegressionTest.Runner {
+ StringBuffer commandLine = new StringBuffer();
+ String outputDir = OUTPUT_DIR + File.separator + "javac";
+ List<String> fileNames = new ArrayList<>();
+ /** will replace any -8, -9 ... option for javac */
+ String javacVersionOptions;
+
+ Runner() {
+ this.javacTestOptions = JavacTestOptions.DEFAULT;
+ this.expectedOutputString = "";
+ this.expectedErrorString = "";
+ }
+ /** Create a source file and add the filename to the compiler command line. */
+ void createFile(String directoryName, String fileName, String source) {
+ writeFileCollecting(this.fileNames, directoryName, fileName, source);
+ }
+ Set<String> runConformModuleTest() {
+ if (!this.fileNames.isEmpty()) {
+ this.shouldFlushOutputDirectory = false;
+ if (this.testFiles == null)
+ this.testFiles = new String[0];
+ for (String fileName : this.fileNames) {
+ this.commandLine.append(" \"").append(fileName).append("\"");
+ }
+ }
+ String commandLineString = this.commandLine.toString();
+ String javacCommandLine = adjustForJavac(commandLineString, this.javacVersionOptions);
+ return JavadocTestForModule.this.runConformModuleTest(this.testFiles, commandLineString,
+ this.expectedOutputString, this.expectedErrorString,
+ this.shouldFlushOutputDirectory, this.outputDir,
+ this.javacTestOptions, javacCommandLine);
+ }
+ }
+
+ void runConformModuleTest(List<String> testFileNames, StringBuffer commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory)
+ {
+ runConformModuleTest(testFileNames, commandLine,
+ expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, OUTPUT_DIR + File.separator + "javac");
+ }
+
+ void runConformModuleTest(List<String> testFileNames, StringBuffer commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory, String output)
+ {
+ for (String file : testFileNames)
+ commandLine.append(" \"").append(file).append("\"");
+ runConformModuleTest(new String[0], commandLine.toString(),
+ expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory,
+ output, JavacTestOptions.DEFAULT, null);
+ }
+
+ Set<String> runConformModuleTest(String[] testFiles, String commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory)
+ {
+ return runConformModuleTest(testFiles, commandLine, expectedFailureErrOutputString, expectedFailureErrOutputString,
+ shouldFlushOutputDirectory, OUTPUT_DIR, JavacTestOptions.DEFAULT, null);
+ }
+
+ Set<String> runConformModuleTest(String[] testFiles, String commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory, String output, JavacTestOptions options, String javacCommandLine)
+ {
+ this.runConformTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory);
+ if (RUN_JAVAC) {
+ File outputDir = new File(output);
+ final Set<String> outFiles = new HashSet<>();
+ walkOutFiles(output, outFiles, true);
+ String[] testFileNames = new String[testFiles.length/2];
+ for (int i = 0; i < testFileNames.length; i++) {
+ testFileNames[i] = testFiles[i*2];
+ }
+ if (javacCommandLine == null) {
+ javacCommandLine = adjustForJavac(commandLine, null);
+ }
+ for (JavacCompiler javacCompiler : javacCompilers) {
+ if (javacCompiler.compliance < ClassFileConstants.JDK9)
+ continue;
+ if (options.skip(javacCompiler)) {
+ System.err.println("Skip testing javac in "+testName());
+ continue;
+ }
+ StringBuffer log = new StringBuffer();
+ try {
+ long compileResult = javacCompiler.compile(
+ outputDir, /* directory */
+ javacCommandLine /* options */,
+ testFileNames /* source file names */,
+ log,
+ false); // don't repeat filenames on the command line
+ if (compileResult != 0) {
+ System.err.println("Previous error was from "+testName());
+ fail("Unexpected error from javac");
+ }
+ } catch (IOException | InterruptedException e) {
+ e.printStackTrace();
+ throw new AssertionFailedError(e.getMessage());
+ }
+ final Set<String> expectedFiles = new HashSet<>(outFiles);
+ walkOutFiles(output, expectedFiles, false);
+ for (String missingFile : expectedFiles)
+ System.err.println("Missing output file from javac: "+missingFile);
+ }
+ return outFiles;
+ }
+ return null;
+ }
+
+ void runNegativeModuleTest(List<String> testFileNames, StringBuffer commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory, String javacErrorMatch) {
+ runNegativeModuleTest(testFileNames, commandLine, expectedFailureOutOutputString,
+ expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, OUTPUT_DIR + File.separator + "javac");
+ }
+
+ void runNegativeModuleTest(List<String> testFileNames, StringBuffer commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory, String javacErrorMatch, String output)
+ {
+ runNegativeModuleTest(testFileNames, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString,
+ shouldFlushOutputDirectory, javacErrorMatch, output, JavacTestOptions.DEFAULT);
+ }
+ void runNegativeModuleTest(List<String> testFileNames, StringBuffer commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory, String javacErrorMatch, String output, JavacTestOptions options)
+ {
+ for (String file : testFileNames)
+ commandLine.append(" \"").append(file).append("\"");
+ runNegativeModuleTest(new String[0], commandLine.toString(),
+ expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, output,
+ options);
+ }
+ void runNegativeModuleTest(String[] testFiles, String commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory, String javacErrorMatch) {
+ runNegativeModuleTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString,
+ shouldFlushOutputDirectory, javacErrorMatch, OUTPUT_DIR, JavacTestOptions.DEFAULT);
+ }
+
+ void runNegativeModuleTest(String[] testFiles, String commandLine,
+ String expectedFailureOutOutputString, String expectedFailureErrOutputString,
+ boolean shouldFlushOutputDirectory, String javacErrorMatch, String output, JavacTestOptions options)
+ {
+ this.runNegativeTest(testFiles, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory);
+ if (RUN_JAVAC) {
+ String[] testFileNames = new String[testFiles.length/2];
+ for (int i = 0; i < testFileNames.length; i++) {
+ testFileNames[i] = testFiles[i*2];
+ }
+ File outputDir = new File(OUTPUT_DIR);
+ final Set<String> outFiles = new HashSet<>();
+ walkOutFiles(output, outFiles, true);
+ for (JavacCompiler javacCompiler : javacCompilers) {
+ if (javacCompiler.compliance < ClassFileConstants.JDK9)
+ continue;
+ JavacTestOptions.Excuse excuse = options.excuseFor(javacCompiler);
+
+ commandLine = adjustForJavac(commandLine, null);
+ StringBuffer log = new StringBuffer();
+ int mismatch = 0;
+ try {
+ long compileResult = javacCompiler.compile(
+ outputDir, /* directory */
+ commandLine /* options */,
+ testFileNames /* source file names */,
+ log);
+ if (compileResult == 0) {
+ mismatch = JavacTestOptions.MismatchType.EclipseErrorsJavacNone;
+ javacErrorMatch = expectedFailureErrOutputString;
+ System.err.println("Previous error was from "+testName());
+ } else if (!log.toString().contains(javacErrorMatch)) {
+ mismatch = JavacTestOptions.MismatchType.CompileErrorMismatch;
+ System.err.println(testName()+": Error match " + javacErrorMatch + " not found in \n"+log.toString());
+ }
+ } catch (IOException | InterruptedException e) {
+ e.printStackTrace();
+ throw new AssertionFailedError(e.getMessage());
+ }
+ handleMismatch(javacCompiler, testName(), testFiles, javacErrorMatch,
+ "", "", log, "", "",
+ excuse, mismatch);
+ final Set<String> expectedFiles = new HashSet<>(outFiles);
+ walkOutFiles(output, expectedFiles, false);
+ for (String missingFile : expectedFiles)
+ System.err.println("Missing output file from javac: "+missingFile);
+ }
+ }
+ }
+
+ /**
+ * @param commandLine command line arguments as used for ecj
+ * @param versionOptions if non-null use this to replace any ecj-specific -8, -9 etc. arg.
+ * If ecj-specific arg is not found, append anyway
+ * @return commandLine adjusted for javac
+ */
+ String adjustForJavac(String commandLine, String versionOptions) {
+ String[] tokens = commandLine.split(" ");
+ StringBuffer buf = new StringBuffer();
+ boolean skipNext = false;
+ for (int i = 0; i < tokens.length; i++) {
+ if (skipNext) {
+ skipNext = false;
+ continue;
+ }
+ if (tokens[i].trim().equals("-9")) {
+ if (versionOptions == null)
+ buf.append(' ').append(" --release 9 ");
+ continue;
+ }
+ if (tokens[i].trim().equals("-8")) {
+ if (versionOptions == null)
+ buf.append(' ').append(" --release 8 ");
+ continue;
+ }
+ if (tokens[i].startsWith("-warn") || tokens[i].startsWith("-err") || tokens[i].startsWith("-info")) {
+ if (tokens[i].contains("exports") && !tokens[i].contains("-exports"))
+ buf.append(" -Xlint:exports ");
+ continue;
+ }
+ if (tokens[i].trim().equals("-classNames")) {
+ skipNext = true;
+ continue;
+ }
+ buf.append(tokens[i]).append(' ');
+ }
+ if (versionOptions != null) {
+ buf.append(versionOptions);
+ }
+ return buf.toString();
+ }
+
+ private void walkOutFiles(final String outputLocation, final Set<String> fileNames, boolean add) {
+ if (!(new File(outputLocation)).exists())
+ return;
+ try {
+ Files.walkFileTree(FileSystems.getDefault().getPath(outputLocation), new SimpleFileVisitor<Path>() {
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+ if (file.toString().endsWith(".class")) {
+ if (add) {
+ fileNames.add(file.toString());
+ } else {
+ if (!fileNames.remove(file.toString()))
+ System.err.println("Unexpected output file from javac: "+file.toString());
+ }
+ Files.delete(file);
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
+ if (!dir.toString().equals(outputLocation)) {
+ try {
+ Files.delete(dir);
+ } catch (DirectoryNotEmptyException ex) {
+ // expected
+ }
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw new AssertionFailedError(e.getMessage());
+ }
+ }
+
+ public void testBug549855a() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "I1.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "P1.java");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 5)\n" +
+ " provides p.I1 with p.P1;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing provides tag\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 6)\n" +
+ " uses java.util.Currency;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing uses tag\n" +
+ "----------\n" +
+ "2 problems (2 errors)\n",
+ false,
+ "missing tags");
+ }
+
+ public void testBug549855b() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " @provides p.I\n" +
+ " @uses java.util.Currenc\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "I1.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "P1.java");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " @provides p.I\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid provides class\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
+ " @uses java.util.Currenc\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid uses class\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 7)\n" +
+ " provides p.I1 with p.P1;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing provides tag\n" +
+ "----------\n" +
+ "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 8)\n" +
+ " uses java.util.Currency;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing uses tag\n" +
+ "----------\n" +
+ "4 problems (4 errors)\n",
+ false,
+ "missing and invalid tags");
+ }
+
+ public void testBug549855c() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " @provides p.I1\n" +
+ " @uses java.util.Currency\n" +
+ " @provides p.I1\n" +
+ " @uses java.util.Currency\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "I1.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "P1.java");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 4)\n" +
+ " @provides p.I1\n" +
+ " ^^^^\n" +
+ "Javadoc: Duplicate provides tag\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 5)\n" +
+ " @uses java.util.Currency\n" +
+ " ^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Duplicate uses tag\n" +
+ "----------\n" +
+ "2 problems (2 errors)\n",
+ false,
+ "duplicate tags");
+ }
+
+ public void testBug549855d() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " @provides p.I1\n" +
+ " @uses java.util.Currency\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ");
+
+ runConformModuleTest(files, buffer, "", "", false);
+ }
+
+ public void testBug549855e() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " @provides p.I1\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "I1.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "P1.java");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 7)\n" +
+ " uses java.util.Currency;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing uses tag\n" +
+ "----------\n" +
+ "1 problem (1 error)\n",
+ false,
+ "missing tags");
+ }
+
+ public void testBug549855f() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " @uses java.util.Currency\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "I1.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "P1.java");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 6)\n" +
+ " provides p.I1 with p.P1;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing provides tag\n" +
+ "----------\n" +
+ "1 problem (1 error)\n",
+ false,
+ "missing tags");
+ }
+
+ public void testBug549855g() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "I1.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "P1.java");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 5)\n" +
+ " provides p.I1 with p.P1;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing provides tag\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 6)\n" +
+ " uses java.util.Currency;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing uses tag\n" +
+ "----------\n" +
+ "2 problems (2 errors)\n",
+ false,
+ "missing tags");
+ }
+
+ public void testBug549855h() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "/**\n" +
+ " * @provides p.I\n" +
+ " * @uses java.util.Currenc\n" +
+ " */\n" +
+ "module mod.one { \n" +
+ " exports p;\n" +
+ " provides p.I1 with p.P1;\n" +
+ " uses java.util.Currency;\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "I1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * interface I1\n" +
+ " */\n" +
+ "public interface I1 {\n" +
+ " /**\n" +
+ " * Method foo\n" +
+ " * @return int\n" +
+ " */\n" +
+ " public int foo();\n" +
+ "}");
+ writeFileCollecting(files, moduleLoc + File.separator + "p", "P1.java",
+ "package p;\n" +
+ "/**\n" +
+ " * class P1\n" +
+ " */\n" +
+ "public class P1 implements I1 {\n" +
+ " @Override\n" +
+ " public int foo() { return 0; }\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "I1.java ")
+ .append(moduleLoc + File.separator + "p" + File.separator + "P1.java");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" +
+ " * @provides p.I\n" +
+ " ^^^\n" +
+ "Javadoc: Invalid provides class\n" +
+ "----------\n" +
+ "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" +
+ " * @uses java.util.Currenc\n" +
+ " ^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Invalid uses class\n" +
+ "----------\n" +
+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 7)\n" +
+ " provides p.I1 with p.P1;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing provides tag\n" +
+ "----------\n" +
+ "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 8)\n" +
+ " uses java.util.Currency;\n" +
+ " ^^^^^^^^^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing uses tag\n" +
+ "----------\n" +
+ "4 problems (4 errors)\n",
+ false,
+ "invalid tags");
+ }
+
+ public void testBug549855i() {
+ File outputDirectory = new File(OUTPUT_DIR);
+ Util.flushDirectoryContent(outputDirectory);
+ String out = "bin";
+ String directory = OUTPUT_DIR + File.separator + "src";
+ String moduleLoc = directory + File.separator + "mod.one";
+ List<String> files = new ArrayList<>();
+ writeFileCollecting(files, moduleLoc, "module-info.java",
+ "module mod.one {\n" +
+ "}");
+
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("-d " + OUTPUT_DIR + File.separator + out )
+ .append(" -9 ")
+ .append(" -enableJavadoc ")
+ .append(" -err:allJavadoc ")
+ .append(" -classpath \"")
+ .append(Util.getJavaClassLibsAsString())
+ .append("\" ")
+ .append(" -warn:-unused")
+ .append(" --module-source-path " + "\"" + directory + "\" ")
+ .append(moduleLoc + File.separator + "module-info.java ");
+
+ runNegativeModuleTest(
+ new String[0],
+ buffer.toString(),
+ "",
+ "----------\n" +
+ "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1)\n" +
+ " module mod.one {\n" +
+ " ^^^^^^^^^^^^^^^\n" +
+ "Javadoc: Missing comment for module declaration\n" +
+ "----------\n" +
+ "1 problem (1 error)\n",
+ false,
+ "missing comment");
+ }
+
+}
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 0d533d03d8..a63c61b5c4 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
@@ -15391,4 +15391,115 @@ public void testBug549436k() throws JavaModelException {
this.formatterPrefs.continuation_indentation = 2;
formatSourceInWorkspace("test549436", "in.java", "K_out.java");
}
+/**
+ * https://bugs.eclipse.org/54627 - [formatter] Blank lines between Javadoc tags
+ */
+public void testBug54627a() throws JavaModelException {
+ this.formatterPrefs.comment_insert_empty_line_between_different_tags = true;
+ String input =
+ "public class Test {\n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
+ " * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n" +
+ " * @throws IOException Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.\n" +
+ " * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.\n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) throws IOException, SQLException {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}";
+ formatSource(input,
+ "public class Test {\n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
+ " * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
+ " * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
+ " * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
+ " * quaerat voluptatem.\n" +
+ " * \n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
+ " * nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
+ " * cillum dolore eu fugiat nulla pariatur.\n" +
+ " * @param c Excepteur sint occaecat cupidatat non proident, sunt in culpa qui\n" +
+ " * officia deserunt mollit anim id est laborum.\n" +
+ " * \n" +
+ " * @throws IOException Sed ut perspiciatis unde omnis iste natus error sit\n" +
+ " * voluptatem accusantium doloremque laudantium.\n" +
+ " * @throws SQLException Totam rem aperiam, eaque ipsa quae ab illo inventore\n" +
+ " * veritatis et quasi architecto beatae vitae dicta sunt\n" +
+ " * explicabo.\n" +
+ " * \n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
+ " * fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
+ " * sequi nesciunt.\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) throws IOException, SQLException {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}");
+}
+/**
+ * https://bugs.eclipse.org/54627 - [formatter] Blank lines between Javadoc tags
+ */
+public void testBug54627b() throws JavaModelException {
+ this.formatterPrefs.comment_insert_empty_line_between_different_tags = true;
+ String input =
+ "public class Test {\n" +
+ " \n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.\n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n" +
+ " * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
+ " * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
+ " * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}";
+ formatSource(input,
+ "public class Test {\n" +
+ "\n" +
+ " /**\n" +
+ " * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n" +
+ " * tempor incididunt ut labore et dolore magna aliqua. Neque porro quisquam est,\n" +
+ " * qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia\n" +
+ " * non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam\n" +
+ " * quaerat voluptatem.\n" +
+ " * \n" +
+ " * @param a Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n" +
+ " * nisi ut aliquip ex ea commodo consequat.\n" +
+ " * @param b Duis aute irure dolor in reprehenderit in voluptate velit esse\n" +
+ " * cillum dolore eu fugiat nulla pariatur.\n" +
+ " * \n" +
+ " * @return Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut\n" +
+ " * fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem\n" +
+ " * sequi nesciunt.\n" +
+ " * \n" +
+ " * @@org.example.transaction.interceptor.RuleBasedTransactionAttribute()\n" +
+ " * @@org.example.transaction.interceptor.RollbackRuleAttribute(Exception.class)\n" +
+ " * @@org.example.transaction.interceptor.NoRollbackRuleAttribute(\"ServletException\")\n" +
+ " */\n" +
+ " public String f(int a, int b, int c) {\n" +
+ " return \"\";\n" +
+ " }\n" +
+ "}");
+}
+/**
+ * https://bugs.eclipse.org/547261 - [formatter] Separate option for space after not (!) operator
+ */
+public void testBug547261() throws JavaModelException {
+ this.formatterPrefs.insert_space_after_not_operator = true;
+ String input = "class C {boolean b=!a&&!(c||d)&&(f!=-5);}";
+ formatSource(input,
+ "class C {\n" +
+ " boolean b = ! a && ! (c || d) && (f != -5);\n" +
+ "}");
+}
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
index 7dbfd9d928..b36337b3a0 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NullAnnotationModelTests.java
@@ -19,8 +19,10 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.io.ByteArrayInputStream;
import java.net.URL;
+import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
+import java.util.Map;
import junit.framework.Test;
@@ -43,13 +45,19 @@ import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.IAnnotationBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.MarkerAnnotation;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.Modifier;
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.eclipse.jdt.core.tests.util.Util;
import org.osgi.framework.Bundle;
@@ -1061,4 +1069,29 @@ public class NullAnnotationModelTests extends ReconcilerTests {
deleteProject(project);
}
}
+
+ // was: NPE in SourceTypeBinding.getAnnotationTagBits
+ @SuppressWarnings("deprecation")
+ public void testBug551426() throws CoreException, Exception {
+ ASTParser astParser = ASTParser.newParser(AST.JLS8);
+ Map<String, String> options = new HashMap<>();
+ astParser.setResolveBindings(true);
+ astParser.setEnvironment(new String[] {}, new String[] {}, new String[] {}, true);
+ options.put(JavaCore.COMPILER_SOURCE, "1.8");
+ options.put(JavaCore.COMPILER_COMPLIANCE, "1.8");
+ astParser.setCompilerOptions(options);
+ astParser.setUnitName("C.java");
+ String source =
+ "class C {\n" +
+ " public static final Object f = new Object() {};\n" +
+ "}\n";
+ astParser.setSource(source.toCharArray());
+ CompilationUnit astNode = (CompilationUnit) astParser.createAST(null);
+ AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) astNode.types().get(0);
+ FieldDeclaration fieldDeclaration = (FieldDeclaration) typeDeclaration.bodyDeclarations().get(0);
+ VariableDeclarationFragment fragment = (VariableDeclarationFragment) fieldDeclaration.fragments().get(0);
+ ITypeBinding typeBinding = fragment.getInitializer().resolveTypeBinding();
+ IAnnotationBinding[] annotations = typeBinding.getAnnotations();
+ assertEquals(0, annotations.length);
+ }
}
diff --git a/org.eclipse.jdt.core/antadapter/META-INF/eclipse.inf b/org.eclipse.jdt.core/antadapter/META-INF/eclipse.inf
index 125dc309a5..4dc37a0f20 100644
--- a/org.eclipse.jdt.core/antadapter/META-INF/eclipse.inf
+++ b/org.eclipse.jdt.core/antadapter/META-INF/eclipse.inf
@@ -1,3 +1,2 @@
-jarprocessor.exclude.sign=true
jarprocessor.exclude.children=true
-jarprocessor.exclude.pack=true
+jarprocessor.exclude.pack=true \ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
index 035e96b2bb..690e2fbe1b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java
@@ -1196,6 +1196,29 @@ void setSourceStart(int sourceStart);
int JavadocUnexpectedText = Javadoc + Internal + 518;
/** @since 3.1 */
int JavadocInvalidParamTagName = Javadoc + Internal + 519;
+ /*
+ * IDs for module errors in Javadoc
+ */
+ /** @since 3.20 */
+ int JavadocMissingUsesTag = Javadoc + Internal + 1800;
+ /** @since 3.20 */
+ int JavadocDuplicateUsesTag = Javadoc + Internal + 1801;
+ /** @since 3.20 */
+ int JavadocMissingUsesClassName = Javadoc + Internal + 1802;
+ /** @since 3.20 */
+ int JavadocInvalidUsesClassName = Javadoc + Internal + 1803;
+ /** @since 3.20 */
+ int JavadocInvalidUsesClass = Javadoc + Internal + 1804;
+ /** @since 3.20 */
+ int JavadocMissingProvidesTag = Javadoc + Internal + 1805;
+ /** @since 3.20 */
+ int JavadocDuplicateProvidesTag = Javadoc + Internal + 1806;
+ /** @since 3.20 */
+ int JavadocMissingProvidesClassName = Javadoc + Internal + 1807;
+ /** @since 3.20 */
+ int JavadocInvalidProvidesClassName = Javadoc + Internal + 1808;
+ /** @since 3.20 */
+ int JavadocInvalidProvidesClass = Javadoc + Internal + 1809;
/**
* Generics
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
index 3e17e1538f..aacb0bb7c3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
@@ -13,7 +13,8 @@
* Stephan Herrmann - Contribution for bug 295551
* Jesper S Moller - Contributions for
* Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335
- * Frits Jalvingh - contributions for bug 533830.
+ * Frits Jalvingh - contributions for bug 533830.
+ * Red Hat Inc. - add module-info Javadoc support
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
@@ -22,6 +23,7 @@ import java.util.Comparator;
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.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.ClassFile;
import org.eclipse.jdt.internal.compiler.CompilationResult;
@@ -345,7 +347,7 @@ public void finalizeProblems() {
String key = CompilerOptions.optionKeyFromIrritant(id);
this.scope.problemReporter().problemNotAnalysed(inits[iToken], key);
} else {
- this.scope.problemReporter().unusedWarningToken(inits[iToken]);
+ this.scope.problemReporter().unusedWarningToken(inits[iToken]);
}
}
}
@@ -557,7 +559,7 @@ private boolean isLambdaExpressionCopyContext(ReferenceContext context) {
if (context instanceof LambdaExpression && context != ((LambdaExpression) context).original())
return true; // Do not record from copies. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=441929
Scope cScope = context instanceof AbstractMethodDeclaration ? ((AbstractMethodDeclaration) context).scope :
- context instanceof TypeDeclaration ? ((TypeDeclaration) context).scope :
+ context instanceof TypeDeclaration ? ((TypeDeclaration) context).scope :
context instanceof LambdaExpression ? ((LambdaExpression) context).scope :
null;
return cScope != null ? isLambdaExpressionCopyContext(cScope.parent.referenceContext()) : false;
@@ -565,7 +567,7 @@ private boolean isLambdaExpressionCopyContext(ReferenceContext context) {
public void recordSuppressWarnings(IrritantSet irritants, Annotation annotation, int scopeStart, int scopeEnd, ReferenceContext context) {
if (isLambdaExpressionCopyContext(context))
return; // Do not record from copies. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=441929
-
+
if (this.suppressWarningIrritants == null) {
this.suppressWarningIrritants = new IrritantSet[3];
this.suppressWarningAnnotations = new Annotation[3];
@@ -603,7 +605,7 @@ public void record(LocalTypeBinding localType) {
}
/*
- * Keep track of all lambda/method reference expressions, so as to be able to look it up later without
+ * Keep track of all lambda/method reference expressions, so as to be able to look it up later without
* having to traverse AST. Return the "ordinal" returned by the enclosing type.
*/
public int record(FunctionalExpression expression) {
@@ -619,6 +621,7 @@ public int record(FunctionalExpression expression) {
public void resolve() {
int startingTypeIndex = 0;
boolean isPackageInfo = isPackageInfo();
+ boolean isModuleInfo = isModuleInfo();
if (this.types != null && isPackageInfo) {
// resolve synthetic type declaration
final TypeDeclaration syntheticTypeDeclaration = this.types[0];
@@ -637,6 +640,17 @@ public void resolve() {
this.javadoc.resolve(syntheticTypeDeclaration.staticInitializerScope);
}
startingTypeIndex = 1;
+ } else if (this.moduleDeclaration != null && isModuleInfo) {
+ if (this.javadoc != null) {
+ this.javadoc.resolve((MethodScope)this.moduleDeclaration.scope);
+ } else if (this.moduleDeclaration.binding != null) {
+ ProblemReporter reporter = this.scope.problemReporter();
+ int severity = reporter.computeSeverity(IProblem.JavadocMissing);
+ if (severity != ProblemSeverities.Ignore) {
+ reporter.javadocModuleMissing(this.moduleDeclaration.declarationSourceStart, this.moduleDeclaration.bodyStart,
+ severity);
+ }
+ }
} else {
// resolve compilation unit javadoc package if any
if (this.javadoc != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IJavadocTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IJavadocTypeReference.java
new file mode 100644
index 0000000000..c21cdaec28
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IJavadocTypeReference.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Red Hat Inc. and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.compiler.ast;
+
+/**
+ * Interface to allow Javadoc parser to collect both JavaSingleTypeReference and JavaQualifiedTypeReferences
+ *
+ * @author jjohnstn
+ *
+ */
+public interface IJavadocTypeReference {
+
+ public int getTagSourceStart();
+ public int getTagSourceEnd();
+
+}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
index 308c39c3be..087d33fc8f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.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
@@ -33,6 +33,8 @@ public class Javadoc extends ASTNode {
public TypeReference[] exceptionReferences; // @throws, @exception
public JavadocReturnStatement returnStatement; // @return
public Expression[] seeReferences; // @see
+ public IJavadocTypeReference[] usesReferences; // @uses
+ public IJavadocTypeReference[] providesReferences; // @provides
public long[] inheritedPositions = null;
// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=51600
// Store param references for tag with invalid syntax
@@ -262,8 +264,8 @@ public class Javadoc extends ASTNode {
return;
}
// Do nothing - This is to mimic the SDK's javadoc tool behavior, which neither
- // sanity checks nor generates documentation using comments at the CU scope
- // (unless the unit happens to be package-info.java - in which case we don't come here.)
+ // sanity checks nor generates documentation using comments at the CU scope
+ // (unless the unit happens to be package-info.java - in which case we don't come here.)
}
/*
@@ -318,7 +320,7 @@ public class Javadoc extends ASTNode {
MethodBinding current = methDecl.binding;
// work 'against' better inference in 1.8 (otherwise comparing (G<T> with G<Object>) would fail):
if (methScope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8
- && current.typeVariables != Binding.NO_TYPE_VARIABLES)
+ && current.typeVariables != Binding.NO_TYPE_VARIABLES)
{
current = current.asRawMethod(methScope.environment());
}
@@ -326,7 +328,7 @@ public class Javadoc extends ASTNode {
superRef = true;
}
}
- }
+ }
}
}
}
@@ -385,6 +387,11 @@ public class Javadoc extends ASTNode {
for (int i = 0; i < length; i++) {
this.invalidParameters[i].resolve(methScope, false, false);
}
+
+ if (methScope.isModuleScope()) {
+ resolveUsesTags(methScope, reportMissing);
+ resolveProvidesTags(methScope, reportMissing);
+ }
}
private void resolveReference(Expression reference, Scope scope) {
@@ -561,6 +568,148 @@ public class Javadoc extends ASTNode {
}
/*
+ * Resolve @uses tags while block scope
+ */
+ private void resolveUsesTags(BlockScope scope, boolean reportMissing) {
+ ModuleDeclaration moduleDecl = (ModuleDeclaration)scope.referenceContext();
+ int usesTagsSize = this.usesReferences == null ? 0 : this.usesReferences.length;
+
+ // If no referenced module then report a problem for each uses tag
+ if (moduleDecl == null) {
+ for (int i = 0; i < usesTagsSize; i++) {
+ IJavadocTypeReference uses = this.usesReferences[i];
+ scope.problemReporter().javadocUnexpectedTag(uses.getTagSourceStart(), uses.getTagSourceEnd());
+ }
+ return;
+ }
+
+ // If no uses tags then report a problem for each uses reference
+ int usesSize = moduleDecl.usesCount;
+ if (usesTagsSize == 0) {
+ if (reportMissing) {
+ for (int i = 0; i < usesSize; i++) {
+ UsesStatement uses = moduleDecl.uses[i];
+ scope.problemReporter().javadocMissingUsesTag(uses.serviceInterface, uses.sourceStart, uses.sourceEnd, moduleDecl.binding.modifiers);
+ }
+ }
+ } else {
+ TypeBinding[] bindings = new TypeBinding[usesTagsSize];
+ int maxBindings = 0;
+
+ // Scan all @uses tags
+ for (int i = 0; i < usesTagsSize; i++) {
+ TypeReference usesRef = (TypeReference)this.usesReferences[i];
+ try {
+ usesRef.resolve(scope);
+ if (usesRef.resolvedType != null && usesRef.resolvedType.isValidBinding()) {
+ // Verify duplicated tags
+ boolean found = false;
+ for (int j = 0; j < maxBindings && !found; j++) {
+ if (bindings[j].equals(usesRef.resolvedType)) {
+ scope.problemReporter().javadocDuplicatedUsesTag(usesRef.sourceStart, usesRef.sourceEnd);
+ found = true;
+ }
+ }
+ if (!found) {
+ bindings[maxBindings++] = usesRef.resolvedType;
+ }
+ }
+ } catch (Exception e) {
+ scope.problemReporter().javadocInvalidUsesClass(usesRef.sourceStart, usesRef.sourceEnd);
+ }
+ }
+
+ // Look for undocumented uses
+ if (reportMissing) {
+ for (int i = 0; i < usesSize; i++) {
+ UsesStatement uses = moduleDecl.uses[i];
+ boolean found = false;
+ for (int j = 0; j < maxBindings && !found; j++) {
+ TypeBinding binding = bindings[j];
+ if (uses.serviceInterface.getTypeBinding(scope).equals(binding)) {
+ found = true;
+ }
+ }
+ if (!found) {
+ scope.problemReporter().javadocMissingUsesTag(uses.serviceInterface, uses.sourceStart, uses.sourceEnd, moduleDecl.binding.modifiers);
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * Resolve @provides tags while block scope
+ */
+ private void resolveProvidesTags(BlockScope scope, boolean reportMissing) {
+ ModuleDeclaration moduleDecl = (ModuleDeclaration)scope.referenceContext();
+ int providesTagsSize = this.providesReferences == null ? 0 : this.providesReferences.length;
+
+ // If no referenced module then report a problem for each uses tag
+ if (moduleDecl == null) {
+ for (int i = 0; i < providesTagsSize; i++) {
+ IJavadocTypeReference provides = this.providesReferences[i];
+ scope.problemReporter().javadocUnexpectedTag(provides.getTagSourceStart(), provides.getTagSourceEnd());
+ }
+ return;
+ }
+
+ // If no uses tags then report a problem for each uses reference
+ int providesSize = moduleDecl.servicesCount;
+ if (providesTagsSize == 0) {
+ if (reportMissing) {
+ for (int i = 0; i < providesSize; i++) {
+ ProvidesStatement provides = moduleDecl.services[i];
+ scope.problemReporter().javadocMissingProvidesTag(provides.serviceInterface, provides.sourceStart, provides.sourceEnd, moduleDecl.binding.modifiers);
+ }
+ }
+ } else {
+ TypeBinding[] bindings = new TypeBinding[providesTagsSize];
+ int maxBindings = 0;
+
+ // Scan all @provides tags
+ for (int i = 0; i < providesTagsSize; i++) {
+ TypeReference providesRef = (TypeReference)this.providesReferences[i];
+ try {
+ providesRef.resolve(scope);
+ if (providesRef.resolvedType != null && providesRef.resolvedType.isValidBinding()) {
+ // Verify duplicated tags
+ boolean found = false;
+ for (int j = 0; j < maxBindings && !found; j++) {
+ if (bindings[j].equals(providesRef.resolvedType)) {
+ scope.problemReporter().javadocDuplicatedProvidesTag(providesRef.sourceStart, providesRef.sourceEnd);
+ found = true;
+ }
+ }
+ if (!found) {
+ bindings[maxBindings++] = providesRef.resolvedType;
+ }
+ }
+ } catch (Exception e) {
+ scope.problemReporter().javadocInvalidProvidesClass(providesRef.sourceStart, providesRef.sourceEnd);
+ }
+ }
+
+ // Look for undocumented uses
+ if (reportMissing) {
+ for (int i = 0; i < providesSize; i++) {
+ ProvidesStatement provides = moduleDecl.services[i];
+ boolean found = false;
+ for (int j = 0; j < maxBindings && !found; j++) {
+ TypeBinding binding = bindings[j];
+ if (provides.serviceInterface.getTypeBinding(scope).equals(binding)) {
+ found = true;
+ }
+ }
+ if (!found) {
+ scope.problemReporter().javadocMissingProvidesTag(provides.serviceInterface, provides.sourceStart, provides.sourceEnd, moduleDecl.binding.modifiers);
+ }
+ }
+ }
+ }
+ }
+
+ /*
* Resolve @param tags for type parameters
*/
private void resolveTypeParameterTags(Scope scope, boolean reportMissing) {
@@ -604,7 +753,7 @@ public class Javadoc extends ASTNode {
// If no param tags then report a problem for each declaration type parameter
if (parameters != null) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850, avoid secondary errors when <= 1.4
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=324850, avoid secondary errors when <= 1.4
reportMissing = reportMissing && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5;
int typeParametersLength = parameters.length;
if (paramTypeParamLength == 0) {
@@ -830,7 +979,7 @@ public class Javadoc extends ASTNode {
mainLoop: for (int i=0; i<length; i++) {
char[][] compoundName = imports[i].compoundName;
int compoundNameLength = compoundName.length;
- if ((imports[i].onDemand && compoundNameLength == computedCompoundName.length-1)
+ if ((imports[i].onDemand && compoundNameLength == computedCompoundName.length-1)
|| (compoundNameLength == computedCompoundName.length)) {
for (int j = compoundNameLength; --j >= 0;) {
if (CharOperation.equals(imports[i].compoundName[j], computedCompoundName[j])) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java
index 3ed38f0990..ef06cca0e4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocQualifiedTypeReference.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
@@ -25,7 +25,7 @@ import org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
-public class JavadocQualifiedTypeReference extends QualifiedTypeReference {
+public class JavadocQualifiedTypeReference extends QualifiedTypeReference implements IJavadocTypeReference {
public int tagSourceStart, tagSourceEnd;
public PackageBinding packageBinding;
@@ -72,7 +72,7 @@ public class JavadocQualifiedTypeReference extends QualifiedTypeReference {
protected void reportDeprecatedType(TypeBinding type, Scope scope) {
scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers());
}
-
+
@Override
protected void reportDeprecatedType(TypeBinding type, Scope scope, int index) {
scope.problemReporter().javadocDeprecatedType(type, this, scope.getDeclarationModifiers(), index);
@@ -107,4 +107,14 @@ public class JavadocQualifiedTypeReference extends QualifiedTypeReference {
visitor.visit(this, scope);
visitor.endVisit(this, scope);
}
+
+ @Override
+ public int getTagSourceStart() {
+ return this.tagSourceStart;
+ }
+
+ @Override
+ public int getTagSourceEnd() {
+ return this.tagSourceEnd;
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java
index b64689b105..8a9ed4072d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleTypeReference.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
@@ -29,7 +29,7 @@ import org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
-public class JavadocSingleTypeReference extends SingleTypeReference {
+public class JavadocSingleTypeReference extends SingleTypeReference implements IJavadocTypeReference {
public int tagSourceStart, tagSourceEnd;
public PackageBinding packageBinding;
@@ -129,4 +129,14 @@ public class JavadocSingleTypeReference extends SingleTypeReference {
visitor.visit(this, scope);
visitor.endVisit(this, scope);
}
+
+ @Override
+ public int getTagSourceStart() {
+ return this.tagSourceStart;
+ }
+
+ @Override
+ public int getTagSourceEnd() {
+ return this.tagSourceEnd;
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index a1e02094e1..f2eb5efa0e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -1035,33 +1035,34 @@ public long getAnnotationTagBits() {
if (!isPrototype())
return this.prototype.getAnnotationTagBits();
- if ((this.tagBits & TagBits.EndHierarchyCheck) == 0) {
- CompilationUnitScope pkgCUS = this.scope.compilationUnitScope();
- boolean current = pkgCUS.connectingHierarchy;
- pkgCUS.connectingHierarchy = true;
- try {
- return internalGetAnnotationTagBits();
- } finally {
- pkgCUS.connectingHierarchy = current;
- }
- }
- return internalGetAnnotationTagBits();
-}
-private long internalGetAnnotationTagBits() {
if ((this.tagBits & TagBits.AnnotationResolved) == 0 && this.scope != null) {
- TypeDeclaration typeDecl = this.scope.referenceContext;
- boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
- try {
- typeDecl.staticInitializerScope.insideTypeAnnotation = true;
- ASTNode.resolveAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
- } finally {
- typeDecl.staticInitializerScope.insideTypeAnnotation = old;
+ if ((this.tagBits & TagBits.EndHierarchyCheck) == 0) {
+ CompilationUnitScope pkgCUS = this.scope.compilationUnitScope();
+ boolean current = pkgCUS.connectingHierarchy;
+ pkgCUS.connectingHierarchy = true;
+ try {
+ initAnnotationTagBits();
+ } finally {
+ pkgCUS.connectingHierarchy = current;
+ }
+ } else {
+ initAnnotationTagBits();
}
- if ((this.tagBits & TagBits.AnnotationDeprecated) != 0)
- this.modifiers |= ClassFileConstants.AccDeprecated;
}
return this.tagBits;
}
+private void initAnnotationTagBits() {
+ TypeDeclaration typeDecl = this.scope.referenceContext;
+ boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
+ try {
+ typeDecl.staticInitializerScope.insideTypeAnnotation = true;
+ ASTNode.resolveAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
+ } finally {
+ typeDecl.staticInitializerScope.insideTypeAnnotation = old;
+ }
+ if ((this.tagBits & TagBits.AnnotationDeprecated) != 0)
+ this.modifiers |= ClassFileConstants.AccDeprecated;
+}
public MethodBinding[] getDefaultAbstractMethods() {
if (!isPrototype())
return this.prototype.getDefaultAbstractMethods();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
index 4f7a7b95b6..9b90a4f978 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
@@ -18,6 +18,7 @@ import java.util.List;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.InvalidInputException;
+import org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.util.Util;
@@ -102,6 +103,14 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
protected int astLengthPtr;
protected int[] astLengthStack;
+ // Uses stack
+ protected int usesReferencesPtr = -1;
+ protected TypeReference[] usesReferencesStack;
+
+ // Provides stack
+ protected int providesReferencesPtr = -1;
+ protected TypeReference[] providesReferencesStack;
+
protected AbstractCommentParser(Parser sourceParser) {
this.sourceParser = sourceParser;
@@ -456,6 +465,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
}
updateDocComment();
} catch (Exception ex) {
+ ex.printStackTrace();
validComment = false;
}
return validComment;
@@ -501,7 +511,7 @@ public abstract class AbstractCommentParser implements JavadocTagConstants {
return Util.getLineNumber(position, this.lineEnds, 0, this.lineEnds.length-1);
}
- private int getTokenEndPosition() {
+ protected int getTokenEndPosition() {
if (this.scanner.getCurrentTokenEndPosition() > this.lineEnd) {
return this.lineEnd;
} else {
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 8663caba08..0fe67daee5 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
@@ -17,7 +17,23 @@ import java.util.List;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.InvalidInputException;
-import org.eclipse.jdt.internal.compiler.ast.*;
+import org.eclipse.jdt.internal.compiler.ast.ASTNode;
+import org.eclipse.jdt.internal.compiler.ast.Expression;
+import org.eclipse.jdt.internal.compiler.ast.IJavadocTypeReference;
+import org.eclipse.jdt.internal.compiler.ast.Javadoc;
+import org.eclipse.jdt.internal.compiler.ast.JavadocAllocationExpression;
+import org.eclipse.jdt.internal.compiler.ast.JavadocArgumentExpression;
+import org.eclipse.jdt.internal.compiler.ast.JavadocArrayQualifiedTypeReference;
+import org.eclipse.jdt.internal.compiler.ast.JavadocArraySingleTypeReference;
+import org.eclipse.jdt.internal.compiler.ast.JavadocFieldReference;
+import org.eclipse.jdt.internal.compiler.ast.JavadocImplicitTypeReference;
+import org.eclipse.jdt.internal.compiler.ast.JavadocMessageSend;
+import org.eclipse.jdt.internal.compiler.ast.JavadocQualifiedTypeReference;
+import org.eclipse.jdt.internal.compiler.ast.JavadocReturnStatement;
+import org.eclipse.jdt.internal.compiler.ast.JavadocSingleNameReference;
+import org.eclipse.jdt.internal.compiler.ast.JavadocSingleTypeReference;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.util.Util;
@@ -27,6 +43,7 @@ import org.eclipse.jdt.internal.compiler.util.Util;
public class JavadocParser extends AbstractCommentParser {
private static final JavadocSingleNameReference[] NO_SINGLE_NAME_REFERENCE = new JavadocSingleNameReference[0];
private static final JavadocSingleTypeReference[] NO_SINGLE_TYPE_REFERENCE = new JavadocSingleTypeReference[0];
+ private static final JavadocQualifiedTypeReference[] NO_QUALIFIED_TYPE_REFERENCE = new JavadocQualifiedTypeReference[0];
private static final TypeReference[] NO_TYPE_REFERENCE = new TypeReference[0];
private static final Expression[] NO_EXPRESSION = new Expression[0];
@@ -629,7 +646,9 @@ public class JavadocParser extends AbstractCommentParser {
}
} else if (length == TAG_PROVIDES_LENGTH && CharOperation.equals(TAG_PROVIDES, tagName, 0, length)) {
this.tagValue = TAG_PROVIDES_VALUE;
- this.tagWaitingForDescription = this.tagValue;
+ if (!this.inlineTagStarted) {
+ valid = parseProvidesReference();
+ }
}
break;
case 'r':
@@ -677,7 +696,9 @@ public class JavadocParser extends AbstractCommentParser {
case 'u':
if (length == TAG_USES_LENGTH && CharOperation.equals(TAG_USES, tagName, 0, length)) {
this.tagValue = TAG_USES_VALUE;
- this.tagWaitingForDescription = this.tagValue;
+ if (!this.inlineTagStarted) {
+ valid = parseUsesReference();
+ }
}
break;
case 'v':
@@ -951,6 +972,18 @@ public class JavadocParser extends AbstractCommentParser {
System.arraycopy(this.invalidParamReferencesStack, 0, this.docComment.invalidParameters, 0, this.invalidParamReferencesPtr+1);
}
+ this.docComment.usesReferences = this.usesReferencesPtr >= 0 ? new IJavadocTypeReference[this.usesReferencesPtr+1] : NO_QUALIFIED_TYPE_REFERENCE;
+ for (int i = 0; i <= this.usesReferencesPtr; ++i) {
+ TypeReference ref = this.usesReferencesStack[i];
+ this.docComment.usesReferences[i] = (IJavadocTypeReference)ref;
+ }
+
+ this.docComment.providesReferences = this.providesReferencesPtr >= 0 ? new IJavadocTypeReference[this.providesReferencesPtr+1] : NO_QUALIFIED_TYPE_REFERENCE;
+ for (int i = 0; i <= this.providesReferencesPtr; ++i) {
+ TypeReference ref = this.providesReferencesStack[i];
+ this.docComment.providesReferences[i] = (IJavadocTypeReference)ref;
+ }
+
// If no nodes stored return
if (this.astLengthPtr == -1) {
return;
@@ -1013,4 +1046,78 @@ public class JavadocParser extends AbstractCommentParser {
System.arraycopy(this.docComment.paramTypeParameters, paramTypeParamPtr, this.docComment.paramTypeParameters = new JavadocSingleTypeReference[size - paramTypeParamPtr], 0, size - paramTypeParamPtr);
}
}
+
+ /*
+ * Parse @uses tag declaration
+ */
+ protected boolean parseUsesReference() {
+ int start = this.scanner.currentPosition;
+ try {
+ Object typeRef = parseQualifiedName(true);
+ if (this.abort) return false; // May be aborted by specialized parser
+ if (typeRef == null) {
+ if (this.reportProblems)
+ this.sourceParser.problemReporter().javadocMissingUsesClassName(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers);
+ } else {
+ return pushUsesReference(typeRef);
+ }
+ } catch (InvalidInputException ex) {
+ if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidUsesClass(start, getTokenEndPosition());
+ }
+ return false;
+ }
+
+ protected boolean pushUsesReference(Object typeRef) {
+ // TODO Auto-generated method stub
+ if (this.usesReferencesPtr == -1l) {
+ this.usesReferencesStack = new TypeReference[10];
+ }
+ int stackLength = this.usesReferencesStack.length;
+ if (++this.usesReferencesPtr >= stackLength) {
+ System.arraycopy(
+ this.usesReferencesStack, 0,
+ this.usesReferencesStack = new TypeReference[stackLength + AST_STACK_INCREMENT], 0,
+ stackLength);
+ }
+ this.usesReferencesStack[this.usesReferencesPtr] = (TypeReference)typeRef;
+ return true;
+ }
+
+ /*
+ * Parse @uses tag declaration
+ */
+ protected boolean parseProvidesReference() {
+ int start = this.scanner.currentPosition;
+ try {
+ Object typeRef = parseQualifiedName(true);
+ if (this.abort) return false; // May be aborted by specialized parser
+ if (typeRef == null) {
+ if (this.reportProblems)
+ this.sourceParser.problemReporter().javadocMissingProvidesClassName(this.tagSourceStart, this.tagSourceEnd, this.sourceParser.modifiers);
+ } else {
+ return pushProvidesReference(typeRef);
+ }
+ } catch (InvalidInputException ex) {
+ if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidProvidesClass(start, getTokenEndPosition());
+ }
+ return false;
+ }
+
+ protected boolean pushProvidesReference(Object typeRef) {
+ // TODO Auto-generated method stub
+ if (this.providesReferencesPtr == -1l) {
+ this.providesReferencesStack = new TypeReference[10];
+ }
+ int stackLength = this.providesReferencesStack.length;
+ if (++this.providesReferencesPtr >= stackLength) {
+ System.arraycopy(
+ this.providesReferencesStack, 0,
+ this.providesReferencesStack = new TypeReference[stackLength + AST_STACK_INCREMENT], 0,
+ stackLength);
+ }
+ this.providesReferencesStack[this.providesReferencesPtr] = (TypeReference)typeRef;
+ return true;
+
+ }
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index 767017428b..eaf03e2802 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -5975,6 +5975,9 @@ protected void consumeModuleHeader() {
}
protected void consumeModuleDeclaration() {
// ModuleDeclaration ::= ModuleHeader ModuleBody
+ this.compilationUnit.javadoc = this.javadoc;
+ this.javadoc = null;
+
int length = this.astLengthStack[this.astLengthPtr--];
int[] flag = new int[length + 1]; //plus one -- see <HERE>
int size1 = 0, size2 = 0, size3 = 0, size4 = 0, size5 = 0;
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 a980e1eda7..a4bd4de4d6 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
@@ -550,6 +550,14 @@ public static int getIrritant(int problemID) {
case IProblem.JavadocInvalidThrowsClassName:
case IProblem.JavadocDuplicateThrowsClassName:
case IProblem.JavadocMissingThrowsClassName:
+ case IProblem.JavadocDuplicateProvidesTag:
+ case IProblem.JavadocDuplicateUsesTag:
+ case IProblem.JavadocInvalidUsesClass:
+ case IProblem.JavadocInvalidUsesClassName:
+ case IProblem.JavadocInvalidProvidesClass:
+ case IProblem.JavadocInvalidProvidesClassName:
+ case IProblem.JavadocMissingProvidesClassName:
+ case IProblem.JavadocMissingUsesClassName:
case IProblem.JavadocMissingSeeReference:
case IProblem.JavadocInvalidValueReference:
case IProblem.JavadocUndefinedField:
@@ -593,8 +601,10 @@ public static int getIrritant(int problemID) {
return CompilerOptions.InvalidJavadoc;
case IProblem.JavadocMissingParamTag:
+ case IProblem.JavadocMissingProvidesTag:
case IProblem.JavadocMissingReturnTag:
case IProblem.JavadocMissingThrowsTag:
+ case IProblem.JavadocMissingUsesTag:
return CompilerOptions.MissingJavadocTags;
case IProblem.JavadocMissing:
@@ -5224,6 +5234,9 @@ public void javadocDuplicatedParamTag(char[] token, int sourceStart, int sourceE
sourceEnd);
}
}
+public void javadocDuplicatedProvidesTag(int sourceStart, int sourceEnd){
+ this.handle(IProblem.JavadocDuplicateProvidesTag, NoArgument, NoArgument, sourceStart, sourceEnd);
+}
public void javadocDuplicatedReturnTag(int sourceStart, int sourceEnd){
this.handle(IProblem.JavadocDuplicateReturnTag, NoArgument, NoArgument, sourceStart, sourceEnd);
}
@@ -5250,6 +5263,11 @@ public void javadocDuplicatedThrowsClassName(TypeReference typeReference, int mo
typeReference.sourceEnd);
}
}
+public void javadocDuplicatedUsesTag(
+
+ int sourceStart, int sourceEnd){
+ this.handle(IProblem.JavadocDuplicateUsesTag, NoArgument, NoArgument, sourceStart, sourceEnd);
+}
public void javadocEmptyReturnTag(int sourceStart, int sourceEnd, int modifiers) {
int severity = computeSeverity(IProblem.JavadocEmptyReturnTag);
if (severity == ProblemSeverities.Ignore) return;
@@ -5697,6 +5715,24 @@ public void javadocInvalidParamTagName(int sourceStart, int sourceEnd) {
public void javadocInvalidParamTypeParameter(int sourceStart, int sourceEnd) {
this.handle(IProblem.JavadocInvalidParamTagTypeParameter, NoArgument, NoArgument, sourceStart, sourceEnd);
}
+public void javadocInvalidProvidesClass(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocInvalidProvidesClass, NoArgument, NoArgument, sourceStart, sourceEnd);
+}
+
+public void javadocInvalidProvidesClassName(TypeReference typeReference, int modifiers) {
+ int severity = computeSeverity(IProblem.JavadocInvalidProvidesClassName);
+ if (severity == ProblemSeverities.Ignore) return;
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] {String.valueOf(typeReference.resolvedType.sourceName())};
+ this.handle(
+ IProblem.JavadocInvalidProvidesClassName,
+ arguments,
+ arguments,
+ severity,
+ typeReference.sourceStart,
+ typeReference.sourceEnd);
+ }
+}
public void javadocInvalidReference(int sourceStart, int sourceEnd) {
this.handle(IProblem.JavadocInvalidSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
}
@@ -5775,6 +5811,24 @@ public void javadocInvalidType(ASTNode location, TypeBinding type, int modifiers
location.sourceEnd);
}
}
+public void javadocInvalidUsesClass(int sourceStart, int sourceEnd) {
+ this.handle(IProblem.JavadocInvalidUsesClass, NoArgument, NoArgument, sourceStart, sourceEnd);
+}
+
+public void javadocInvalidUsesClassName(TypeReference typeReference, int modifiers) {
+ int severity = computeSeverity(IProblem.JavadocInvalidUsesClassName);
+ if (severity == ProblemSeverities.Ignore) return;
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ String[] arguments = new String[] {String.valueOf(typeReference.resolvedType.sourceName())};
+ this.handle(
+ IProblem.JavadocInvalidUsesClassName,
+ arguments,
+ arguments,
+ severity,
+ typeReference.sourceStart,
+ typeReference.sourceEnd);
+ }
+}
public void javadocInvalidValueReference(int sourceStart, int sourceEnd, int modifiers) {
if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers))
this.handle(IProblem.JavadocInvalidValueReference, NoArgument, NoArgument, sourceStart, sourceEnd);
@@ -5805,6 +5859,20 @@ public void javadocMissing(int sourceStart, int sourceEnd, int severity, int mod
}
}
}
+public void javadocModuleMissing(int sourceStart, int sourceEnd, int severity){
+ if (severity == ProblemSeverities.Ignore) return;
+ boolean report = this.options.getSeverity(CompilerOptions.MissingJavadocComments) != ProblemSeverities.Ignore;
+ if (report) {
+ String[] arguments = new String[] { "module" }; //$NON-NLS-1$
+ this.handle(
+ IProblem.JavadocMissing,
+ arguments,
+ arguments,
+ severity,
+ sourceStart,
+ sourceEnd);
+ }
+}
public void javadocMissingHashCharacter(int sourceStart, int sourceEnd, String ref){
int severity = computeSeverity(IProblem.JavadocMissingHashCharacter);
if (severity == ProblemSeverities.Ignore) return;
@@ -5842,6 +5910,26 @@ public void javadocMissingParamTag(char[] name, int sourceStart, int sourceEnd,
sourceEnd);
}
}
+public void javadocMissingProvidesClassName(int sourceStart, int sourceEnd, int modifiers){
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ this.handle(IProblem.JavadocMissingProvidesClassName, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+}
+public void javadocMissingProvidesTag(TypeReference typeRef, int sourceStart, int sourceEnd, int modifiers){
+ int severity = computeSeverity(IProblem.JavadocMissingProvidesTag);
+ if (severity == ProblemSeverities.Ignore) return;
+ boolean report = this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore;
+ if (report) {
+ String[] arguments = new String[] { String.valueOf(typeRef.resolvedType.sourceName()) };
+ this.handle(
+ IProblem.JavadocMissingProvidesTag,
+ arguments,
+ arguments,
+ severity,
+ sourceStart,
+ sourceEnd);
+ }
+}
public void javadocMissingReference(int sourceStart, int sourceEnd, int modifiers){
if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers))
this.handle(IProblem.JavadocMissingSeeReference, NoArgument, NoArgument, sourceStart, sourceEnd);
@@ -5892,6 +5980,27 @@ public void javadocMissingThrowsTag(TypeReference typeRef, int modifiers){
typeRef.sourceEnd);
}
}
+public void javadocMissingUsesClassName(int sourceStart, int sourceEnd, int modifiers){
+ if (javadocVisibility(this.options.reportInvalidJavadocTagsVisibility, modifiers)) {
+ this.handle(IProblem.JavadocMissingUsesClassName, NoArgument, NoArgument, sourceStart, sourceEnd);
+ }
+}
+
+public void javadocMissingUsesTag(TypeReference typeRef, int sourceStart, int sourceEnd, int modifiers){
+ int severity = computeSeverity(IProblem.JavadocMissingUsesTag);
+ if (severity == ProblemSeverities.Ignore) return;
+ boolean report = this.options.getSeverity(CompilerOptions.MissingJavadocTags) != ProblemSeverities.Ignore;
+ if (report) {
+ String[] arguments = new String[] { String.valueOf(typeRef.resolvedType.sourceName()) };
+ this.handle(
+ IProblem.JavadocMissingUsesTag,
+ arguments,
+ arguments,
+ severity,
+ sourceStart,
+ sourceEnd);
+ }
+}
public void javadocUndeclaredParamTagName(char[] token, int sourceStart, int sourceEnd, int modifiers) {
int severity = computeSeverity(IProblem.JavadocInvalidParamName);
if (severity == ProblemSeverities.Ignore) return;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index 0c08f72ab4..ae5858c5dd 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -1032,6 +1032,18 @@
1738 = The body of a compact constructor must not contain a return statement
# Java 14 Preview - end
+# Additional doc
+1800 = Missing uses tag
+1801 = Duplicate uses tag
+1802 = Missing uses class name
+1803 = Invalid uses class name
+1804 = Invalid uses class
+1805 = Missing provides tag
+1806 = Duplicate provides tag
+1807 = Missing provides class name
+1808 = Invalid provides class name
+1809 = Invalid provides class
+
### ELABORATIONS
## Access restrictions
78592 = The type ''{1}'' is not API (restriction on classpath entry ''{0}'')
diff --git a/org.eclipse.jdt.core/forceQualifierUpdate.txt b/org.eclipse.jdt.core/forceQualifierUpdate.txt
index fa0a0ab832..822526d15a 100644
--- a/org.eclipse.jdt.core/forceQualifierUpdate.txt
+++ b/org.eclipse.jdt.core/forceQualifierUpdate.txt
@@ -6,3 +6,4 @@ Bug 408447 - compiler (log message) needs updating for copyright and bundle_qual
Several bundles changed and need to be touched
Bug 418646 - org.eclipse.jdt.core does not provide an artifact with classifier 'antadapter'
Bug 436266 - Use RC3 (plus) version of JDT compiler to build RC4
+Bug 551547 - The library org.eclipse.jdt.core.compiler.batch_*.jar should be signed \ No newline at end of file
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 31f10d7a03..a7dbea666e 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
@@ -1396,6 +1396,18 @@ public class DefaultCodeFormatterConstants {
* @since 3.1
*/
public final static String FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS = "org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"; //$NON-NLS-1$
+ /**
+ * <pre>
+ * FORMATTER / Option to insert an empty line between Javadoc tags of different type
+ * - option id: "org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags"
+ * - possible values: { INSERT, DO_NOT_INSERT }
+ * - default: INSERT
+ * </pre>
+ * @see JavaCore#INSERT
+ * @see JavaCore#DO_NOT_INSERT
+ * @since 3.20
+ */
+ public final static String FORMATTER_COMMENT_INSERT_EMPTY_LINE_BETWEEN_DIFFERENT_TAGS = "org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags"; //$NON-NLS-1$
/**
* <pre>
@@ -3119,6 +3131,18 @@ public class DefaultCodeFormatterConstants {
public static final String FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR = JavaCore.PLUGIN_ID + ".formatter.insert_space_after_unary_operator"; //$NON-NLS-1$
/**
* <pre>
+ * FORMATTER / Option to insert a space after 'not' operator
+ * - option id: "org.eclipse.jdt.core.formatter.insert_space_after_not_operator"
+ * - possible values: { INSERT, DO_NOT_INSERT }
+ * - default: DO_NOT_INSERT
+ * </pre>
+ * @see JavaCore#INSERT
+ * @see JavaCore#DO_NOT_INSERT
+ * @since 3.20
+ */
+ public static final String FORMATTER_INSERT_SPACE_AFTER_NOT_OPERATOR = JavaCore.PLUGIN_ID + ".formatter.insert_space_after_not_operator"; //$NON-NLS-1$
+ /**
+ * <pre>
* FORMATTER / Option to insert a space before and in wildcard
* - option id: "org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter"
* - possible values: { INSERT, DO_NOT_INSERT }
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
index 85d047ec6e..c9be5d93ae 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CommentsPreparator.java
@@ -33,7 +33,7 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
+import java.util.stream.Collectors;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.BlockComment;
@@ -109,7 +109,7 @@ public class CommentsPreparator extends ASTVisitor {
private int noFormatTagOpenStart = -1;
private int formatCodeTagOpenEnd = -1;
private int lastFormatCodeClosingTagIndex = -1;
- private Token firstTagToken;
+ private ArrayList<Integer> commonAttributeAnnotations = new ArrayList<Integer>();
private DefaultCodeFormatter commentCodeFormatter;
public CommentsPreparator(TokenManager tm, DefaultCodeFormatterOptions options, String sourceLevel) {
@@ -536,7 +536,7 @@ public class CommentsPreparator extends ASTVisitor {
this.noFormatTagOpenStart = -1;
this.formatCodeTagOpenEnd = -1;
this.lastFormatCodeClosingTagIndex = -1;
- this.firstTagToken = null;
+ this.commonAttributeAnnotations.clear();
this.ctm = null;
int commentIndex = this.tm.firstIndexIn(node, TokenNameCOMMENT_JAVADOC);
@@ -564,6 +564,7 @@ public class CommentsPreparator extends ASTVisitor {
this.ctm = new TokenManager(commentToken.getInternalStructure(), this.tm);
handleJavadocTagAlignment(node);
+ handleJavadocBlankLines(node);
return true;
}
@@ -572,10 +573,6 @@ public class CommentsPreparator extends ASTVisitor {
public void endVisit(Javadoc node) {
if (this.ctm == null)
return;
- if (this.options.comment_insert_empty_line_before_root_tags && this.firstTagToken != null
- && this.ctm.indexOf(this.firstTagToken) > 1) {
- this.firstTagToken.putLineBreaksBefore(2);
- }
addSubstituteWraps();
}
@@ -599,10 +596,6 @@ public class CommentsPreparator extends ASTVisitor {
Token startTokeen = this.ctm.get(startIndex);
if (startIndex > 1)
startTokeen.breakBefore();
- int firstTagIndex;
- if (this.firstTagToken == null || (firstTagIndex = this.ctm.indexOf(this.firstTagToken)) < 0
- || startIndex < firstTagIndex)
- this.firstTagToken = startTokeen;
handleHtml(node);
}
@@ -697,6 +690,35 @@ public class CommentsPreparator extends ASTVisitor {
}
}
}
+
+ private void handleJavadocBlankLines(Javadoc node) {
+ List<TagElement> tagElements = node.tags();
+ List<Integer> tagIndexes = tagElements.stream()
+ .filter(t -> !t.isNested() && t.getTagName() != null && t.getTagName().length() > 1)
+ .map(t -> tokenStartingAt(t.getStartPosition()))
+ .collect(Collectors.toList());
+ tagIndexes.addAll(this.commonAttributeAnnotations);
+ Collections.sort(tagIndexes);
+
+ String previousName = null;
+ if (!tagIndexes.isEmpty()) {
+ int firstIndex = tagIndexes.get(0);
+ previousName = this.ctm.toString(firstIndex);
+ if (this.options.comment_insert_empty_line_before_root_tags && firstIndex > 1)
+ this.ctm.get(firstIndex).putLineBreaksBefore(2);
+ }
+ if (this.options.comment_insert_empty_line_between_different_tags) {
+ for (int i = 1; i < tagIndexes.size(); i++) {
+ Token tagToken = this.ctm.get(tagIndexes.get(i));
+ String thisName = this.tm.toString(tagToken);
+ boolean sameType = previousName.equals(thisName)
+ || (isCommonsAttributeAnnotation(previousName) && isCommonsAttributeAnnotation(thisName));
+ if (!sameType)
+ tagToken.putLineBreaksBefore(2);
+ previousName = thisName;
+ }
+ }
+ }
private void alignJavadocTag(List<Token> tagTokens, int paramNameAlign, int descriptionAlign) {
Token paramName = tagTokens.get(1);
@@ -1066,11 +1088,12 @@ public class CommentsPreparator extends ASTVisitor {
if (this.tm.charAt(tokenStart) == '@') {
outputToken.setWrapPolicy(WrapPolicy.DISABLE_WRAP);
if (commentToken.tokenType == TokenNameCOMMENT_BLOCK && lineBreaks == 1
- && structure.size() > 1)
+ && structure.size() > 1) {
outputToken.putLineBreaksBefore(cleanBlankLines ? 1 : 2);
- if (this.tm.charAt(tokenStart + 1) == '@' && lineBreaks > 0 && this.firstTagToken == null) {
- // Commons Attributes annotation, see bug 237051
- this.firstTagToken = outputToken;
+ }
+ if (lineBreaks > 0 && isCommonsAttributeAnnotation(this.tm.toString(outputToken))) {
+ outputToken.breakBefore();
+ this.commonAttributeAnnotations.add(structure.size());
}
}
structure.add(outputToken);
@@ -1103,6 +1126,10 @@ public class CommentsPreparator extends ASTVisitor {
return true;
}
+ private boolean isCommonsAttributeAnnotation(String tokenContent) {
+ return tokenContent.startsWith("@@"); //$NON-NLS-1$
+ }
+
private void noSubstituteWrapping(int from, int to) {
int commentStart = this.ctm.get(0).originalStart;
assert commentStart <= from && from <= to && to <= this.ctm.get(this.ctm.size() - 1).originalEnd;
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 1828844fcc..99b5de47da 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
@@ -229,6 +229,7 @@ public class DefaultCodeFormatterOptions {
public boolean comment_align_tags_names_descriptions;
public boolean comment_align_tags_descriptions_grouped;
public boolean comment_insert_empty_line_before_root_tags;
+ public boolean comment_insert_empty_line_between_different_tags;
public boolean comment_insert_new_line_for_parameter;
public boolean comment_preserve_white_space_between_code_and_line_comments;
public int comment_line_length;
@@ -326,6 +327,7 @@ public class DefaultCodeFormatterOptions {
public boolean insert_space_after_comma_in_type_parameters;
public boolean insert_space_after_ellipsis;
public boolean insert_space_after_lambda_arrow;
+ public boolean insert_space_after_not_operator;
public boolean insert_space_after_opening_angle_bracket_in_parameterized_type_reference;
public boolean insert_space_after_opening_angle_bracket_in_type_arguments;
public boolean insert_space_after_opening_angle_bracket_in_type_parameters;
@@ -600,6 +602,7 @@ public class DefaultCodeFormatterOptions {
options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_ALIGN_TAGS_NAMES_DESCRIPTIONS, this.comment_align_tags_names_descriptions ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_ALIGN_TAGS_DESCREIPTIONS_GROUPED, this.comment_align_tags_descriptions_grouped ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, this.comment_insert_empty_line_before_root_tags ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
+ options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BETWEEN_DIFFERENT_TAGS, this.comment_insert_empty_line_between_different_tags ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER, this.comment_insert_new_line_for_parameter ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, this.comment_preserve_white_space_between_code_and_line_comments ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length));
@@ -709,6 +712,7 @@ public class DefaultCodeFormatterOptions {
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_after_opening_bracket_in_array_allocation_expression? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, this.insert_space_after_ellipsis ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_LAMBDA_ARROW, this.insert_space_after_lambda_arrow ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
+ options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_NOT_OPERATOR, this.insert_space_after_not_operator? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_after_opening_angle_bracket_in_type_arguments? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_after_opening_angle_bracket_in_type_parameters? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
@@ -1479,6 +1483,8 @@ public class DefaultCodeFormatterOptions {
if (commentInsertEmptyLineBeforeRootTagsOption != null) {
this.comment_insert_empty_line_before_root_tags = JavaCore.INSERT.equals(commentInsertEmptyLineBeforeRootTagsOption);
}
+ setBoolean(settings, DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BETWEEN_DIFFERENT_TAGS, JavaCore.INSERT,
+ v -> this.comment_insert_empty_line_between_different_tags = v);
final Object commentInsertNewLineForParameterOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER);
if (commentInsertNewLineForParameterOption != null) {
this.comment_insert_new_line_for_parameter = JavaCore.INSERT.equals(commentInsertNewLineForParameterOption);
@@ -1774,6 +1780,8 @@ public class DefaultCodeFormatterOptions {
if (insertSpaceAfterLambdaArrowOption != null) {
this.insert_space_after_lambda_arrow = JavaCore.INSERT.equals(insertSpaceAfterLambdaArrowOption);
}
+ setBoolean(settings, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_NOT_OPERATOR, JavaCore.INSERT,
+ v -> this.insert_space_after_not_operator = v);
final Object insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE);
if (insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption != null) {
this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = JavaCore.INSERT.equals(insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption);
@@ -2787,6 +2795,10 @@ public class DefaultCodeFormatterOptions {
setInt(settings, DefaultCodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD,
v -> this.blank_lines_before_abstract_method = v);
}
+ if (!settings.containsKey(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_NOT_OPERATOR)) {
+ setBoolean(settings, DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR, JavaCore.INSERT,
+ v -> this.insert_space_after_not_operator = v);
+ }
}
public void setDefaultSettings() {
@@ -2869,6 +2881,7 @@ public class DefaultCodeFormatterOptions {
this.comment_align_tags_names_descriptions = false;
this.comment_align_tags_descriptions_grouped = false;
this.comment_insert_empty_line_before_root_tags = true;
+ this.comment_insert_empty_line_between_different_tags = false;
this.comment_insert_new_line_for_parameter = true;
this.comment_new_lines_at_block_boundaries = true;
this.comment_new_lines_at_javadoc_boundaries = true;
@@ -2978,6 +2991,7 @@ public class DefaultCodeFormatterOptions {
this.insert_space_after_comma_in_type_parameters = true;
this.insert_space_after_ellipsis = true;
this.insert_space_after_lambda_arrow = true;
+ this.insert_space_after_not_operator = false;
this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false;
this.insert_space_after_opening_angle_bracket_in_type_arguments = false;
this.insert_space_after_opening_angle_bracket_in_type_parameters = false;
@@ -3234,6 +3248,7 @@ public class DefaultCodeFormatterOptions {
this.comment_align_tags_names_descriptions = false;
this.comment_align_tags_descriptions_grouped = true;
this.comment_insert_empty_line_before_root_tags = true;
+ this.comment_insert_empty_line_between_different_tags = false;
this.comment_insert_new_line_for_parameter = false;
this.comment_new_lines_at_block_boundaries = true;
this.comment_new_lines_at_javadoc_boundaries = true;
@@ -3341,6 +3356,7 @@ public class DefaultCodeFormatterOptions {
this.insert_space_after_comma_in_type_parameters = true;
this.insert_space_after_ellipsis = true;
this.insert_space_after_lambda_arrow = true;
+ this.insert_space_after_not_operator = false;
this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false;
this.insert_space_after_opening_angle_bracket_in_type_arguments = false;
this.insert_space_after_opening_angle_bracket_in_type_parameters = false;
diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
index 771f600255..ed85e6593b 100644
--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/SpacePreparator.java
@@ -811,8 +811,13 @@ public class SpacePreparator extends ASTVisitor {
handleOperator(operator.toString(), node.getOperand(),
this.options.insert_space_before_prefix_operator,
this.options.insert_space_after_prefix_operator);
+ } else if (operator.equals(PrefixExpression.Operator.NOT)) {
+ handleOperator(operator.toString(), node.getOperand(),
+ this.options.insert_space_before_unary_operator,
+ this.options.insert_space_after_not_operator);
} else {
- handleOperator(operator.toString(), node.getOperand(), this.options.insert_space_before_unary_operator,
+ handleOperator(operator.toString(), node.getOperand(),
+ this.options.insert_space_before_unary_operator,
this.options.insert_space_after_unary_operator);
}
return true;
diff --git a/org.eclipse.jdt.core/jdtCompilerAdapter.jar b/org.eclipse.jdt.core/jdtCompilerAdapter.jar
index f5a110881e..dd21253fb9 100644
--- a/org.eclipse.jdt.core/jdtCompilerAdapter.jar
+++ b/org.eclipse.jdt.core/jdtCompilerAdapter.jar
Binary files differ
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
index 7844e0a50f..f4b786b704 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
@@ -956,6 +956,15 @@ protected boolean writeClassFileCheck(IFile file, String fileName, byte[] newByt
addDependentsOf(new Path(fileName), true);
this.newState.wasStructurallyChanged(fileName);
}
+ } catch (JavaModelException jme) {
+ Throwable e = jme.getCause();
+ if (e instanceof CoreException) {
+ // assuming a ResourceException during IFile.getContents(), treat it like a corrupt file
+ addDependentsOf(new Path(fileName), true);
+ this.newState.wasStructurallyChanged(fileName);
+ } else {
+ throw jme;
+ }
} catch (ClassFormatException e) {
addDependentsOf(new Path(fileName), true);
this.newState.wasStructurallyChanged(fileName);

Back to the top