garydgregory commented on code in PR #1391:
URL: https://github.com/apache/commons-lang/pull/1391#discussion_r2315874579


##########
src/test/java/org/apache/commons/lang3/ClassUtilsTest.java:
##########
@@ -237,6 +237,15 @@ public void test_getAllSuperclasses_Class() {
         assertNull(ClassUtils.getAllSuperclasses(null));
     }
 
+    @Test
+    public void test_getShortCanonicalName_MalformedInput() {
+        assertEquals("String[]", ClassUtils.getShortCanonicalName("[String"));

Review Comment:
   I do not see how `"[String"` is a legal name,  but `"[Ljava.lang.String;"` 
is legal. Do you read the JLS to allow this? For an unpackaged class `Foo`, an 
array would be `"[LFoo;"`.
   



##########
src/test/java/org/apache/commons/lang3/ClassUtilsTest.java:
##########
@@ -237,6 +237,15 @@ public void test_getAllSuperclasses_Class() {
         assertNull(ClassUtils.getAllSuperclasses(null));
     }
 
+    @Test
+    public void test_getShortCanonicalName_MalformedInput() {
+        assertEquals("String[]", ClassUtils.getShortCanonicalName("[String"));
+    }
+    @Test
+    public void test_getShortCanonicalName_MissingSemicolon() {
+        assertEquals("String[]", ClassUtils.getShortCanonicalName("[LString"));

Review Comment:
   I do not see how `"[LString"` is a legal name,  but `"[Ljava.lang.String;"` 
is legal. Do you read the JLS to allow this? For an unpackaged class `Foo`, an 
array would be `"[LFoo;"`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to