]> source.dussan.org Git - aspectj.git/commitdiff
WildTypePattern.toString: do not parenthesesise generic type list
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Tue, 17 Jan 2023 14:16:32 +0000 (15:16 +0100)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Fri, 12 Apr 2024 13:32:39 +0000 (15:32 +0200)
It is unnecessary to represent a pattern list 'A,B,C' as '(A,B,C)'. Not
only does it look ugly in a type signature like 'org.acme.Foo<(A,B,C)>',
but also is it not valid Java syntax. While the latter might not be
strictly necessary in a String representation, it certainly is
desirable, if such representations are ever used to generate code or
@AspectJ pointcut annotations.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java

index 407b2f8d171cd4832b136db60945f3dc81bc3fe0..a77421e56ee019f3d935dea93becc0215423b5b5 100644 (file)
@@ -1196,7 +1196,7 @@ public class WildTypePattern extends TypePattern {
                }
                if (typeParameters != null && typeParameters.size() != 0) {
                        buf.append("<");
-                       buf.append(typeParameters.toString());
+                       buf.append(typeParameters.toString().replaceFirst("^.(.*).$", "$1"));
                        buf.append(">");
                }
                if (includeSubtypes) {