diff options
| author | 2016-04-25 12:51:37 -0700 | |
|---|---|---|
| committer | 2016-04-25 16:21:34 -0700 | |
| commit | f417ff44d1eb111854d7a213f106912b3dd9e3d4 (patch) | |
| tree | be69b00348b8d296a5bae7dd2c17d9f9a2b8ba0e /test/595-error-class/src/Main.java | |
| parent | dbea8b4eacb62b357bce1bc299c8442788b288a1 (diff) | |
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
Diffstat (limited to 'test/595-error-class/src/Main.java')
| -rw-r--r-- | test/595-error-class/src/Main.java | 30 |
1 files changed, 30 insertions, 0 deletions
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"); + } +} |