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

Annotation attributes have no default value #423

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

Comments

Projects
None yet
3 participants
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 350)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

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(";");

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 grootjans   🕗 Mar 05, 2012 at 19:12 UTC

Collaborator

lombokissues commented Jul 14, 2015

👤 grootjans   🕗 Mar 05, 2012 at 19:12 UTC

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 grootjans   🕗 Mar 05, 2012 at 19:12 UTC

Collaborator

lombokissues commented Jul 14, 2015

👤 grootjans   🕗 Mar 05, 2012 at 19:12 UTC

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 grootjans   🕗 Mar 05, 2012 at 22:48 UTC

Collaborator

lombokissues commented Jul 14, 2015

👤 grootjans   🕗 Mar 05, 2012 at 22:48 UTC

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

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