Skip to content

Commit 178eeed

Browse files
EcljpseB0Tjukzi
authored andcommitted
suppress autoboxing markers and false "resource" warnings
autoboxing is not a problem for releng
1 parent affa208 commit 178eeed

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

eclipse.platform.releng/bundles/org.eclipse.test.performance/.settings/org.eclipse.jdt.core.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ org.eclipse.jdt.core.compiler.problem.APILeak=warning
3232
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
3333
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
3434
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
35-
org.eclipse.jdt.core.compiler.problem.autoboxing=info
35+
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
3636
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
3737
org.eclipse.jdt.core.compiler.problem.deadCode=warning
3838
org.eclipse.jdt.core.compiler.problem.deprecation=warning

eclipse.platform.releng/bundles/org.eclipse.test.performance/src/org/eclipse/test/internal/AwtScreenshot.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,15 @@ public static void dumpAwtScreenshot(String screenshotFile) {
9393
processBuilder.environment().put("AWT_TOOLKIT", "CToolkit");
9494
}
9595
Process process = processBuilder.start();
96-
new StreamForwarder(process.getErrorStream(), System.out).start();
97-
new StreamForwarder(process.getInputStream(), System.out).start();
96+
97+
@SuppressWarnings("resource") // never close process streams
98+
InputStream errorStream = process.getErrorStream();
99+
100+
@SuppressWarnings("resource") // never close process streams
101+
InputStream inputStream = process.getInputStream();
102+
103+
new StreamForwarder(errorStream, System.out).start();
104+
new StreamForwarder(inputStream, System.out).start();
98105
long end = System.currentTimeMillis() + TIMEOUT_SECONDS * 1000;
99106
boolean done = false;
100107
do {

eclipse.platform.releng/bundles/org.eclipse.test/src/org/eclipse/test/AbstractJUnitResultFormatter.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ Reader getSysErrReader() throws IOException {
129129
* @throws IOException If any I/O problem occurs during writing the data
130130
*/
131131
void writeSysOut(Writer writer) throws IOException {
132-
Objects.requireNonNull(writer, "Writer cannot be null");
133-
writeFrom(this.sysOutStore, writer);
132+
@SuppressWarnings("resource") // requireNonNull just returns first argument
133+
Writer w = Objects.requireNonNull(writer, "Writer cannot be null");
134+
writeFrom(this.sysOutStore, w);
134135
}
135136

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

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

0 commit comments

Comments
 (0)