< prev index next >

test/jdk/java/lang/constant/ClassDescTest.java

Print this page
rev 54588 : 8212975: ClassDesc should have a full name method
Reviewed-by: vromero

*** 167,176 **** --- 167,183 ---- assertEquals("", ConstantDescs.CD_int.arrayType().packageName()); assertEquals("", ConstantDescs.CD_String.arrayType().packageName()); assertEquals("", ClassDesc.of("Bar").arrayType().packageName()); } + public void testFullDisplayName() { + assertEquals(ClassDesc.ofDescriptor("Ljava/lang/String;").displayName(true), "java.lang.String"); + assertEquals(ClassDesc.ofDescriptor("[Ljava/lang/String;").displayName(true), "java.lang.String[]"); + assertEquals(ClassDesc.ofDescriptor("[[Ljava/lang/String;").displayName(true), "java.lang.String[][]"); + assertEquals(ClassDesc.ofDescriptor("I").displayName(true), "int"); + } + private void testBadArrayRank(ClassDesc cr) { try { cr.arrayType(-1); fail(""); } catch (IllegalArgumentException e) {
< prev index next >