Mercurial > hg > graal-jvmci-8
changeset 15120:bd5471cdc3e1
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 15 Apr 2014 19:07:08 +0200 |
parents | e3491381c424 (diff) 2082889fc8f6 (current diff) |
children | 2af51b43a85c |
files | |
diffstat | 18 files changed, 230 insertions(+), 72 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/BasicHSAILTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/BasicHSAILTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -22,6 +22,8 @@ */ package com.oracle.graal.compiler.hsail.test; +import static com.oracle.graal.debug.DelegatingDebugConfig.Feature.*; + import java.lang.reflect.*; import org.junit.*; @@ -30,7 +32,6 @@ import com.oracle.graal.compiler.test.*; import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; -import com.oracle.graal.debug.internal.*; import com.oracle.graal.gpu.*; import com.oracle.graal.hotspot.hsail.*; import com.oracle.graal.hsail.*; @@ -344,15 +345,7 @@ } private void test(final String snippet) { - DebugConfig debugConfig = DebugScope.getConfig(); - DebugConfig noInterceptConfig = new DelegatingDebugConfig(debugConfig) { - @Override - public RuntimeException interceptException(Throwable e) { - return null; - } - }; - - try (DebugConfigScope dcs = Debug.setConfig(noInterceptConfig)) { + try (DebugConfigScope dcs = Debug.setConfig(new DelegatingDebugConfig().disable(INTERCEPT))) { try (Scope s = Debug.scope("HSAILCodeGen")) { Method method = getMethod(snippet); ExternalCompilationResult hsailCode = getBackend().compileKernel(getMetaAccess().lookupJavaMethod(method), false);
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/EscapingNewStringConcatTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/EscapingNewStringConcatTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -22,8 +22,12 @@ */ package com.oracle.graal.compiler.hsail.test; +import static com.oracle.graal.debug.Debug.*; + import org.junit.Test; +import com.oracle.graal.debug.*; + /** * Tests allocation of a new String based on string concatenation. */ @@ -49,6 +53,8 @@ // Node implementing Lowerable not handled in HSAIL Backend: 6274|MonitorEnter @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsail(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/EscapingNewStringInternTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/EscapingNewStringInternTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -22,8 +22,12 @@ */ package com.oracle.graal.compiler.hsail.test; +import static com.oracle.graal.debug.Debug.*; + import org.junit.Test; +import com.oracle.graal.debug.*; + /** * Tests allocation of a new String based on string interning. */ @@ -37,6 +41,8 @@ // at node: 12|Invoke#Direct#intern @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsail(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/StaticMethod16InArraysTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/StaticMethod16InArraysTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,10 +23,11 @@ package com.oracle.graal.compiler.hsail.test; +import static com.oracle.graal.debug.DelegatingDebugConfig.Feature.*; + import org.junit.*; import com.oracle.graal.debug.*; -import com.oracle.graal.debug.internal.*; /** * Tests the addition of elements from sixteen input arrays. @@ -64,15 +65,7 @@ @Test(expected = java.lang.ClassCastException.class) @Ignore("until GPU backends can co-exist") public void test() { - DebugConfig debugConfig = DebugScope.getConfig(); - DebugConfig noInterceptConfig = new DelegatingDebugConfig(debugConfig) { - @Override - public RuntimeException interceptException(Throwable e) { - return null; - } - }; - - try (DebugConfigScope s = Debug.setConfig(noInterceptConfig)) { + try (DebugConfigScope s = Debug.setConfig(new DelegatingDebugConfig().disable(INTERCEPT))) { testGeneratedHsail(); } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ArrayListGetTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ArrayListGetTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,8 +23,13 @@ package com.oracle.graal.compiler.hsail.test.lambda; +import static com.oracle.graal.debug.Debug.*; + import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; +import com.oracle.graal.debug.*; + import org.junit.Test; + import java.util.ArrayList; /** @@ -56,7 +61,9 @@ // NYI emitForeignCall charAlignedDisjointArraycopy @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void testUsingLambdaMethod() { - testGeneratedHsailUsingLambdaMethod(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsailUsingLambdaMethod(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetGidTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetGidTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -57,11 +57,11 @@ // note: the actual order of entries in outArray is not predictable // thus we sort before we compare results Arrays.sort(outArray); - System.out.print("outArray: "); - for (int val : outArray) { - System.out.print(val + ", "); - } - System.out.println(); +// System.out.print("outArray: "); +// for (int val : outArray) { +// System.out.print(val + ", "); +// } +// System.out.println(); // create array of gaps gaps[0] = outArray[0] - 0; for (int i = 1; i < NUM; i++) {
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/HashMapGetTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/HashMapGetTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,8 +23,13 @@ package com.oracle.graal.compiler.hsail.test.lambda; +import static com.oracle.graal.debug.Debug.*; + import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; +import com.oracle.graal.debug.*; + import java.util.HashMap; + import org.junit.Test; /** @@ -88,12 +93,16 @@ // type profile exists @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsail(); + } } @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void testUsingLambdaMethod() { - testGeneratedHsailUsingLambdaMethod(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsailUsingLambdaMethod(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/LongAdderTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/LongAdderTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,8 +23,13 @@ package com.oracle.graal.compiler.hsail.test.lambda; +import static com.oracle.graal.debug.Debug.*; +import static com.oracle.graal.debug.DelegatingDebugConfig.Feature.*; + import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; +import com.oracle.graal.debug.*; import java.util.concurrent.atomic.LongAdder; + import org.junit.Test; /** @@ -53,11 +58,15 @@ // cannot handle node: CurrentJavaThread @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope dcs = setConfig(new DelegatingDebugConfig().disable(INTERCEPT))) { + testGeneratedHsail(); + } } @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void testUsingLambdaMethod() { - testGeneratedHsailUsingLambdaMethod(); + try (DebugConfigScope dcs = setConfig(new DelegatingDebugConfig().disable(INTERCEPT))) { + testGeneratedHsailUsingLambdaMethod(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/NewStringEqualsTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/NewStringEqualsTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,7 +23,11 @@ package com.oracle.graal.compiler.hsail.test.lambda; +import static com.oracle.graal.debug.Debug.*; + import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; +import com.oracle.graal.debug.*; + import org.junit.Test; /** @@ -62,12 +66,16 @@ // NYI emitForeignCall charAlignedDisjointArraycopy @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsail(); + } } @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void testUsingLambdaMethod() { - testGeneratedHsailUsingLambdaMethod(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsailUsingLambdaMethod(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/NonEscapingNewObjWithArrayTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/NonEscapingNewObjWithArrayTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,8 +23,14 @@ package com.oracle.graal.compiler.hsail.test.lambda; +import static com.oracle.graal.debug.Debug.*; +import static com.oracle.graal.debug.DelegatingDebugConfig.Feature.*; + import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; +import com.oracle.graal.debug.*; + import org.junit.Test; + import java.util.Arrays; /** @@ -74,12 +80,16 @@ // NYI emitForeignCall floatArraycopy @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsail(); + } } @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void testUsingLambdaMethod() { - testGeneratedHsailUsingLambdaMethod(); + try (DebugConfigScope dcs = setConfig(new DelegatingDebugConfig().disable(INTERCEPT))) { + testGeneratedHsailUsingLambdaMethod(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/SynchronizedMethodTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/SynchronizedMethodTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,7 +23,11 @@ package com.oracle.graal.compiler.hsail.test.lambda; +import static com.oracle.graal.debug.Debug.*; + import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; +import com.oracle.graal.debug.*; + import org.junit.Test; /** @@ -58,13 +62,17 @@ // cannot handle the BeginLockScope node @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsail(); + } } // cannot handle the BeginLockScope node @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void testUsingLambdaMethod() { - testGeneratedHsailUsingLambdaMethod(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsailUsingLambdaMethod(); + } } }
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/VirtualCallTest.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/VirtualCallTest.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,7 +23,11 @@ package com.oracle.graal.compiler.hsail.test.lambda; +import static com.oracle.graal.debug.Debug.*; + import com.oracle.graal.compiler.hsail.test.infra.GraalKernelTester; +import com.oracle.graal.debug.*; + import org.junit.Test; /** @@ -92,12 +96,16 @@ // graal says not inlining getArea():float (0 bytes): no type profile exists @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void test() { - testGeneratedHsail(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsail(); + } } @Test(expected = com.oracle.graal.graph.GraalInternalError.class) public void testUsingLambdaMethod() { - testGeneratedHsailUsingLambdaMethod(); + try (DebugConfigScope s = disableIntercept()) { + testGeneratedHsailUsingLambdaMethod(); + } } }
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Tue Apr 15 19:07:08 2014 +0200 @@ -22,6 +22,8 @@ */ package com.oracle.graal.compiler.test; +import static com.oracle.graal.debug.DelegatingDebugConfig.Feature.*; + import java.io.*; import java.lang.reflect.*; import java.util.*; @@ -33,7 +35,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.debug.*; -import com.oracle.graal.debug.internal.*; import com.oracle.graal.java.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.*; @@ -106,14 +107,7 @@ String methodName = className + "." + m.getName(); if (matches(filters, methodName)) { StructuredGraph graph = new StructuredGraph(metaAccess.lookupJavaMethod(m)); - DebugConfig debugConfig = DebugScope.getConfig(); - DebugConfig noInterceptConfig = new DelegatingDebugConfig(debugConfig) { - @Override - public RuntimeException interceptException(Throwable e) { - return null; - } - }; - try (DebugConfigScope s = Debug.setConfig(noInterceptConfig)) { + try (DebugConfigScope s = Debug.setConfig(new DelegatingDebugConfig().disable(INTERCEPT))) { graphBuilderSuite.apply(graph, context); checkGraph(context, graph); } catch (VerificationError e) {
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Tue Apr 15 19:07:08 2014 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.debug; import static com.oracle.graal.debug.Debug.Initialization.*; +import static com.oracle.graal.debug.DelegatingDebugConfig.Feature.*; import static java.util.FormattableFlags.*; import java.io.*; @@ -259,17 +260,25 @@ } public static Scope forceLog() { - return Debug.sandbox("forceLog", new DelegatingDebugConfig(DebugScope.getConfig()) { - @Override - public boolean isLogEnabled() { - return true; - } + return Debug.sandbox("forceLog", new DelegatingDebugConfig().enable(LOG).enable(LOG_METHOD)); + } - @Override - public boolean isLogEnabledForMethod() { - return true; - } - }); + /** + * Opens a scope in which exception {@linkplain DebugConfig#interceptException(Throwable) + * interception} is disabled. It is recommended to use the try-with-resource statement for + * managing entering and leaving such scopes: + * + * <pre> + * try (DebugConfigScope s = Debug.disableIntercept()) { + * ... + * } + * </pre> + * + * This is particularly useful to suppress extraneous output in JUnit tests that are expected to + * throw an exception. + */ + public static DebugConfigScope disableIntercept() { + return Debug.setConfig(new DelegatingDebugConfig().disable(INTERCEPT)); } /**
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DelegatingDebugConfig.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DelegatingDebugConfig.java Tue Apr 15 19:07:08 2014 +0200 @@ -25,45 +25,139 @@ import java.io.*; import java.util.*; +import com.oracle.graal.debug.internal.*; + public class DelegatingDebugConfig implements DebugConfig { protected final DebugConfig delegate; + /** + * The features of a {@link DelegatingDebugConfig} that can be force + * {@linkplain DelegatingDebugConfig#enable(Feature) enabled}/ + * {@linkplain DelegatingDebugConfig#disable(Feature) disabled} or + * {@linkplain DelegatingDebugConfig#delegate(Feature) delegated}. + */ + public enum Feature { + /** + * @see Debug#isLogEnabled() + */ + LOG, + /** + * @see Debug#isLogEnabledForMethod() + */ + LOG_METHOD, + /** + * @see Debug#isDumpEnabled() + */ + DUMP, + /** + * @see Debug#isDumpEnabledForMethod() + */ + DUMP_METHOD, + /** + * @see Debug#isMeterEnabled() + */ + METER, + /** + * @see Debug#isTimeEnabled() + */ + TIME, + /** + * @see DebugConfig#interceptException(Throwable) + */ + INTERCEPT + } + + private final Map<Feature, Boolean> featureState = new EnumMap<>(Feature.class); + + /** + * Creates a config that delegates to the {@link DebugScope#getConfig() current config}. + */ + public DelegatingDebugConfig() { + this(DebugScope.getConfig()); + } + + /** + * Creates a config that delegates to a given config. + */ public DelegatingDebugConfig(DebugConfig delegate) { this.delegate = delegate; } + public DelegatingDebugConfig enable(Feature feature) { + featureState.put(feature, Boolean.TRUE); + return this; + } + + public DelegatingDebugConfig disable(Feature feature) { + featureState.put(feature, Boolean.FALSE); + return this; + } + + public DelegatingDebugConfig delegate(Feature feature) { + featureState.put(feature, null); + return this; + } + @Override public boolean isLogEnabled() { - return delegate.isLogEnabled(); + Boolean fs = featureState.get(Feature.LOG); + if (fs == null) { + return delegate.isLogEnabled(); + } + return fs.booleanValue(); } public boolean isLogEnabledForMethod() { - return delegate.isLogEnabledForMethod(); + Boolean fs = featureState.get(Feature.LOG_METHOD); + if (fs == null) { + return delegate.isLogEnabledForMethod(); + } + return fs.booleanValue(); } @Override public boolean isMeterEnabled() { - return delegate.isMeterEnabled(); + Boolean fs = featureState.get(Feature.METER); + if (fs == null) { + return delegate.isMeterEnabled(); + } + return fs.booleanValue(); } @Override public boolean isDumpEnabled() { - return delegate.isDumpEnabled(); + Boolean fs = featureState.get(Feature.DUMP); + if (fs == null) { + return delegate.isDumpEnabled(); + } + return fs.booleanValue(); } public boolean isDumpEnabledForMethod() { - return delegate.isDumpEnabledForMethod(); + Boolean fs = featureState.get(Feature.DUMP_METHOD); + if (fs == null) { + return delegate.isDumpEnabledForMethod(); + } + return fs.booleanValue(); } @Override public boolean isTimeEnabled() { - return delegate.isTimeEnabled(); + Boolean fs = featureState.get(Feature.TIME); + if (fs == null) { + return delegate.isTimeEnabled(); + } + return fs.booleanValue(); } @Override public RuntimeException interceptException(Throwable e) { - return delegate.interceptException(e); + Boolean fs = featureState.get(Feature.INTERCEPT); + if (fs == null || fs) { + return delegate.interceptException(e); + } + return null; } @Override
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Tue Apr 15 17:56:27 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Tue Apr 15 19:07:08 2014 +0200 @@ -80,7 +80,7 @@ // tracing @Option(help = "") - public static final OptionValue<Boolean> TraceTruffleCompilation = new OptionValue<>(true); + public static final OptionValue<Boolean> TraceTruffleCompilation = new OptionValue<>(false); @Option(help = "") public static final OptionValue<Boolean> TraceTruffleCompilationDetails = new OptionValue<>(false); @Option(help = "")
--- a/mx/eclipse-settings/org.eclipse.jdt.core.prefs Tue Apr 15 17:56:27 2014 +0200 +++ b/mx/eclipse-settings/org.eclipse.jdt.core.prefs Tue Apr 15 19:07:08 2014 +0200 @@ -100,7 +100,6 @@ org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.tasks=ignore org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
--- a/mxtool/mx.py Tue Apr 15 17:56:27 2014 +0200 +++ b/mxtool/mx.py Tue Apr 15 19:07:08 2014 +0200 @@ -1694,6 +1694,7 @@ parser.add_argument('--force-javac', action='store_true', dest='javac', help='use javac despite ecj.jar is found or not') parser.add_argument('--jdt', help='path to ecj.jar, the Eclipse batch compiler (default: ' + defaultEcjPath + ')', default=defaultEcjPath, metavar='<path>') parser.add_argument('--jdt-warning-as-error', action='store_true', help='convert all Eclipse batch compiler warnings to errors') + parser.add_argument('--jdt-show-task-tags', action='store_true', help='show task tags as Eclipse batch compiler warnings') parser.add_argument('--error-prone', dest='error_prone', help='path to error-prone.jar', metavar='<path>') if suppliedParser: @@ -1919,11 +1920,15 @@ if not exists(jdtProperties): log('JDT properties file {0} not found'.format(jdtProperties)) else: - # convert all warnings to errors - if args.jdt_warning_as_error: + with open(jdtProperties) as fp: + origContent = fp.read() + content = origContent + if args.jdt_warning_as_error: + content = content.replace('=warning', '=error') + if not args.jdt_show_task_tags: + content = content + '\norg.eclipse.jdt.core.compiler.problem.tasks=ignore' + if origContent != content: jdtPropertiesTmp = jdtProperties + '.tmp' - with open(jdtProperties) as fp: - content = fp.read().replace('=warning', '=error') with open(jdtPropertiesTmp, 'w') as fp: fp.write(content) toBeDeleted.append(jdtPropertiesTmp)