From f417ff44d1eb111854d7a213f106912b3dd9e3d4 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Mon, 25 Apr 2016 12:51:37 -0700 Subject: Test component type for errors too. With regression test. Rationale: Moved erroneous check in convenience method, so we put all the same logic in one place. When testing for erroneous T[], check both the array type as well at the component type T for errors (it is possible T[] is not marked erroneous even though T is eventually). BUG=28358598 Change-Id: I11339a976dc83e0493a99e6bb97f3a058ca3f796 --- test/595-error-class/src/Main.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/595-error-class/src/Main.java (limited to 'test/595-error-class/src/Main.java') diff --git a/test/595-error-class/src/Main.java b/test/595-error-class/src/Main.java new file mode 100644 index 0000000000..655fa4336a --- /dev/null +++ b/test/595-error-class/src/Main.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.lang.reflect.*; + +public class Main { + + public static void main(String args[]) throws Throwable { + Class c = Class.forName("Merge"); + Method m = c.getMethod("select", boolean.class); + Object x = m.invoke(null, true); + if (x == null) { + throw new Error("Did not get array"); + } + System.out.println("passed"); + } +} -- cgit v1.2.3-59-g8ed1b