summaryrefslogtreecommitdiff
path: root/test/518-null-array-get/src
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-12-06 09:55:21 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2022-12-06 15:10:32 +0000
commitc8c95288c70b8d05dfaa25cf52fa3621a35f1596 (patch)
tree271ed04f2b93ea43d1f4ca6d3104cacb36b880c2 /test/518-null-array-get/src
parentda91abf4ec6686fce3e17668743ee8f85191e1f3 (diff)
ART: Change indentation to 4 spaces in run-test shards 15-19.
Created with for testName in \ `git grep -E '^ public static void main\(String\[\]' \ -- test/*<i>-*/src/Main.java | \ sed '-es/\/src\/Main.java:.*//'`; \ do \ find $testName/ -type f -name *.java | \ xargs sed -E '-es/^(( )+)/\1\1/' --in-place ; \ done with <i> manually set to 15 to 19. Manually address many long lines and fix other style issues. Test: testrunner.py --host --optimizing Change-Id: I20e443155e4a2c91a6c484f24783c0d4b87ca928
Diffstat (limited to 'test/518-null-array-get/src')
-rw-r--r--test/518-null-array-get/src/Main.java60
1 files changed, 30 insertions, 30 deletions
diff --git a/test/518-null-array-get/src/Main.java b/test/518-null-array-get/src/Main.java
index 7090194d32..12e2442a68 100644
--- a/test/518-null-array-get/src/Main.java
+++ b/test/518-null-array-get/src/Main.java
@@ -18,37 +18,37 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Main {
- public static void main(String[] args) throws Exception {
- checkLoad("NullArrayFailInt2Object", true);
- checkLoad("NullArrayFailObject2Int", true);
- checkLoad("NullArraySuccessInt", false);
- checkLoad("NullArraySuccessInt2Float", false);
- checkLoad("NullArraySuccessShort", false);
- checkLoad("NullArraySuccessRef", false);
- }
+ public static void main(String[] args) throws Exception {
+ checkLoad("NullArrayFailInt2Object", true);
+ checkLoad("NullArrayFailObject2Int", true);
+ checkLoad("NullArraySuccessInt", false);
+ checkLoad("NullArraySuccessInt2Float", false);
+ checkLoad("NullArraySuccessShort", false);
+ checkLoad("NullArraySuccessRef", false);
+ }
- private static void checkLoad(String className, boolean expectError) throws Exception {
- Class<?> c;
- try {
- c = Class.forName(className);
- if (expectError) {
- throw new RuntimeException("Expected error for " + className);
- }
- Method m = c.getMethod("method");
- try {
- m.invoke(null);
- throw new RuntimeException("Expected an InvocationTargetException");
- } catch (InvocationTargetException e) {
- if (!(e.getCause() instanceof NullPointerException)) {
- throw new RuntimeException("Expected a NullPointerException");
+ private static void checkLoad(String className, boolean expectError) throws Exception {
+ Class<?> c;
+ try {
+ c = Class.forName(className);
+ if (expectError) {
+ throw new RuntimeException("Expected error for " + className);
+ }
+ Method m = c.getMethod("method");
+ try {
+ m.invoke(null);
+ throw new RuntimeException("Expected an InvocationTargetException");
+ } catch (InvocationTargetException e) {
+ if (!(e.getCause() instanceof NullPointerException)) {
+ throw new RuntimeException("Expected a NullPointerException");
+ }
+ System.out.println(className);
+ }
+ } catch (VerifyError e) {
+ if (!expectError) {
+ throw new RuntimeException(e);
+ }
+ System.out.println(className);
}
- System.out.println(className);
- }
- } catch (VerifyError e) {
- if (!expectError) {
- throw new RuntimeException(e);
- }
- System.out.println(className);
}
- }
}