ASMParser { public List<TypeReference> types() { List<TypeReference> typeList = new LinkedList<TypeReference>(); while (true) { if (input.LA(1) == ANTLRStringStream.EOF) { break; } typeList.add(mTYPE(true)); } return typeList; } ASMParser(
                      String type ); List<TypeReference> types(); TypeReference type(); MethodDeclaration method( String name,
                                     boolean isConstructor );  }
@Test public void testGenericType1() { final String type = "Ljava/util/List<*>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.List<?>", types.get(0).getFullName()); }
@Test public void testGenericType2() { final String type = "Ljava/util/List<+Ljava/lang/Number;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.List<? extends java.lang.Number>", types.get(0).getFullName()); }
@Test public void testGenericType3() { final String type = "Ljava/util/List<-Ljava/lang/Number;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.List<? instanceOf java.lang.Number>", types.get(0).getFullName()); }
@Test public void testGenericType4() { final String type = "Ljava/util/HashMap<TK;TV;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.HashMap<K, V>", types.get(0).getFullName()); }
@Test public void testGenericType5() { final String type = "Ljava/lang/Class<+TT;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.lang.Class<? extends T>", types.get(0).getFullName()); }
@Test public void testType1() { final String type = "Ljava/util/List<Ljava/lang/Integer;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.List<java.lang.Integer>", types.get(0).getFullName()); }
@Test public void testType2() { final String type = "Ljava/util/List<[Ljava/util/List<Ljava/lang/String;>;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.List<java.util.List<java.lang.String>[]>", types.get(0).getFullName()); }
@Test public void testType3() { final String type = "ZCB"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(3, types.size()); Assert.assertEquals("boolean", types.get(0).getFullName()); Assert.assertEquals("char", types.get(1).getFullName()); Assert.assertEquals("byte", types.get(2).getFullName()); }
@Test public void testType4() { final String type = "Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>.HashIterator<Ljava/lang/String;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.HashMap<java.lang.String, java.lang.String>.HashIterator<java.lang.String>", types.get(0).getFullName()); }
@Test public void testType5() { final String type = "Ljava/util/List<[[[Ljava/util/List<Ljava/lang/String;>;>;"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(1, types.size()); Assert.assertEquals("java.util.List<java.util.List<java.lang.String>[][][]>", types.get(0).getFullName()); }
@Test public void testType6() { final String type = "ZLjava/lang/String;CB"; final ASMParser parser = new ASMParser(type); final List<TypeReference> types = parser.types(); Assert.assertEquals(4, types.size()); Assert.assertEquals("boolean", types.get(0).getFullName()); Assert.assertEquals("java.lang.String", types.get(1).getFullName()); Assert.assertEquals("char", types.get(2).getFullName()); Assert.assertEquals("byte", types.get(3).getFullName()); }