Annotation attributes have no default value #423

Closed
lombokissues opened this Issue Jul 14, 2015 · 5 comments

Projects

None yet

3 participants

@lombokissues
Collaborator

Migrated from Google Code (issue 350)

@lombokissues
Collaborator

๐Ÿ‘ค mayham17 ย  ๐Ÿ•— Mar 01, 2012 at 11:21 UTC

What steps will reproduce the problem?

When I add an inner annotation class inside a lombokized class the default values for the annotations attributes are not generated on delombok (for Javac)

What is the expected output? What do you see instead?

***** AnotationDefault.java *****
Difference in AnotationDefault.java on line 3 expected:< int bar()[ default 7];> but was:< int bar()[];>
**** Expected ******
class AnnotationDefault {

@ interface Foo {
    int bar() default 7;
}

}

**** Actual ******
// Generated by delombok at Thu Mar 01 12:13:33 CET 2012

class AnnotationDefault {

@ interface Foo {

    int bar();
}

}


What version of the product are you using? On what operating system?
>Source code as of Feb 28 2012
>MS Windows 7

Proposed patch: Add the following lines in PrettyCommentsPrinter.java after line 779:

> } else if (tree.defaultValue != null) {
> print(" default ");
> print(tree.defaultValue);
> print(";");

@lombokissues
Collaborator

๐Ÿ‘ค grootjans ย  ๐Ÿ•— Mar 05, 2012 at 19:12 UTC

@lombokissues lombokissues added this to the 0.10.9 milestone Jul 14, 2015
@lombokissues
Collaborator

๐Ÿ‘ค grootjans ย  ๐Ÿ•— Mar 05, 2012 at 19:12 UTC

@lombokissues
Collaborator

๐Ÿ‘ค grootjans ย  ๐Ÿ•— Mar 05, 2012 at 22:48 UTC

@lombokissues lombokissues assigned rspilker and unassigned grootjans Jul 14, 2015
@lombokissues lombokissues removed the accepted label Jul 14, 2015
@lombokissues
Collaborator

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment