Skip to content

Commit 6a3580e

Browse files
nb-javac merge with jdk-16 (#13)
* Integrated with JDK-16 to support new features
1 parent 50ebbca commit 6a3580e

File tree

231 files changed

+11721
-3588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+11721
-3588
lines changed

make/langtools/netbeans/nb-javac/nbproject/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ javac.test.classpath=\
104104
${build.dir}/lib/hamcrest-core-1.3.jar
105105
debug.classpath=${run.classpath}
106106
jnlp.enabled=false
107-
nb-javac-ver=15.0.0.2
107+
nb-javac-ver=16

make/langtools/netbeans/nb-javac/test/com/sun/tools/javac/parser/DocCommentParserTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public void test229725() throws IOException {
111111

112112
public void testInlineSpan() throws IOException {
113113
doTestErrorRecovery("{@literal code}\n",
114-
"DOC_COMMENT:{@literal code}",
115-
"LITERAL:{@literal code}",
114+
"DOC_COMMENT:{@literal code}\n",
115+
"LITERAL:{@literal code}\n",
116116
"TEXT:code"
117117
);
118118
}

make/langtools/netbeans/nb-javac/test/com/sun/tools/javac/parser/JavacParserTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public void testVariableInIfThen3() throws IOException {
545545
codes.add(d.getCode());
546546
}
547547

548-
assertEquals(Arrays.<String>asList("compiler.err.expected3"), codes);//TODO: was "compiler.err.illegal.start.of.expr" before JDK8 merge
548+
assertEquals(Arrays.<String>asList("compiler.err.expected4"), codes);//TODO: was "compiler.err.illegal.start.of.expr" before JDK8 merge
549549
// assertEquals(Arrays.<String>asList("compiler.err.illegal.start.of.expr"), codes);
550550
}
551551

src/java.compiler/share/classes/javax/annotation/processing/AbstractProcessor.java

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,9 +39,9 @@
3939
* superclass for most concrete annotation processors. This class
4040
* examines annotation values to compute the {@linkplain
4141
* #getSupportedOptions options}, {@linkplain
42-
* #getSupportedAnnotationTypes annotation types}, and {@linkplain
43-
* #getSupportedSourceVersion source version} supported by its
44-
* subtypes.
42+
* #getSupportedAnnotationTypes annotation interfaces}, and
43+
* {@linkplain #getSupportedSourceVersion source version} supported by
44+
* its subtypes.
4545
*
4646
* <p>The getter methods may {@linkplain Messager#printMessage issue
4747
* warnings} about noteworthy conditions using the facilities available
@@ -98,8 +98,8 @@ public Set<String> getSupportedOptions() {
9898
* then any leading {@linkplain Processor#getSupportedAnnotationTypes
9999
* module prefixes} are stripped from the names.
100100
*
101-
* @return the names of the annotation types supported by this
102-
* processor, or an empty set if none
101+
* @return the names of the annotation interfaces supported by
102+
* this processor, or an empty set if none
103103
*/
104104
public Set<String> getSupportedAnnotationTypes() {
105105
SupportedAnnotationTypes sat = this.getClass().getAnnotation(SupportedAnnotationTypes.class);
@@ -171,7 +171,7 @@ public abstract boolean process(Set<? extends TypeElement> annotations,
171171
RoundEnvironment roundEnv);
172172

173173
/**
174-
* Returns an empty iterable of completions.
174+
* {@return an empty iterable of completions}
175175
*
176176
* @param element {@inheritDoc}
177177
* @param annotation {@inheritDoc}
@@ -186,11 +186,8 @@ public Iterable<? extends Completion> getCompletions(Element element,
186186
}
187187

188188
/**
189-
* Returns {@code true} if this object has been {@linkplain #init
190-
* initialized}, {@code false} otherwise.
191-
*
192-
* @return {@code true} if this object has been initialized,
193-
* {@code false} otherwise.
189+
* {@return {@code true} if this object has been {@linkplain #init
190+
* initialized}, {@code false} otherwise}
194191
*/
195192
protected synchronized boolean isInitialized() {
196193
return initialized;

src/java.compiler/share/classes/javax/annotation/processing/Completion.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,14 +38,12 @@
3838
public interface Completion {
3939

4040
/**
41-
* Returns the text of the suggested completion.
42-
* @return the text of the suggested completion.
41+
* {@return the text of the suggested completion}
4342
*/
4443
String getValue();
4544

4645
/**
47-
* Returns an informative message about the completion.
48-
* @return an informative message about the completion.
46+
* {@return an informative message about the completion}
4947
*/
5048
String getMessage();
5149
}

src/java.compiler/share/classes/javax/annotation/processing/Completions.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -65,21 +65,19 @@ public String toString() {
6565
}
6666

6767
/**
68-
* Returns a completion of the value and message.
68+
* {@return a completion of the value and message}
6969
*
7070
* @param value the text of the completion
7171
* @param message a message about the completion
72-
* @return a completion of the provided value and message
7372
*/
7473
public static Completion of(String value, String message) {
7574
return new SimpleCompletion(value, message);
7675
}
7776

7877
/**
79-
* Returns a completion of the value and an empty message
78+
* {@return a completion of the value and an empty message}
8079
*
8180
* @param value the text of the completion
82-
* @return a completion of the value and an empty message
8381
*/
8482
public static Completion of(String value) {
8583
return new SimpleCompletion(value, "");

src/java.compiler/share/classes/javax/annotation/processing/Filer.java

+32-29
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
* <p>The file creation methods take a variable number of arguments to
6767
* allow the <em>originating elements</em> to be provided as hints to
6868
* the tool infrastructure to better manage dependencies. The
69-
* originating elements are the types or packages (representing {@code
70-
* package-info} files) or modules (representing {@code
71-
* module-info} files) which caused an annotation processor to
69+
* originating elements are the classes or interfaces or packages
70+
* (representing {@code package-info} files) or modules (representing
71+
* {@code module-info} files) which caused an annotation processor to
7272
* attempt to create a new file. For example, if an annotation
7373
* processor tries to create a source file, {@code
7474
* GeneratedFromUserSource}, in response to processing
@@ -107,14 +107,15 @@
107107
* <p> In general, processors must not knowingly attempt to overwrite
108108
* existing files that were not generated by some processor. A {@code
109109
* Filer} may reject attempts to open a file corresponding to an
110-
* existing type, like {@code java.lang.Object}. Likewise, the
110+
* existing class or interface, like {@code java.lang.Object}. Likewise, the
111111
* invoker of the annotation processing tool must not knowingly
112112
* configure the tool such that the discovered processors will attempt
113113
* to overwrite existing files that were not generated.
114114
*
115115
* <p> Processors can indicate a source or class file is generated by
116-
* including a {@link javax.annotation.processing.Generated} annotation if the
117-
* environment is configured so that that type is accessible.
116+
* including a {@link javax.annotation.processing.Generated}
117+
* annotation if the environment is configured so that that class or
118+
* interface is accessible.
118119
*
119120
* @apiNote Some of the effect of overwriting a file can be
120121
* achieved by using a <i>decorator</i>-style pattern. Instead of
@@ -133,18 +134,18 @@
133134
public interface Filer {
134135
/**
135136
* Creates a new source file and returns an object to allow
136-
* writing to it. A source file for a type, or a package can
137-
* be created.
137+
* writing to it. A source file for a class, interface, or a
138+
* package can be created.
138139
*
139140
* The file's name and path (relative to the {@linkplain
140141
* StandardLocation#SOURCE_OUTPUT root output location for source
141142
* files}) are based on the name of the item to be declared in
142143
* that file as well as the specified module for the item (if
143144
* any).
144145
*
145-
* If more than one type is being declared in a single file (that
146+
* If more than one class or interface is being declared in a single file (that
146147
* is, a single compilation unit), the name of the file should
147-
* correspond to the name of the principal top-level type (the
148+
* correspond to the name of the principal top-level class or interface (the
148149
* public one, for example).
149150
*
150151
* <p>A source file can also be created to hold information about
@@ -155,7 +156,7 @@ public interface Filer {
155156
*
156157
* <p>The optional module name is prefixed to the type name or
157158
* package name and separated using a "{@code /}" character. For
158-
* example, to create a source file for type {@code a.B} in module
159+
* example, to create a source file for class {@code a.B} in module
159160
* {@code foo}, use a {@code name} argument of {@code "foo/a.B"}.
160161
*
161162
* <p>If no explicit module prefix is given and modules are supported
@@ -164,7 +165,7 @@ public interface Filer {
164165
* An implementation may use information about the configuration of
165166
* the annotation processing tool as part of the inference.
166167
*
167-
* <p>Creating a source file in or for an unnamed package in a named
168+
* <p>Creating a source file in or for an <em>unnamed</em> package in a <em>named</em>
168169
* module is <em>not</em> supported.
169170
*
170171
* @apiNote To use a particular {@linkplain
@@ -194,15 +195,15 @@ public interface Filer {
194195
* as the target module. A separate option may be used to provide the target
195196
* module if it cannot be determined using the above rules.
196197
*
197-
* @param name canonical (fully qualified) name of the principal type
198+
* @param name canonical (fully qualified) name of the principal class or interface
198199
* being declared in this file or a package name followed by
199200
* {@code ".package-info"} for a package information file
200-
* @param originatingElements type or package or module elements causally
201-
* associated with the creation of this file, may be elided or
202-
* {@code null}
201+
* @param originatingElements class, interface, package, or module
202+
* elements causally associated with the creation of this file,
203+
* may be elided or {@code null}
203204
* @return a {@code JavaFileObject} to write the new source file
204205
* @throws FilerException if the same pathname has already been
205-
* created, the same type has already been created, the name is
206+
* created, the same class or interface has already been created, the name is
206207
* otherwise not valid for the entity requested to being created,
207208
* if the target module cannot be determined, if the target
208209
* module is not writable, or a module is specified when the environment
@@ -215,7 +216,7 @@ JavaFileObject createSourceFile(CharSequence name,
215216

216217
/**
217218
* Creates a new class file, and returns an object to allow
218-
* writing to it. A class file for a type, or a package can
219+
* writing to it. A class file for a class, interface, or a package can
219220
* be created.
220221
*
221222
* The file's name and path (relative to the {@linkplain
@@ -231,7 +232,7 @@ JavaFileObject createSourceFile(CharSequence name,
231232
*
232233
* <p>The optional module name is prefixed to the type name or
233234
* package name and separated using a "{@code /}" character. For
234-
* example, to create a class file for type {@code a.B} in module
235+
* example, to create a class file for class {@code a.B} in module
235236
* {@code foo}, use a {@code name} argument of {@code "foo/a.B"}.
236237
*
237238
* <p>If no explicit module prefix is given and modules are supported
@@ -240,7 +241,7 @@ JavaFileObject createSourceFile(CharSequence name,
240241
* An implementation may use information about the configuration of
241242
* the annotation processing tool as part of the inference.
242243
*
243-
* <p>Creating a class file in or for an unnamed package in a named
244+
* <p>Creating a class file in or for an <em>unnamed</em> package in a <em>named</em>
244245
* module is <em>not</em> supported.
245246
*
246247
* @apiNote To avoid subsequent errors, the contents of the class
@@ -259,15 +260,16 @@ JavaFileObject createSourceFile(CharSequence name,
259260
* as the target module. A separate option may be used to provide the target
260261
* module if it cannot be determined using the above rules.
261262
*
262-
* @param name binary name of the type being written or a package name followed by
263-
* {@code ".package-info"} for a package information file
264-
* @param originatingElements type or package or module elements causally
265-
* associated with the creation of this file, may be elided or
266-
* {@code null}
263+
* @param name binary name of the class or interface being written
264+
* or a package name followed by {@code ".package-info"} for a
265+
* package information file
266+
* @param originatingElements class or interface or package or
267+
* module elements causally associated with the creation of this
268+
* file, may be elided or {@code null}
267269
* @return a {@code JavaFileObject} to write the new class file
268270
* @throws FilerException if the same pathname has already been
269-
* created, the same type has already been created, the name is
270-
* not valid for a type, if the target module cannot be determined,
271+
* created, the same class or interface has already been created, the name is
272+
* not valid for a class or interface, if the target module cannot be determined,
271273
* if the target module is not writable, or a module is specified when
272274
* the environment doesn't support modules.
273275
* @throws IOException if the file cannot be created
@@ -330,8 +332,9 @@ JavaFileObject createClassFile(CharSequence name,
330332
* @param moduleAndPkg module and/or package relative to which the file
331333
* should be named, or the empty string if none
332334
* @param relativeName final pathname components of the file
333-
* @param originatingElements type or package or module elements causally
334-
* associated with the creation of this file, may be elided or
335+
* @param originatingElements class or interface or package or
336+
* module elements causally associated with the creation of this
337+
* file, may be elided or
335338
* {@code null}
336339
* @return a {@code FileObject} to write the new resource
337340
* @throws IOException if the file cannot be created

src/java.compiler/share/classes/javax/annotation/processing/FilerException.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,9 @@
3131
* Indicates a {@link Filer} detected an attempt to open a file that
3232
* would violate the guarantees provided by the {@code Filer}. Those
3333
* guarantees include not creating the same file more than once, not
34-
* creating multiple files corresponding to the same type or package, and not
35-
* creating files for types with invalid names.
34+
* creating multiple files corresponding to the same class or
35+
* interface or package, and not creating files for classes or
36+
* interfaces with invalid names.
3637
*
3738
* @author Joseph D. Darcy
3839
* @author Scott Seligman

0 commit comments

Comments
 (0)