From 6be83e4ae44ebb699e01ab0d03f40ca14c4abc7a Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Mon, 26 Sep 2016 12:56:02 +0100 Subject: [PATCH] Treat TryFailThrowable error prone check as error Enabling the option detected a problem in URLConnectionTest so this fixes that. Test: m -j -l32 javac-check-core-tests RUN_ERROR_PRONE=true run org.apache.harmony.luni.tests.java.net.URLConnectionTest test using vogar and CTS Bug: 31507496 Change-Id: Ie3f150e79fc1e58f812bf5c81181a68dae752271 --- JavaLibrary.mk | 1 + .../apache/harmony/luni/tests/java/net/URLConnectionTest.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/JavaLibrary.mk b/JavaLibrary.mk index ffca748a5..43ea9d602 100644 --- a/JavaLibrary.mk +++ b/JavaLibrary.mk @@ -214,6 +214,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ nist-pkix-tests \ sqlite-jdbc LOCAL_JAVACFLAGS := $(local_javac_flags) +LOCAL_ERROR_PRONE_FLAGS := -Xep:TryFailThrowable:ERROR LOCAL_JAVA_LANGUAGE_VERSION := 1.8 LOCAL_MODULE := core-tests LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/JavaLibrary.mk diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java index 61c6d033f..9c562ee0f 100644 --- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java +++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java @@ -531,7 +531,7 @@ public void test_getDoInput() throws IOException { try { uc2.getInputStream(); fail(); - } catch (Throwable expected) { + } catch (IOException expected) { } }