Skip to content

Commit

Permalink
suppress autoboxing markers and false "resource" warnings
Browse files Browse the repository at this point in the history
autoboxing is not a problem for releng
  • Loading branch information
EcljpseB0T authored and jukzi committed Dec 5, 2023
1 parent affa208 commit 178eeed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Expand Up @@ -32,7 +32,7 @@ org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=info
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
Expand Down
Expand Up @@ -93,8 +93,15 @@ public static void dumpAwtScreenshot(String screenshotFile) {
processBuilder.environment().put("AWT_TOOLKIT", "CToolkit");
}
Process process = processBuilder.start();
new StreamForwarder(process.getErrorStream(), System.out).start();
new StreamForwarder(process.getInputStream(), System.out).start();

@SuppressWarnings("resource") // never close process streams
InputStream errorStream = process.getErrorStream();

@SuppressWarnings("resource") // never close process streams
InputStream inputStream = process.getInputStream();

new StreamForwarder(errorStream, System.out).start();
new StreamForwarder(inputStream, System.out).start();
long end = System.currentTimeMillis() + TIMEOUT_SECONDS * 1000;
boolean done = false;
do {
Expand Down
Expand Up @@ -129,8 +129,9 @@ Reader getSysErrReader() throws IOException {
* @throws IOException If any I/O problem occurs during writing the data
*/
void writeSysOut(Writer writer) throws IOException {
Objects.requireNonNull(writer, "Writer cannot be null");
writeFrom(this.sysOutStore, writer);
@SuppressWarnings("resource") // requireNonNull just returns first argument
Writer w = Objects.requireNonNull(writer, "Writer cannot be null");
writeFrom(this.sysOutStore, w);
}

/**
Expand All @@ -141,8 +142,9 @@ void writeSysOut(Writer writer) throws IOException {
* @throws IOException If any I/O problem occurs during writing the data
*/
void writeSysErr(Writer writer) throws IOException {
Objects.requireNonNull(writer, "Writer cannot be null");
writeFrom(this.sysErrStore, writer);
@SuppressWarnings("resource") // requireNonNull just returns first argument
Writer w = Objects.requireNonNull(writer, "Writer cannot be null");
writeFrom(this.sysErrStore, w);
}

static Optional<TestIdentifier> traverseAndFindTestClass(TestPlan testPlan, TestIdentifier testIdentifier) {
Expand Down

0 comments on commit 178eeed

Please sign in to comment.