File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1708,6 +1708,7 @@ public static Class<?>[] getGenericTypes(Field f) {
17081708 Matcher m = PTN .matcher (gts );
17091709 if (m .find ()) {
17101710 String s = m .group (2 );
1711+ s = s .replaceAll ("<+.*?>+" , "" );
17111712 String [] ss = Strings .splitIgnoreBlank (s );
17121713 if (ss .length > 0 ) {
17131714 Class <?>[] re = new Class <?>[ss .length ];
Original file line number Diff line number Diff line change @@ -501,6 +501,9 @@ class Abcc {
501501
502502 List <?> list2 ;
503503
504+ List <Map <String , String >> list3 ;
505+
506+ Map <String , List <Map <String , ?>>> map3 ;
504507 }
505508
506509 @ Test
@@ -530,6 +533,14 @@ public void test_getGenericTypes() throws Exception {
530533 f = Abcc .class .getDeclaredField ("name" );
531534 types = Mirror .getGenericTypes (f );
532535 assertEquals (0 , types .length );
536+
537+ f = Abcc .class .getDeclaredField ("list3" );
538+ types = Mirror .getGenericTypes (f );
539+ assertEquals (1 , types .length );
540+
541+ f = Abcc .class .getDeclaredField ("map3" );
542+ types = Mirror .getGenericTypes (f );
543+ assertEquals (2 , types .length );
533544 }
534545
535546 public static class TBOC {
You can’t perform that action at this time.
0 commit comments