Skip to content

Commit

Permalink
fix some ecj markers
Browse files Browse the repository at this point in the history
Especially after moving files to compiler.batch - which has no resource
warnings - the @SuppressWarnings("resource") is not used - leading to a
marker
  • Loading branch information
EcljpseB0T authored and jukzi committed Nov 30, 2023
1 parent 45f0152 commit d4b1f26
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.invoke.MethodType;

public abstract class MethodHandle {
@Target(METHOD)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package java.lang.invoke;
import java.lang.invoke.MethodType;

public class MethodHandles {
public static final class Lookup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import junit.framework.TestSuite;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.apt.core.internal.util.FactoryContainer;
import org.eclipse.jdt.apt.core.internal.util.FactoryPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void configure(Object batchCompiler, String[] commandLineArguments) {
}
BatchProcessingEnvImpl processingEnv = new BatchProcessingEnvImpl(this, (Main) batchCompiler, commandLineArguments);
this._processingEnv = processingEnv;
@SuppressWarnings("resource") // fileManager is not opened here
// @SuppressWarnings("resource") // fileManager is not opened here
JavaFileManager fileManager = processingEnv.getFileManager();
if (fileManager instanceof StandardJavaFileManager) {
Iterable<? extends File> location = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ public HookedJavaFileObject(JavaFileObject fileObject, String fileName, String t
this._typeName = typeName;
}

@SuppressWarnings("resource") // ForwardingOutputStream forwards close() too
// @SuppressWarnings("resource") // ForwardingOutputStream forwards close() too
@Override
public OutputStream openOutputStream() throws IOException {
return new ForwardingOutputStream(super.openOutputStream());
}

@SuppressWarnings("resource") // ForwardingWriter forwards close() too
// @SuppressWarnings("resource") // ForwardingWriter forwards close() too
@Override
public Writer openWriter() throws IOException {
return new ForwardingWriter(super.openWriter());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private void collectAllMatchingFiles(Location location, File file, String normal
}
}
} else if (isArchive(file)) {
@SuppressWarnings("resource") // cached archive is closed in EclipseFileManager.close()
// @SuppressWarnings("resource") // cached archive is closed in EclipseFileManager.close()
Archive archive = this.getArchive(file);
if (archive != Archive.UNKNOWN_ARCHIVE) {
String key = normalizedPackageName;
Expand Down Expand Up @@ -442,7 +442,7 @@ public FileObject getFileForInput(Location location, String packageName, String
return null;
}

@SuppressWarnings("resource") // cached archive is closed in EclipseFileManager.close()
// @SuppressWarnings("resource") // cached archive is closed in EclipseFileManager.close()
private ArchiveFileObject getFileObject(File archiveFile, String normalizedFileName) {
Archive archive = getArchive(archiveFile);
if (archive == Archive.UNKNOWN_ARCHIVE) {
Expand All @@ -454,7 +454,7 @@ private ArchiveFileObject getFileObject(File archiveFile, String normalizedFileN
return null;
}

@SuppressWarnings("resource") // cached archive is closed in EclipseFileManager.close()
// @SuppressWarnings("resource") // cached archive is closed in EclipseFileManager.close()
private Boolean containsFileObject(File archiveFile, String normalizedFileName) {
Archive archive = getArchive(archiveFile);
if (archive == Archive.UNKNOWN_ARCHIVE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,8 @@ public void testParenthesizedExpression() {
ParenthesizedExpression x1 = this.ast.newParenthesizedExpression();
basicMatch(x1);
}

@SuppressWarnings("deprecation")
public void testPatternInstanceofExpression() {
if (this.ast.apiLevel() < AST.JLS17) {
return;
Expand Down

0 comments on commit d4b1f26

Please sign in to comment.