spoon
spoon copied to clipboard
[Bug] SniperJavaPrettyPrinter - Invalid ouput on annotated default method
Given the following input:
package org.example;
interface Example {
@Deprecated
default void doNotUseMePlease() {}
}
When performing a transformation on the class (changing the method name to "potato", for example) and pretty printing the model using SniperJavaPrettyPrinter, the annotation "@Deprecated" and the "default" keyword end-up merged together.
package org.example;
interface Example {
@Deprecateddefault void potato() {}
}
Code to reproduce the bug is available on GitHub: https://github.com/plcarmel/spoon-default-method-bug
> java -version
java version "11.0.13" 2021-10-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.13+10-LTS-370)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.13+10-LTS-370, mixed mode)
@plcarmel Thanks for the issue. We will have a look at this.
This might be related to https://github.com/INRIA/spoon/pull/4296.