Skip to content

Commit e6a493a

Browse files
author
Pavel Rappo
committed
8252882: Clean up jdk.javadoc and the related parts of jdk.compiler
Reviewed-by: vromero
1 parent 68da63d commit e6a493a

File tree

11 files changed

+82
-57
lines changed

11 files changed

+82
-57
lines changed

src/java.compiler/share/classes/javax/tools/ForwardingFileObject.java

+11-2
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
@@ -50,17 +50,19 @@ public class ForwardingFileObject<F extends FileObject> implements FileObject {
5050
protected final F fileObject;
5151

5252
/**
53-
* Creates a new instance of ForwardingFileObject.
53+
* Creates a new instance of {@code ForwardingFileObject}.
5454
* @param fileObject delegate to this file object
5555
*/
5656
protected ForwardingFileObject(F fileObject) {
5757
this.fileObject = Objects.requireNonNull(fileObject);
5858
}
5959

60+
@Override
6061
public URI toUri() {
6162
return fileObject.toUri();
6263
}
6364

65+
@Override
6466
public String getName() {
6567
return fileObject.getName();
6668
}
@@ -70,6 +72,7 @@ public String getName() {
7072
* @throws UnsupportedOperationException {@inheritDoc}
7173
* @throws IOException {@inheritDoc}
7274
*/
75+
@Override
7376
public InputStream openInputStream() throws IOException {
7477
return fileObject.openInputStream();
7578
}
@@ -79,6 +82,7 @@ public InputStream openInputStream() throws IOException {
7982
* @throws UnsupportedOperationException {@inheritDoc}
8083
* @throws IOException {@inheritDoc}
8184
*/
85+
@Override
8286
public OutputStream openOutputStream() throws IOException {
8387
return fileObject.openOutputStream();
8488
}
@@ -88,6 +92,7 @@ public OutputStream openOutputStream() throws IOException {
8892
* @throws UnsupportedOperationException {@inheritDoc}
8993
* @throws IOException {@inheritDoc}
9094
*/
95+
@Override
9196
public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
9297
return fileObject.openReader(ignoreEncodingErrors);
9398
}
@@ -97,6 +102,7 @@ public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
97102
* @throws UnsupportedOperationException {@inheritDoc}
98103
* @throws IOException {@inheritDoc}
99104
*/
105+
@Override
100106
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
101107
return fileObject.getCharContent(ignoreEncodingErrors);
102108
}
@@ -106,14 +112,17 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOExcept
106112
* @throws UnsupportedOperationException {@inheritDoc}
107113
* @throws IOException {@inheritDoc}
108114
*/
115+
@Override
109116
public Writer openWriter() throws IOException {
110117
return fileObject.openWriter();
111118
}
112119

120+
@Override
113121
public long getLastModified() {
114122
return fileObject.getLastModified();
115123
}
116124

125+
@Override
117126
public boolean delete() {
118127
return fileObject.delete();
119128
}

src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java

+21-2
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
@@ -49,7 +49,7 @@ public class ForwardingJavaFileManager<M extends JavaFileManager> implements Jav
4949
protected final M fileManager;
5050

5151
/**
52-
* Creates a new instance of ForwardingJavaFileManager.
52+
* Creates a new instance of {@code ForwardingJavaFileManager}.
5353
* @param fileManager delegate to this file manager
5454
*/
5555
protected ForwardingJavaFileManager(M fileManager) {
@@ -60,6 +60,7 @@ protected ForwardingJavaFileManager(M fileManager) {
6060
* @throws SecurityException {@inheritDoc}
6161
* @throws IllegalStateException {@inheritDoc}
6262
*/
63+
@Override
6364
public ClassLoader getClassLoader(Location location) {
6465
return fileManager.getClassLoader(location);
6566
}
@@ -68,6 +69,7 @@ public ClassLoader getClassLoader(Location location) {
6869
* @throws IOException {@inheritDoc}
6970
* @throws IllegalStateException {@inheritDoc}
7071
*/
72+
@Override
7173
public Iterable<JavaFileObject> list(Location location,
7274
String packageName,
7375
Set<Kind> kinds,
@@ -80,13 +82,15 @@ public Iterable<JavaFileObject> list(Location location,
8082
/**
8183
* @throws IllegalStateException {@inheritDoc}
8284
*/
85+
@Override
8386
public String inferBinaryName(Location location, JavaFileObject file) {
8487
return fileManager.inferBinaryName(location, file);
8588
}
8689

8790
/**
8891
* @throws IllegalArgumentException {@inheritDoc}
8992
*/
93+
@Override
9094
public boolean isSameFile(FileObject a, FileObject b) {
9195
return fileManager.isSameFile(a, b);
9296
}
@@ -95,14 +99,17 @@ public boolean isSameFile(FileObject a, FileObject b) {
9599
* @throws IllegalArgumentException {@inheritDoc}
96100
* @throws IllegalStateException {@inheritDoc}
97101
*/
102+
@Override
98103
public boolean handleOption(String current, Iterator<String> remaining) {
99104
return fileManager.handleOption(current, remaining);
100105
}
101106

107+
@Override
102108
public boolean hasLocation(Location location) {
103109
return fileManager.hasLocation(location);
104110
}
105111

112+
@Override
106113
public int isSupportedOption(String option) {
107114
return fileManager.isSupportedOption(option);
108115
}
@@ -111,6 +118,7 @@ public int isSupportedOption(String option) {
111118
* @throws IllegalArgumentException {@inheritDoc}
112119
* @throws IllegalStateException {@inheritDoc}
113120
*/
121+
@Override
114122
public JavaFileObject getJavaFileForInput(Location location,
115123
String className,
116124
Kind kind)
@@ -123,6 +131,7 @@ public JavaFileObject getJavaFileForInput(Location location,
123131
* @throws IllegalArgumentException {@inheritDoc}
124132
* @throws IllegalStateException {@inheritDoc}
125133
*/
134+
@Override
126135
public JavaFileObject getJavaFileForOutput(Location location,
127136
String className,
128137
Kind kind,
@@ -136,6 +145,7 @@ public JavaFileObject getJavaFileForOutput(Location location,
136145
* @throws IllegalArgumentException {@inheritDoc}
137146
* @throws IllegalStateException {@inheritDoc}
138147
*/
148+
@Override
139149
public FileObject getFileForInput(Location location,
140150
String packageName,
141151
String relativeName)
@@ -148,6 +158,7 @@ public FileObject getFileForInput(Location location,
148158
* @throws IllegalArgumentException {@inheritDoc}
149159
* @throws IllegalStateException {@inheritDoc}
150160
*/
161+
@Override
151162
public FileObject getFileForOutput(Location location,
152163
String packageName,
153164
String relativeName,
@@ -157,10 +168,12 @@ public FileObject getFileForOutput(Location location,
157168
return fileManager.getFileForOutput(location, packageName, relativeName, sibling);
158169
}
159170

171+
@Override
160172
public void flush() throws IOException {
161173
fileManager.flush();
162174
}
163175

176+
@Override
164177
public void close() throws IOException {
165178
fileManager.close();
166179
}
@@ -169,6 +182,7 @@ public void close() throws IOException {
169182
* @since 9
170183
* @spec JPMS
171184
*/
185+
@Override
172186
public Location getLocationForModule(Location location, String moduleName) throws IOException {
173187
return fileManager.getLocationForModule(location, moduleName);
174188
}
@@ -177,6 +191,7 @@ public Location getLocationForModule(Location location, String moduleName) throw
177191
* @since 9
178192
* @spec JPMS
179193
*/
194+
@Override
180195
public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
181196
return fileManager.getLocationForModule(location, fo);
182197
}
@@ -185,6 +200,7 @@ public Location getLocationForModule(Location location, JavaFileObject fo) throw
185200
* @since 9
186201
* @spec JPMS
187202
*/
203+
@Override
188204
public <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service) throws IOException {
189205
return fileManager.getServiceLoader(location, service);
190206
}
@@ -193,6 +209,7 @@ public <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service
193209
* @since 9
194210
* @spec JPMS
195211
*/
212+
@Override
196213
public String inferModuleName(Location location) throws IOException {
197214
return fileManager.inferModuleName(location);
198215
}
@@ -201,13 +218,15 @@ public String inferModuleName(Location location) throws IOException {
201218
* @since 9
202219
* @spec JPMS
203220
*/
221+
@Override
204222
public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
205223
return fileManager.listLocationsForModules(location);
206224
}
207225

208226
/**
209227
* @since 9
210228
*/
229+
@Override
211230
public boolean contains(Location location, FileObject fo) throws IOException {
212231
return fileManager.contains(location, fo);
213232
}

src/java.compiler/share/classes/javax/tools/ForwardingJavaFileObject.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2006, 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
@@ -43,23 +43,27 @@ public class ForwardingJavaFileObject<F extends JavaFileObject>
4343
{
4444

4545
/**
46-
* Creates a new instance of ForwardingJavaFileObject.
46+
* Creates a new instance of {@code ForwardingJavaFileObject}.
4747
* @param fileObject delegate to this file object
4848
*/
4949
protected ForwardingJavaFileObject(F fileObject) {
5050
super(fileObject);
5151
}
5252

53+
@Override
5354
public Kind getKind() {
5455
return fileObject.getKind();
5556
}
5657

58+
@Override
5759
public boolean isNameCompatible(String simpleName, Kind kind) {
5860
return fileObject.isNameCompatible(simpleName, kind);
5961
}
6062

63+
@Override
6164
public NestingKind getNestingKind() { return fileObject.getNestingKind(); }
6265

66+
@Override
6367
public Modifier getAccessLevel() { return fileObject.getAccessLevel(); }
6468

6569
}

src/java.compiler/share/classes/javax/tools/JavaFileObject.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2014, 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
@@ -63,8 +63,7 @@ enum Kind {
6363
CLASS(".class"),
6464

6565
/**
66-
* HTML files. For example, regular files ending with {@code
67-
* .html}.
66+
* HTML files. For example, regular files ending with {@code .html}.
6867
*/
6968
HTML(".html"),
7069

@@ -78,7 +77,7 @@ enum Kind {
7877
* empty string ({@code ""}) is used.
7978
*/
8079
public final String extension;
81-
private Kind(String extension) {
80+
Kind(String extension) {
8281
this.extension = Objects.requireNonNull(extension);
8382
}
8483
}
@@ -94,12 +93,11 @@ private Kind(String extension) {
9493
* Checks if this file object is compatible with the specified
9594
* simple name and kind. A simple name is a single identifier
9695
* (not qualified) as defined in
97-
* <cite>The Java Language Specification</cite>,
98-
* section 6.2 "Names and Identifiers".
96+
* <cite>The Java Language Specification</cite>, section {@jls 6.2}.
9997
*
10098
* @param simpleName a simple name of a class
10199
* @param kind a kind
102-
* @return {@code true} if this file object is compatible; false
100+
* @return {@code true} if this file object is compatible; {@code false}
103101
* otherwise
104102
*/
105103
boolean isNameCompatible(String simpleName, Kind kind);
@@ -119,7 +117,7 @@ private Kind(String extension) {
119117

120118
/**
121119
* Provides a hint about the access level of the class represented
122-
* by this file object. If the access level is not known or if
120+
* by this file object. If the access level is not known or
123121
* this file object does not represent a class file this method
124122
* returns {@code null}.
125123
*

src/java.compiler/share/classes/javax/tools/SimpleJavaFileObject.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2006, 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,7 +31,6 @@
3131
import java.util.Objects;
3232
import javax.lang.model.element.Modifier;
3333
import javax.lang.model.element.NestingKind;
34-
import javax.tools.JavaFileObject.Kind;
3534

3635
/**
3736
* Provides simple implementations for most methods in JavaFileObject.

src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006, 2018, 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
@@ -35,7 +35,7 @@
3535
import java.util.List;
3636

3737
/**
38-
* File manager based on {@linkplain File java.io.File} and {@linkplain Path java.nio.file.Path}.
38+
* File manager based on {@link File java.io.File} and {@link Path java.nio.file.Path}.
3939
*
4040
* A common way to obtain an instance of this class is using
4141
* {@linkplain JavaCompiler#getStandardFileManager getStandardFileManager}, for example:
@@ -363,7 +363,7 @@ default void setLocationFromPaths(Location location, Collection<? extends Path>
363363
*
364364
* All such module-specific associations will be cancelled if a
365365
* new search path is associated with the location by calling
366-
* {@linkplain #setLocation setLocation } or
366+
* {@linkplain #setLocation setLocation} or
367367
* {@linkplain #setLocationFromPaths setLocationFromPaths}.
368368
*
369369
* @throws IllegalStateException if the location is not a module-oriented
@@ -377,8 +377,8 @@ default void setLocationFromPaths(Location location, Collection<? extends Path>
377377
* @param moduleName the name of the module
378378
* @param paths the search path to associate with the location and module.
379379
*
380-
* @see setLocation
381-
* @see setLocationFromPaths
380+
* @see #setLocation
381+
* @see #setLocationFromPaths
382382
*
383383
* @since 9
384384
*/
@@ -480,8 +480,8 @@ default void setPathFactory(PathFactory f) { }
480480

481481

482482
private static Iterable<Path> asPaths(final Iterable<? extends File> files) {
483-
return () -> new Iterator<Path>() {
484-
Iterator<? extends File> iter = files.iterator();
483+
return () -> new Iterator<>() {
484+
final Iterator<? extends File> iter = files.iterator();
485485

486486
@Override
487487
public boolean hasNext() {
@@ -496,8 +496,8 @@ public Path next() {
496496
}
497497

498498
private static Iterable<File> asFiles(final Iterable<? extends Path> paths) {
499-
return () -> new Iterator<File>() {
500-
Iterator<? extends Path> iter = paths.iterator();
499+
return () -> new Iterator<>() {
500+
final Iterator<? extends Path> iter = paths.iterator();
501501

502502
@Override
503503
public boolean hasNext() {

0 commit comments

Comments
 (0)