Context:
This is follow up commit to 6a2e7821ae6ffd41e8bae692a00bb498f9c3541b which should fix another edge case of Motif unable to find a dependency method of inner classes types given their full name value in javac is represented with $.
ScopeFactoryImpl is doing a lookup for a method based on the given Type.
The methodByType map is using TreeMap implementation where keys are matched based on Type's compareTo method, if at some point the Type's qualifiedName is mutated the map would not be able to find the key for the given type.
In the edge case the name will be mutated the same way described in 6a2e7821ae6ffd41e8bae692a00bb498f9c3541b.
Fix:
The actual fix is done by calling declaredType.asElement().kind which will mutate the fullName property of the type which eventually change the TypeMirror.toString() value.
Context: This is follow up commit to 6a2e7821ae6ffd41e8bae692a00bb498f9c3541b which should fix another edge case of Motif unable to find a dependency method of inner classes types given their full name value in javac is represented with $.
ScopeFactoryImpl is doing a lookup for a method based on the given Type.
The methodByType map is using TreeMap implementation where keys are matched based on Type's compareTo method, if at some point the Type's qualifiedName is mutated the map would not be able to find the key for the given type.
In the edge case the name will be mutated the same way described in 6a2e7821ae6ffd41e8bae692a00bb498f9c3541b.
Fix: The actual fix is done by calling
declaredType.asElement().kind
which will mutate the fullName property of the type which eventually change theTypeMirror.toString()
value.Below is the stacktrace of such change:
In order to limit the scope, the if statement is checking for "$" to execute the logic only on inner classes that have not been fully resolved.