@@ -129,21 +129,6 @@ public enum HierarchyTraversalMode {
129
129
BOTTOM_UP
130
130
}
131
131
132
- // Pattern: "[Ljava.lang.String;", "[[[[Ljava.lang.String;", etc.
133
- private static final Pattern VM_INTERNAL_OBJECT_ARRAY_PATTERN = Pattern .compile ("^(\\ [+)L(.+);$" );
134
-
135
- /**
136
- * Pattern: "[x", "[[[[x", etc., where x is Z, B, C, D, F, I, J, S, etc.
137
- *
138
- * <p>The pattern intentionally captures the last bracket with the
139
- * capital letter so that the combination can be looked up via
140
- * {@link #classNameToTypeMap}. For example, the last matched group
141
- * will contain {@code "[I"} instead of {@code "I"}.
142
- *
143
- * @see Class#getName()
144
- */
145
- private static final Pattern VM_INTERNAL_PRIMITIVE_ARRAY_PATTERN = Pattern .compile ("^(\\ [+)(\\ [[ZBCDFIJS])$" );
146
-
147
132
// Pattern: "java.lang.String[]", "int[]", "int[][][][]", etc.
148
133
// ?> => non-capturing atomic group
149
134
// ++ => possessive quantifier
@@ -855,32 +840,8 @@ public static Try<Class<?>> tryToLoadClass(String name, ClassLoader classLoader)
855
840
}
856
841
857
842
return Try .call (() -> {
858
- Matcher matcher ;
859
-
860
- // Primitive arrays such as "[I", "[[[[D", etc.
861
- matcher = VM_INTERNAL_PRIMITIVE_ARRAY_PATTERN .matcher (trimmedName );
862
- if (matcher .matches ()) {
863
- String brackets = matcher .group (1 );
864
- String componentTypeName = matcher .group (2 );
865
- // Calculate dimensions by counting brackets.
866
- int dimensions = brackets .length ();
867
-
868
- return loadArrayType (classLoader , componentTypeName , dimensions );
869
- }
870
-
871
- // Object arrays such as "[Ljava.lang.String;", "[[[[Ljava.lang.String;", etc.
872
- matcher = VM_INTERNAL_OBJECT_ARRAY_PATTERN .matcher (trimmedName );
873
- if (matcher .matches ()) {
874
- String brackets = matcher .group (1 );
875
- String componentTypeName = matcher .group (2 );
876
- // Calculate dimensions by counting brackets.
877
- int dimensions = brackets .length ();
878
-
879
- return loadArrayType (classLoader , componentTypeName , dimensions );
880
- }
881
-
882
843
// Arrays such as "java.lang.String[]", "int[]", "int[][][][]", etc.
883
- matcher = SOURCE_CODE_SYNTAX_ARRAY_PATTERN .matcher (trimmedName );
844
+ Matcher matcher = SOURCE_CODE_SYNTAX_ARRAY_PATTERN .matcher (trimmedName );
884
845
if (matcher .matches ()) {
885
846
String componentTypeName = matcher .group (1 );
886
847
String bracketPairs = matcher .group (2 );
0 commit comments