@@ -68,10 +68,12 @@ protected SimpleJavaFileObject(URI uri, Kind kind) {
6868 this .kind = kind ;
6969 }
7070
71+ @ Override
7172 public URI toUri () {
7273 return uri ;
7374 }
7475
76+ @ Override
7577 public String getName () {
7678 return toUri ().getPath ();
7779 }
@@ -82,6 +84,7 @@ public String getName() {
8284 * behavior as long as the contract of {@link FileObject} is
8385 * obeyed.
8486 */
87+ @ Override
8588 public InputStream openInputStream () throws IOException {
8689 throw new UnsupportedOperationException ();
8790 }
@@ -92,6 +95,7 @@ public InputStream openInputStream() throws IOException {
9295 * behavior as long as the contract of {@link FileObject} is
9396 * obeyed.
9497 */
98+ @ Override
9599 public OutputStream openOutputStream () throws IOException {
96100 throw new UnsupportedOperationException ();
97101 }
@@ -107,14 +111,13 @@ public OutputStream openOutputStream() throws IOException {
107111 * @throws UnsupportedOperationException {@inheritDoc}
108112 * @throws IOException {@inheritDoc}
109113 */
114+ @ Override
110115 public Reader openReader (boolean ignoreEncodingErrors ) throws IOException {
111116 CharSequence charContent = getCharContent (ignoreEncodingErrors );
112117 if (charContent == null )
113118 throw new UnsupportedOperationException ();
114- if (charContent instanceof CharBuffer ) {
115- CharBuffer buffer = (CharBuffer )charContent ;
116- if (buffer .hasArray ())
117- return new CharArrayReader (buffer .array ());
119+ if (charContent instanceof CharBuffer buffer && buffer .hasArray ()) {
120+ return new CharArrayReader (buffer .array ());
118121 }
119122 return new StringReader (charContent .toString ());
120123 }
@@ -125,6 +128,7 @@ public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
125128 * behavior as long as the contract of {@link FileObject} is
126129 * obeyed.
127130 */
131+ @ Override
128132 public CharSequence getCharContent (boolean ignoreEncodingErrors ) throws IOException {
129133 throw new UnsupportedOperationException ();
130134 }
@@ -139,6 +143,7 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOExcept
139143 * @throws UnsupportedOperationException {@inheritDoc}
140144 * @throws IOException {@inheritDoc}
141145 */
146+ @ Override
142147 public Writer openWriter () throws IOException {
143148 return new OutputStreamWriter (openOutputStream ());
144149 }
@@ -150,6 +155,7 @@ public Writer openWriter() throws IOException {
150155 *
151156 * @return {@code 0L}
152157 */
158+ @ Override
153159 public long getLastModified () {
154160 return 0L ;
155161 }
@@ -161,13 +167,15 @@ public long getLastModified() {
161167 *
162168 * @return {@code false}
163169 */
170+ @ Override
164171 public boolean delete () {
165172 return false ;
166173 }
167174
168175 /**
169176 * @return {@code this.kind}
170177 */
178+ @ Override
171179 public Kind getKind () {
172180 return kind ;
173181 }
@@ -186,6 +194,7 @@ public Kind getKind() {
186194 * <p>Subclasses can change this behavior as long as the contract
187195 * of {@link JavaFileObject} is obeyed.
188196 */
197+ @ Override
189198 public boolean isNameCompatible (String simpleName , Kind kind ) {
190199 String baseName = simpleName + kind .extension ;
191200 return kind .equals (getKind ())
@@ -198,13 +207,15 @@ public boolean isNameCompatible(String simpleName, Kind kind) {
198207 * change this behavior as long as the contract of
199208 * {@link JavaFileObject} is obeyed.
200209 */
210+ @ Override
201211 public NestingKind getNestingKind () { return null ; }
202212
203213 /**
204214 * This implementation returns {@code null}. Subclasses can
205215 * change this behavior as long as the contract of
206216 * {@link JavaFileObject} is obeyed.
207217 */
218+ @ Override
208219 public Modifier getAccessLevel () { return null ; }
209220
210221 @ Override
0 commit comments