File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
log4j-api/src/main/java/org/apache/logging/log4j/util/internal Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -163,8 +163,7 @@ public static String stripArray(final Class<?> clazz) {
163
163
* @see Class#getName()
164
164
*/
165
165
public static String stripArray (final String name ) {
166
- int offset ;
167
- for (offset = 0 ; offset < name .length () && name .charAt (offset ) == '[' ; offset ++) {}
166
+ final int offset = name .lastIndexOf ('[' ) + 1 ;
168
167
if (offset == 0 ) {
169
168
return name ;
170
169
}
@@ -191,8 +190,7 @@ public static String stripArray(final String name) {
191
190
case "S" :
192
191
return "short" ;
193
192
default :
194
- // Should never happen
195
- return name ;
193
+ throw new IllegalArgumentException ("Unsupported array class signature '" + name + "'" );
196
194
}
197
195
}
198
196
You can’t perform that action at this time.
0 commit comments