Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] SniperJavaPrettyPrinter - Invalid ouput on annotated default method #4330

Open
plcarmel opened this issue Dec 6, 2021 · 1 comment
Labels

Comments

@plcarmel
Copy link

plcarmel commented Dec 6, 2021

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)
@algomaster99
Copy link
Contributor

@plcarmel Thanks for the issue. We will have a look at this.

This might be related to #4296.

@slarse slarse added the bug label Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants