Skip to content

Commit 9a21460

Browse files
cpovirkCompile-Testing Team
authored andcommitted
Fix Javadoc problems under JDK 21.
This prepares for [a release](#499 (comment)), possibly the first non-snapshot release we'll have made for one of our projects after the OSSRH->Central migration? RELNOTES=n/a PiperOrigin-RevId: 802247571
1 parent 6d8ea27 commit 9a21460

File tree

2 files changed

+29
-31
lines changed

2 files changed

+29
-31
lines changed

pom.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@
140140
<configuration>
141141
<additionalJOptions>
142142
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</additionalJOption>
143+
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</additionalJOption>
144+
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</additionalJOption>
143145
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</additionalJOption>
146+
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</additionalJOption>
144147
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</additionalJOption>
145148
</additionalJOptions>
146149
</configuration>
@@ -253,11 +256,11 @@
253256
<properties>
254257
<test.jvm.flags>
255258
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
256-
--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
257-
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
258259
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
260+
--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
259261
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
260262
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
263+
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
261264
</test.jvm.flags>
262265
</properties>
263266
</profile>

src/main/java/com/google/testing/compile/CompileTester.java

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
import com.google.common.io.ByteSource;
1919
import com.google.errorprone.annotations.CanIgnoreReturnValue;
20-
2120
import java.nio.charset.Charset;
22-
2321
import javax.tools.Diagnostic;
2422
import javax.tools.JavaFileManager;
2523
import javax.tools.JavaFileObject;
@@ -44,8 +42,7 @@ public interface CompileTester {
4442
SuccessfulCompilationClause compilesWithoutError();
4543

4644
/**
47-
* The clause in the fluent API that tests for successful compilation without warnings or
48-
* errors.
45+
* The clause in the fluent API that tests for successful compilation without warnings or errors.
4946
*/
5047
@CanIgnoreReturnValue
5148
CleanCompilationClause compilesWithoutWarnings();
@@ -57,7 +54,7 @@ public interface CompileTester {
5754
/**
5855
* The clause in the fluent API that allows for chaining test conditions.
5956
*
60-
* @param T the clause type returned by {@link #and()}
57+
* @param <T> the clause type returned by {@link #and()}
6158
*/
6259
public interface ChainingClause<T> {
6360
T and();
@@ -66,12 +63,12 @@ public interface ChainingClause<T> {
6663
/**
6764
* The clause in the fluent API that checks notes in a compilation.
6865
*
69-
* @param T the non-generic clause type implementing this interface
66+
* @param <T> the non-generic clause type implementing this interface
7067
*/
7168
public interface CompilationWithNotesClause<T> {
7269
/**
73-
* Checks that a note exists that contains the given fragment in the
74-
* {@linkplain Diagnostic#getMessage(java.util.Locale) diagnostic message}.
70+
* Checks that a note exists that contains the given fragment in the {@linkplain
71+
* Diagnostic#getMessage(java.util.Locale) diagnostic message}.
7572
*/
7673
@CanIgnoreReturnValue
7774
FileClause<T> withNoteContaining(String messageFragment);
@@ -87,13 +84,13 @@ public interface CompilationWithNotesClause<T> {
8784
/**
8885
* The clause in the fluent API that checks notes and warnings in a compilation.
8986
*
90-
* @param T the non-generic clause type implementing this interface
87+
* @param <T> the non-generic clause type implementing this interface
9188
*/
9289
public interface CompilationWithWarningsClause<T> extends CompilationWithNotesClause<T> {
9390

9491
/**
95-
* Checks that a warning exists that contains the given fragment in the
96-
* {@linkplain Diagnostic#getMessage(java.util.Locale) diagnostic message}.
92+
* Checks that a warning exists that contains the given fragment in the {@linkplain
93+
* Diagnostic#getMessage(java.util.Locale) diagnostic message}.
9794
*/
9895
@CanIgnoreReturnValue
9996
FileClause<T> withWarningContaining(String messageFragment);
@@ -110,29 +107,29 @@ public interface CompilationWithWarningsClause<T> extends CompilationWithNotesCl
110107
* The clause in the fluent API that checks that a diagnostic is associated with a particular
111108
* {@link JavaFileObject}.
112109
*
113-
* @param T the clause type returned by {@link ChainingClause#and()}
110+
* @param <T> the clause type returned by {@link ChainingClause#and()}
114111
*/
115112
public interface FileClause<T> extends ChainingClause<T> {
116113
@CanIgnoreReturnValue
117114
LineClause<T> in(JavaFileObject file);
118115
}
119116

120117
/**
121-
* The clause in the fluent API that checks that a diagnostic is on a particular
122-
* {@linkplain Diagnostic#getLineNumber() line}.
118+
* The clause in the fluent API that checks that a diagnostic is on a particular {@linkplain
119+
* Diagnostic#getLineNumber() line}.
123120
*
124-
* @param T the clause type returned by {@link ChainingClause#and()}
121+
* @param <T> the clause type returned by {@link ChainingClause#and()}
125122
*/
126123
public interface LineClause<T> extends ChainingClause<T> {
127124
@CanIgnoreReturnValue
128125
ColumnClause<T> onLine(long lineNumber);
129126
}
130127

131128
/**
132-
* The clause in the fluent API that checks that a diagnostic starts at a particular
133-
* {@linkplain Diagnostic#getColumnNumber() column}.
129+
* The clause in the fluent API that checks that a diagnostic starts at a particular {@linkplain
130+
* Diagnostic#getColumnNumber() column}.
134131
*
135-
* @param T the clause type returned by {@link ChainingClause#and()}
132+
* @param <T> the clause type returned by {@link ChainingClause#and()}
136133
*/
137134
public interface ColumnClause<T> extends ChainingClause<T> {
138135
@CanIgnoreReturnValue
@@ -142,12 +139,12 @@ public interface ColumnClause<T> extends ChainingClause<T> {
142139
/**
143140
* The clause in the fluent API that checks that files were generated.
144141
*
145-
* @param T the non-generic clause type implementing this interface
142+
* @param <T> the non-generic clause type implementing this interface
146143
*/
147144
public interface GeneratedPredicateClause<T> {
148145
/**
149-
* Checks that a source file with an equivalent
150-
* <a href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">AST</a> was generated for each of
146+
* Checks that a source file with an equivalent <a
147+
* href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">AST</a> was generated for each of
151148
* the given {@linkplain JavaFileObject files}.
152149
*/
153150
@CanIgnoreReturnValue
@@ -160,9 +157,7 @@ public interface GeneratedPredicateClause<T> {
160157
@CanIgnoreReturnValue
161158
T generatesFiles(JavaFileObject first, JavaFileObject... rest);
162159

163-
/**
164-
* Checks that a file with the specified location, package, and filename was generated.
165-
*/
160+
/** Checks that a file with the specified location, package, and filename was generated. */
166161
@CanIgnoreReturnValue
167162
SuccessfulFileClause<T> generatesFileNamed(
168163
JavaFileManager.Location location, String packageName, String relativeName);
@@ -171,12 +166,12 @@ SuccessfulFileClause<T> generatesFileNamed(
171166
/**
172167
* The clause in the fluent API that checks that a generated file has the specified contents.
173168
*
174-
* @param T the non-generic clause type implementing this interface
169+
* @param <T> the non-generic clause type implementing this interface
175170
*/
176171
public interface SuccessfulFileClause<T> extends ChainingClause<GeneratedPredicateClause<T>> {
177172
/**
178-
* Checks that the contents of the generated file match the contents of the specified
179-
* {@link ByteSource}.
173+
* Checks that the contents of the generated file match the contents of the specified {@link
174+
* ByteSource}.
180175
*/
181176
@CanIgnoreReturnValue
182177
SuccessfulFileClause<T> withContents(ByteSource expectedByteSource);
@@ -203,8 +198,8 @@ public interface CleanCompilationClause
203198
public interface UnsuccessfulCompilationClause
204199
extends CompilationWithWarningsClause<UnsuccessfulCompilationClause> {
205200
/**
206-
* Checks that an error exists that contains the given fragment in the
207-
* {@linkplain Diagnostic#getMessage(java.util.Locale) diagnostic message}.
201+
* Checks that an error exists that contains the given fragment in the {@linkplain
202+
* Diagnostic#getMessage(java.util.Locale) diagnostic message}.
208203
*/
209204
@CanIgnoreReturnValue
210205
FileClause<UnsuccessfulCompilationClause> withErrorContaining(String messageFragment);

0 commit comments

Comments
 (0)