Remove useless throws of ProguardRuleParserException
This leads to removing a catch clause in the R8 main.
I also removed some ExecutionException throw clauses.
Change-Id: If9ad7e0d18f6ef982e5ffbe00b9efb0ea9189551
diff --git a/src/main/java/com/android/tools/r8/GenerateMainDexList.java b/src/main/java/com/android/tools/r8/GenerateMainDexList.java
index a885bbb..d4b1ee5 100644
--- a/src/main/java/com/android/tools/r8/GenerateMainDexList.java
+++ b/src/main/java/com/android/tools/r8/GenerateMainDexList.java
@@ -9,7 +9,6 @@
import com.android.tools.r8.graph.DexType;
import com.android.tools.r8.shaking.Enqueuer;
import com.android.tools.r8.shaking.MainDexListBuilder;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
import com.android.tools.r8.shaking.RootSetBuilder;
import com.android.tools.r8.shaking.RootSetBuilder.RootSet;
import com.android.tools.r8.utils.AndroidApp;
@@ -106,7 +105,7 @@
}
public static void main(String[] args)
- throws IOException, ProguardRuleParserException, CompilationException, ExecutionException {
+ throws IOException, CompilationException, ExecutionException {
GenerateMainDexListCommand.Builder builder = GenerateMainDexListCommand.parse(args);
GenerateMainDexListCommand command = builder.build();
if (command.isPrintHelp()) {
diff --git a/src/main/java/com/android/tools/r8/R8.java b/src/main/java/com/android/tools/r8/R8.java
index cbb7f0b..f72dd9f 100644
--- a/src/main/java/com/android/tools/r8/R8.java
+++ b/src/main/java/com/android/tools/r8/R8.java
@@ -32,7 +32,6 @@
import com.android.tools.r8.shaking.Enqueuer;
import com.android.tools.r8.shaking.MainDexListBuilder;
import com.android.tools.r8.shaking.ProguardClassNameList;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
import com.android.tools.r8.shaking.ProguardTypeMatcher.MatchSpecificType;
import com.android.tools.r8.shaking.ReasonPrinter;
import com.android.tools.r8.shaking.RootSetBuilder;
@@ -492,8 +491,7 @@
return outputApp;
}
- private static void run(String[] args)
- throws IOException, ProguardRuleParserException, CompilationException {
+ private static void run(String[] args) throws IOException, CompilationException {
R8Command.Builder builder = R8Command.parse(args);
if (builder.getOutputPath() == null) {
builder.setOutputPath(Paths.get("."));
@@ -521,9 +519,6 @@
} catch (IOException e) {
System.err.println("Failed to read or write Android app: " + e.getMessage());
System.exit(1);
- } catch (ProguardRuleParserException e) {
- System.err.println("Failed parsing proguard keep rules: " + e.getMessage());
- System.exit(1);
} catch (RuntimeException e) {
System.err.println("Compilation failed with an internal error.");
Throwable cause = e.getCause() == null ? e : e.getCause();
diff --git a/src/test/java/com/android/tools/r8/R8CodeCanonicalizationTest.java b/src/test/java/com/android/tools/r8/R8CodeCanonicalizationTest.java
index 3513290..239e4fd 100644
--- a/src/test/java/com/android/tools/r8/R8CodeCanonicalizationTest.java
+++ b/src/test/java/com/android/tools/r8/R8CodeCanonicalizationTest.java
@@ -35,8 +35,7 @@
public TemporaryFolder temp = ToolHelper.getTemporaryFolderForTest();
@Test
- public void testNumberOfCodeItemsUnchanged()
- throws IOException, ExecutionException, ProguardRuleParserException, CompilationException {
+ public void testNumberOfCodeItemsUnchanged() throws Exception {
int numberOfCodes = readNumberOfCodes(Paths.get(ToolHelper.EXAMPLES_BUILD_DIR + SOURCE_DEX));
ToolHelper.runR8(ToolHelper.EXAMPLES_BUILD_DIR + SOURCE_DEX, temp.getRoot().getCanonicalPath());
int newNumberOfCodes = readNumberOfCodes(
diff --git a/src/test/java/com/android/tools/r8/R8EntryPointTests.java b/src/test/java/com/android/tools/r8/R8EntryPointTests.java
index c83cea6..a03ae3d 100644
--- a/src/test/java/com/android/tools/r8/R8EntryPointTests.java
+++ b/src/test/java/com/android/tools/r8/R8EntryPointTests.java
@@ -5,7 +5,6 @@
package com.android.tools.r8;
import com.android.tools.r8.ToolHelper.ProcessResult;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
import com.android.tools.r8.utils.FileUtils;
import com.google.common.collect.ImmutableList;
import java.io.IOException;
@@ -38,7 +37,7 @@
}
@Test
- public void testRun1Dir() throws IOException, CompilationException, ProguardRuleParserException {
+ public void testRun1Dir() throws Exception {
Path out = temp.newFolder("outdex").toPath();
R8.run(getCommand(out));
Assert.assertTrue(Files.isRegularFile(out.resolve(FileUtils.DEFAULT_DEX_FILENAME)));
@@ -47,7 +46,7 @@
}
@Test
- public void testRun1Zip() throws IOException, CompilationException, ProguardRuleParserException {
+ public void testRun1Zip() throws Exception {
Path out = temp.newFolder("outdex").toPath().resolve("dex.zip");
R8.run(getCommand(out));
Assert.assertTrue(Files.isRegularFile(out));
@@ -56,7 +55,7 @@
}
@Test
- public void testRun2Dir() throws IOException, CompilationException, ProguardRuleParserException {
+ public void testRun2Dir() throws Exception {
Path out = temp.newFolder("outdex").toPath();
ExecutorService executor = Executors.newWorkStealingPool(2);
try {
@@ -70,7 +69,7 @@
}
@Test
- public void testRun2Zip() throws IOException, CompilationException, ProguardRuleParserException {
+ public void testRun2Zip() throws Exception {
Path out = temp.newFolder("outdex").toPath().resolve("dex.zip");
ExecutorService executor = Executors.newWorkStealingPool(2);
try {
diff --git a/src/test/java/com/android/tools/r8/R8RunExamplesAndroidNTest.java b/src/test/java/com/android/tools/r8/R8RunExamplesAndroidNTest.java
index 13c38ca..ed02330 100644
--- a/src/test/java/com/android/tools/r8/R8RunExamplesAndroidNTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunExamplesAndroidNTest.java
@@ -5,7 +5,6 @@
package com.android.tools.r8;
import java.nio.file.Path;
-import java.util.concurrent.ExecutionException;
import java.util.function.UnaryOperator;
public class R8RunExamplesAndroidNTest extends RunExamplesAndroidNTest<R8Command.Builder> {
@@ -23,16 +22,12 @@
@Override
void build(Path inputFile, Path out) throws Throwable {
- try {
- R8Command.Builder builder = R8Command.builder();
- for (UnaryOperator<R8Command.Builder> transformation : builderTransformations) {
- builder = transformation.apply(builder);
- }
- R8Command command = builder.addProgramFiles(inputFile).setOutputPath(out).build();
- ToolHelper.runR8(command, this::combinedOptionConsumer);
- } catch (ExecutionException e) {
- throw e.getCause();
+ R8Command.Builder builder = R8Command.builder();
+ for (UnaryOperator<R8Command.Builder> transformation : builderTransformations) {
+ builder = transformation.apply(builder);
}
+ R8Command command = builder.addProgramFiles(inputFile).setOutputPath(out).build();
+ ToolHelper.runR8(command, this::combinedOptionConsumer);
}
}
diff --git a/src/test/java/com/android/tools/r8/R8RunExamplesAndroidOTest.java b/src/test/java/com/android/tools/r8/R8RunExamplesAndroidOTest.java
index ebf4749..a7354e2 100644
--- a/src/test/java/com/android/tools/r8/R8RunExamplesAndroidOTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunExamplesAndroidOTest.java
@@ -6,7 +6,6 @@
import com.android.tools.r8.ToolHelper.DexVm;
import com.android.tools.r8.ToolHelper.DexVm.Version;
-import com.android.tools.r8.dex.Constants;
import com.android.tools.r8.utils.AndroidApiLevel;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -14,7 +13,6 @@
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.ExecutionException;
import java.util.function.UnaryOperator;
import org.junit.Test;
@@ -61,18 +59,14 @@
@Override
void build(Path inputFile, Path out) throws Throwable {
- try {
- R8Command.Builder builder = R8Command.builder();
- for (UnaryOperator<R8Command.Builder> transformation : builderTransformations) {
- builder = transformation.apply(builder);
- }
- builder.addLibraryFiles(Paths.get(ToolHelper.getAndroidJar(
- androidJarVersion == null ? builder.getMinApiLevel() : androidJarVersion)));
- R8Command command = builder.addProgramFiles(inputFile).setOutputPath(out).build();
- ToolHelper.runR8(command, this::combinedOptionConsumer);
- } catch (ExecutionException e) {
- throw e.getCause();
+ R8Command.Builder builder = R8Command.builder();
+ for (UnaryOperator<R8Command.Builder> transformation : builderTransformations) {
+ builder = transformation.apply(builder);
}
+ builder.addLibraryFiles(Paths.get(ToolHelper.getAndroidJar(
+ androidJarVersion == null ? builder.getMinApiLevel() : androidJarVersion)));
+ R8Command command = builder.addProgramFiles(inputFile).setOutputPath(out).build();
+ ToolHelper.runR8(command, this::combinedOptionConsumer);
}
@Override
diff --git a/src/test/java/com/android/tools/r8/R8RunExamplesAndroidPTest.java b/src/test/java/com/android/tools/r8/R8RunExamplesAndroidPTest.java
index 0f7386e..eca0be8 100644
--- a/src/test/java/com/android/tools/r8/R8RunExamplesAndroidPTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunExamplesAndroidPTest.java
@@ -12,7 +12,6 @@
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.ExecutionException;
import java.util.function.UnaryOperator;
import org.junit.Test;
@@ -59,18 +58,14 @@
@Override
void build(Path inputFile, Path out) throws Throwable {
- try {
- R8Command.Builder builder = R8Command.builder();
- for (UnaryOperator<R8Command.Builder> transformation : builderTransformations) {
- builder = transformation.apply(builder);
- }
- // TODO(mikaelpeltier) Add new android.jar build from aosp and use it
- builder.addLibraryFiles(Paths.get(ToolHelper.getAndroidJar(AndroidApiLevel.O.getLevel())));
- R8Command command = builder.addProgramFiles(inputFile).setOutputPath(out).build();
- ToolHelper.runR8(command, this::combinedOptionConsumer);
- } catch (ExecutionException e) {
- throw e.getCause();
+ R8Command.Builder builder = R8Command.builder();
+ for (UnaryOperator<R8Command.Builder> transformation : builderTransformations) {
+ builder = transformation.apply(builder);
}
+ // TODO(mikaelpeltier) Add new android.jar build from aosp and use it
+ builder.addLibraryFiles(Paths.get(ToolHelper.getAndroidJar(AndroidApiLevel.O.getLevel())));
+ R8Command command = builder.addProgramFiles(inputFile).setOutputPath(out).build();
+ ToolHelper.runR8(command, this::combinedOptionConsumer);
}
@Override
diff --git a/src/test/java/com/android/tools/r8/R8RunSmaliTestsTest.java b/src/test/java/com/android/tools/r8/R8RunSmaliTestsTest.java
index 1a8f68a..3258b87 100644
--- a/src/test/java/com/android/tools/r8/R8RunSmaliTestsTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunSmaliTestsTest.java
@@ -138,8 +138,7 @@
}
@Test
- public void SmaliTest()
- throws IOException, ProguardRuleParserException, ExecutionException, CompilationException {
+ public void SmaliTest() throws Exception {
File originalDexFile = Paths.get(SMALI_DIR, directoryName, dexFileName).toFile();
String outputPath = temp.getRoot().getCanonicalPath();
ToolHelper.runR8(originalDexFile.getCanonicalPath(), outputPath);
diff --git a/src/test/java/com/android/tools/r8/ToolHelper.java b/src/test/java/com/android/tools/r8/ToolHelper.java
index d0cc56a..536284f 100644
--- a/src/test/java/com/android/tools/r8/ToolHelper.java
+++ b/src/test/java/com/android/tools/r8/ToolHelper.java
@@ -608,35 +608,33 @@
return R8Command.builder(app);
}
- public static AndroidApp runR8(AndroidApp app)
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public static AndroidApp runR8(AndroidApp app) throws IOException, CompilationException {
return runR8(R8Command.builder(app).build());
}
public static AndroidApp runR8(AndroidApp app, Path output)
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ throws IOException, CompilationException {
assert output != null;
return runR8(R8Command.builder(app).setOutputPath(output).build());
}
public static AndroidApp runR8(AndroidApp app, Consumer<InternalOptions> optionsConsumer)
- throws ProguardRuleParserException, ExecutionException, IOException, CompilationException {
+ throws IOException, CompilationException {
return runR8(R8Command.builder(app).build(), optionsConsumer);
}
- public static AndroidApp runR8(R8Command command)
- throws ProguardRuleParserException, ExecutionException, IOException, CompilationException {
+ public static AndroidApp runR8(R8Command command) throws IOException, CompilationException {
return runR8(command, null);
}
public static AndroidApp runR8(R8Command command, Consumer<InternalOptions> optionsConsumer)
- throws ProguardRuleParserException, ExecutionException, IOException, CompilationException {
+ throws IOException, CompilationException {
return runR8WithFullResult(command, optionsConsumer).androidApp;
}
public static CompilationResult runR8WithFullResult(
R8Command command, Consumer<InternalOptions> optionsConsumer)
- throws ProguardRuleParserException, ExecutionException, IOException, CompilationException {
+ throws IOException, CompilationException {
// TODO(zerny): Should we really be adding the android library in ToolHelper?
AndroidApp app = command.getInputApp();
if (app.getLibraryResourceProviders().isEmpty()) {
@@ -658,12 +656,12 @@
}
public static AndroidApp runR8(String fileName, String out)
- throws IOException, ProguardRuleParserException, ExecutionException, CompilationException {
+ throws IOException, CompilationException {
return runR8(Collections.singletonList(fileName), out);
}
public static AndroidApp runR8(Collection<String> fileNames, String out)
- throws IOException, ProguardRuleParserException, ExecutionException, CompilationException {
+ throws IOException, CompilationException {
return R8.run(
R8Command.builder()
.addProgramFiles(ListUtils.map(fileNames, Paths::get))
diff --git a/src/test/java/com/android/tools/r8/internal/D8Framework14082017DesugaredVerificationTest.java b/src/test/java/com/android/tools/r8/internal/D8Framework14082017DesugaredVerificationTest.java
index 4cc5818..026918e 100644
--- a/src/test/java/com/android/tools/r8/internal/D8Framework14082017DesugaredVerificationTest.java
+++ b/src/test/java/com/android/tools/r8/internal/D8Framework14082017DesugaredVerificationTest.java
@@ -3,13 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.internal;
-import com.android.tools.r8.CompilationException;
import com.android.tools.r8.CompilationMode;
import com.android.tools.r8.D8Command;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
-import java.io.IOException;
import java.nio.file.Paths;
-import java.util.concurrent.ExecutionException;
import org.junit.Test;
public class D8Framework14082017DesugaredVerificationTest extends CompilationTestBase {
@@ -17,8 +13,7 @@
private static final String JAR = "third_party/framework/framework_14082017_desugared.jar";
@Test
- public void verifyDebugBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyDebugBuild() throws Exception {
runAndCheckVerification(
D8Command.builder()
.addProgramFiles(Paths.get(JAR))
@@ -29,8 +24,7 @@
}
@Test
- public void verifyReleaseBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyReleaseBuild() throws Exception {
runAndCheckVerification(
D8Command.builder()
.addProgramFiles(Paths.get(JAR))
diff --git a/src/test/java/com/android/tools/r8/internal/D8Framework14082017VerificationTest.java b/src/test/java/com/android/tools/r8/internal/D8Framework14082017VerificationTest.java
index 87786df..d62de88 100644
--- a/src/test/java/com/android/tools/r8/internal/D8Framework14082017VerificationTest.java
+++ b/src/test/java/com/android/tools/r8/internal/D8Framework14082017VerificationTest.java
@@ -3,13 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.internal;
-import com.android.tools.r8.CompilationException;
import com.android.tools.r8.CompilationMode;
import com.android.tools.r8.D8Command;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
-import java.io.IOException;
import java.nio.file.Paths;
-import java.util.concurrent.ExecutionException;
import org.junit.Test;
public class D8Framework14082017VerificationTest extends CompilationTestBase {
@@ -17,8 +13,7 @@
private static final String JAR = "third_party/framework/framework_14082017.jar";
@Test
- public void verifyDebugBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyDebugBuild() throws Exception {
runAndCheckVerification(
D8Command.builder()
.addProgramFiles(Paths.get(JAR))
@@ -29,8 +24,7 @@
}
@Test
- public void verifyReleaseBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyReleaseBuild() throws Exception {
runAndCheckVerification(
D8Command.builder()
.addProgramFiles(Paths.get(JAR))
diff --git a/src/test/java/com/android/tools/r8/internal/D8FrameworkDeterministicTest.java b/src/test/java/com/android/tools/r8/internal/D8FrameworkDeterministicTest.java
index 2cbd60a..12bf52f 100644
--- a/src/test/java/com/android/tools/r8/internal/D8FrameworkDeterministicTest.java
+++ b/src/test/java/com/android/tools/r8/internal/D8FrameworkDeterministicTest.java
@@ -7,11 +7,9 @@
import com.android.tools.r8.CompilationMode;
import com.android.tools.r8.D8Command;
import com.android.tools.r8.ToolHelper;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
import com.android.tools.r8.utils.AndroidApp;
import java.io.IOException;
import java.nio.file.Paths;
-import java.util.concurrent.ExecutionException;
import org.junit.Test;
public class D8FrameworkDeterministicTest extends CompilationTestBase {
@@ -23,8 +21,7 @@
}
@Test
- public void verifyDebugBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyDebugBuild() throws Exception {
D8Command command = D8Command.builder()
.addProgramFiles(Paths.get(JAR))
.setMode(CompilationMode.DEBUG)
@@ -36,8 +33,7 @@
}
@Test
- public void verifyReleaseBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyReleaseBuild() throws Exception {
D8Command command = D8Command.builder()
.addProgramFiles(Paths.get(JAR))
.setMode(CompilationMode.RELEASE)
diff --git a/src/test/java/com/android/tools/r8/internal/D8FrameworkVerificationTest.java b/src/test/java/com/android/tools/r8/internal/D8FrameworkVerificationTest.java
index a4f33d5..8cd9409 100644
--- a/src/test/java/com/android/tools/r8/internal/D8FrameworkVerificationTest.java
+++ b/src/test/java/com/android/tools/r8/internal/D8FrameworkVerificationTest.java
@@ -3,13 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.internal;
-import com.android.tools.r8.CompilationException;
import com.android.tools.r8.CompilationMode;
import com.android.tools.r8.D8Command;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
-import java.io.IOException;
import java.nio.file.Paths;
-import java.util.concurrent.ExecutionException;
import org.junit.Test;
public class D8FrameworkVerificationTest extends CompilationTestBase {
@@ -17,8 +13,7 @@
private static final String JAR = "third_party/framework/framework_160115954.jar";
@Test
- public void verifyDebugBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyDebugBuild() throws Exception {
runAndCheckVerification(
D8Command.builder()
.addProgramFiles(Paths.get(JAR))
@@ -29,8 +24,7 @@
}
@Test
- public void verifyReleaseBuild()
- throws ExecutionException, IOException, ProguardRuleParserException, CompilationException {
+ public void verifyReleaseBuild() throws Exception {
runAndCheckVerification(
D8Command.builder()
.addProgramFiles(Paths.get(JAR))
diff --git a/src/test/java/com/android/tools/r8/internal/R8DisassemblerTest.java b/src/test/java/com/android/tools/r8/internal/R8DisassemblerTest.java
index 0d2c5af..ecff473 100644
--- a/src/test/java/com/android/tools/r8/internal/R8DisassemblerTest.java
+++ b/src/test/java/com/android/tools/r8/internal/R8DisassemblerTest.java
@@ -5,17 +5,13 @@
import static com.android.tools.r8.utils.AndroidApp.DEFAULT_PROGUARD_MAP_FILE;
-import com.android.tools.r8.CompilationException;
import com.android.tools.r8.Disassemble;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
import com.android.tools.r8.utils.FileUtils;
-import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
-import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,8 +38,7 @@
public boolean smali;
@Test
- public void testDisassemble()
- throws IOException, ExecutionException, ProguardRuleParserException, CompilationException {
+ public void testDisassemble() throws Exception {
// This test only ensures that we do not break disassembling of dex code. It does not
// check the generated code. To make it fast, we get rid of the output.
PrintStream originalOut = System.out;
diff --git a/src/test/java/com/android/tools/r8/jsr45/JSR45Tests.java b/src/test/java/com/android/tools/r8/jsr45/JSR45Tests.java
index b260304..c15b716 100644
--- a/src/test/java/com/android/tools/r8/jsr45/JSR45Tests.java
+++ b/src/test/java/com/android/tools/r8/jsr45/JSR45Tests.java
@@ -9,10 +9,8 @@
import com.android.tools.r8.R8;
import com.android.tools.r8.R8Command;
import com.android.tools.r8.ToolHelper;
-import com.android.tools.r8.dex.Constants;
import com.android.tools.r8.graph.DexAnnotationElement;
import com.android.tools.r8.graph.DexValue.DexValueString;
-import com.android.tools.r8.shaking.ProguardRuleParserException;
import com.android.tools.r8.utils.AndroidApiLevel;
import com.android.tools.r8.utils.AndroidApp;
import com.android.tools.r8.utils.DexInspector;
@@ -60,7 +58,7 @@
}
void compileWithR8(Path inputPath, Path outputPath, Path keepRulesPath)
- throws IOException, CompilationException, ProguardRuleParserException {
+ throws IOException, CompilationException {
AndroidApp androidApp =
R8.run(
R8Command.builder()
@@ -105,7 +103,7 @@
*/
@Test
public void testSourceDebugExtensionWithShriking1()
- throws IOException, CompilationException, ExecutionException, ProguardRuleParserException {
+ throws IOException, CompilationException, ExecutionException {
Path outputPath = tmpOutputDir.newFolder().toPath();
compileWithR8(INPUT_PATH, outputPath, DONT_SHRINK_DONT_OBFUSCATE_CONFIG);
checkAnnotationContent(INPUT_PATH, outputPath);
@@ -116,7 +114,7 @@
*/
@Test
public void testSourceDebugExtensionWithShrinking2()
- throws IOException, CompilationException, ExecutionException, ProguardRuleParserException {
+ throws IOException, CompilationException, ExecutionException {
Path outputPath = tmpOutputDir.newFolder().toPath();
compileWithR8(INPUT_PATH, outputPath, DONT_SHRINK_CONFIG);
checkAnnotationContent(INPUT_PATH, outputPath);
@@ -127,7 +125,7 @@
*/
@Test
public void testSourceDebugExtensionWithShrinking3()
- throws IOException, CompilationException, ExecutionException, ProguardRuleParserException {
+ throws IOException, CompilationException, ExecutionException {
Path outputPath = tmpOutputDir.newFolder().toPath();
compileWithR8(INPUT_PATH, outputPath, SHRINK_KEEP_CONFIG);
@@ -141,7 +139,7 @@
*/
@Test
public void testSourceDebugExtensionWithShrinking4()
- throws IOException, CompilationException, ExecutionException, ProguardRuleParserException {
+ throws IOException, CompilationException, ExecutionException {
Path outputPath = tmpOutputDir.newFolder().toPath();
compileWithR8(INPUT_PATH, outputPath, SHRINK_NO_KEEP_CONFIG);
diff --git a/src/test/java/com/android/tools/r8/shaking/TreeShakingSpecificTest.java b/src/test/java/com/android/tools/r8/shaking/TreeShakingSpecificTest.java
index 795c020..9b6ba29 100644
--- a/src/test/java/com/android/tools/r8/shaking/TreeShakingSpecificTest.java
+++ b/src/test/java/com/android/tools/r8/shaking/TreeShakingSpecificTest.java
@@ -6,20 +6,17 @@
import static com.android.tools.r8.ToolHelper.EXAMPLES_BUILD_DIR;
import static com.android.tools.r8.ToolHelper.EXAMPLES_DIR;
-import com.android.tools.r8.CompilationException;
import com.android.tools.r8.R8;
import com.android.tools.r8.R8Command;
import com.android.tools.r8.ToolHelper;
import com.android.tools.r8.errors.CompilationError;
import java.io.BufferedReader;
-import java.io.IOException;
import java.io.PrintStream;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import org.junit.Assert;
import org.junit.Rule;
@@ -37,8 +34,7 @@
public ExpectedException thrown = ExpectedException.none();
@Test
- public void testIgnoreWarnings()
- throws IOException, ProguardRuleParserException, ExecutionException, CompilationException {
+ public void testIgnoreWarnings() throws Exception {
// Generate R8 processed version without library option.
Path out = temp.getRoot().toPath();
String test = "shaking2";
@@ -54,8 +50,7 @@
}
@Test
- public void testMissingLibrary()
- throws IOException, ProguardRuleParserException, ExecutionException, CompilationException {
+ public void testMissingLibrary() throws Exception {
// Generate R8 processed version without library option.
Path out = temp.getRoot().toPath();
String test = "shaking2";
@@ -72,8 +67,7 @@
}
@Test
- public void testPrintMapping()
- throws IOException, ProguardRuleParserException, ExecutionException, CompilationException {
+ public void testPrintMapping() throws Exception {
// Generate R8 processed version without library option.
String test = "shaking1";
Path out = temp.getRoot().toPath();
diff --git a/src/test/java/com/android/tools/r8/smali/SmaliTestBase.java b/src/test/java/com/android/tools/r8/smali/SmaliTestBase.java
index 41f73d1..afe0e2a 100644
--- a/src/test/java/com/android/tools/r8/smali/SmaliTestBase.java
+++ b/src/test/java/com/android/tools/r8/smali/SmaliTestBase.java
@@ -505,8 +505,7 @@
.build();
ToolHelper.runR8WithFullResult(command, optionsConsumer);
return dexOutputDir.resolve("classes.dex");
- } catch (CompilationException | IOException | RecognitionException | ExecutionException
- | ProguardRuleParserException e) {
+ } catch (CompilationException | IOException | RecognitionException | ExecutionException e) {
throw new RuntimeException(e);
}
}