changeset 53405:23d27d946185 jep-334

changes to ClassDescTest
author vromero
date Tue, 13 Nov 2018 08:51:50 -0500
parents 6d0439b38280
children d1bdbb71f3a0 040b6b246ac2
files test/jdk/java/lang/constant/ClassDescTest.java
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/java/lang/constant/ClassDescTest.java	Tue Nov 13 08:27:50 2018 -0500
+++ b/test/jdk/java/lang/constant/ClassDescTest.java	Tue Nov 13 08:51:50 2018 -0500
@@ -155,25 +155,16 @@
         testClassDesc(thisClassDesc, ClassDescTest.class);
     }
 
-    private void testBadPackageName(ClassDesc cr) {
-        try {
-            cr.packageName();
-            fail("");
-        } catch (IllegalStateException e) {
-            // good
-        }
-    }
-
     public void testPackageName() {
         assertEquals("com.foo", ClassDesc.of("com.foo.Bar").packageName());
         assertEquals("com.foo", ClassDesc.of("com.foo.Bar").inner("Baz").packageName());
         assertEquals("", ClassDesc.of("Bar").packageName());
         assertEquals("", ClassDesc.of("Bar").inner("Baz").packageName());
 
-        testBadPackageName(ConstantDescs.CD_int);
-        testBadPackageName(ConstantDescs.CD_int.arrayType());
-        testBadPackageName(ConstantDescs.CD_String.arrayType());
-        testBadPackageName(ClassDesc.of("Bar").arrayType());
+        assertEquals("", ConstantDescs.CD_int.packageName());
+        assertEquals("", ConstantDescs.CD_int.arrayType().packageName());
+        assertEquals("", ConstantDescs.CD_String.arrayType().packageName());
+        assertEquals("", ClassDesc.of("Bar").arrayType().packageName());
     }
 
     private void testBadArrayRank(ClassDesc cr) {