You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complex type arguments that involve multiple types and nested parameterized types are not currently handled correctly. The issue that happens is that the type params are split on ',' which doesn't respect nested type params.
I have fixed this locally by replacing:
final String[] split = m.group(2).split(",");
With:
final List<String> split = getStringTypes(m.group(2));
-------
private List<String> getStringTypes(String concatTypeArgs) {
if (!concatTypeArgs.contains("<")) {
return Arrays.asList(concatTypeArgs.split(","));
}
List<String> types = new ArrayList<>();
int bracketDepth = 0;
int startPos = 0;
for (int i = 0; i < concatTypeArgs.length(); i++) {
char c = concatTypeArgs.charAt(i);
if (c == ',' && bracketDepth == 0) {
types.add(concatTypeArgs.substring(startPos, i));
startPos = i + 1;
} else if (c == '<') {
bracketDepth++;
} else if (c == '>') {
bracketDepth--;
}
}
// Add final type if possible
if (startPos < concatTypeArgs.length()) {
types.add(concatTypeArgs.substring(startPos));
}
return types;
}
Source code you are trying to analyze/transform
SomeType<Integer,Double,MyType<Integer,Double>>
Source code for your Spoon processing
No response
Actual output
IntegerDoubleMyType<IntegerDouble>
Expected output
IntegerDoubleMyType<Integer,Double>
Spoon Version
11.1.0
JVM Version
17
What operating system are you using?
Windows
The text was updated successfully, but these errors were encountered:
Describe the bug
Complex type arguments that involve multiple types and nested parameterized types are not currently handled correctly. The issue that happens is that the type params are split on ',' which doesn't respect nested type params.
I have fixed this locally by replacing:
With:
Source code you are trying to analyze/transform
Source code for your Spoon processing
No response
Actual output
Expected output
Spoon Version
11.1.0
JVM Version
17
What operating system are you using?
Windows
The text was updated successfully, but these errors were encountered: