We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71ca086 commit 249a4f1Copy full SHA for 249a4f1
log4j-api/src/main/java/org/apache/logging/log4j/util/internal/SerializationUtil.java
@@ -163,8 +163,7 @@ public static String stripArray(final Class<?> clazz) {
163
* @see Class#getName()
164
*/
165
public static String stripArray(final String name) {
166
- int offset;
167
- for (offset = 0; offset < name.length() && name.charAt(offset) == '['; offset++) {}
+ final int offset = name.lastIndexOf('[') + 1;
168
if (offset == 0) {
169
return name;
170
}
@@ -191,8 +190,7 @@ public static String stripArray(final String name) {
191
190
case "S":
192
return "short";
193
default:
194
- // Should never happen
195
- return name;
+ throw new IllegalArgumentException("Unsupported array class signature '" + name + "'");
196
197
198
0 commit comments