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

@Getter(lazy=true) does not work with byte/short/float fields and values that are initialized with a constant. #418

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

Comments

Projects
None yet
1 participant
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 345)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Feb 14, 2012 at 00:14 UTC

This is the stupidest bug report ever, because this is only an issue with constants, and why the heck would you want to @ Getter(lazy=true) on a constant?

Anyway, this:

private byte test = 1;

is fine, but throw a @ Getter(lazy=true) in there and it'll fail to compile, complaining that AtomicReference<Byte>(int) does not exist. Indeed it doesn't; only AtomicReference<Byte>(Byte) exists, and there's no type coercion+boxing path that leads from int to Byte.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Feb 14, 2012 at 00:14 UTC

This is the stupidest bug report ever, because this is only an issue with constants, and why the heck would you want to @ Getter(lazy=true) on a constant?

Anyway, this:

private byte test = 1;

is fine, but throw a @ Getter(lazy=true) in there and it'll fail to compile, complaining that AtomicReference<Byte>(int) does not exist. Indeed it doesn't; only AtomicReference<Byte>(Byte) exists, and there's no type coercion+boxing path that leads from int to Byte.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Feb 14, 2012 at 00:15 UTC

Wont fix anytime this century because it's actually relatively difficult to do so and as stated in the report this will never happen in real life.

Note that we might revisit the way we generate lazy constructors, and there's a chance this bug will end up solving itself when we do.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Feb 14, 2012 at 00:15 UTC

Wont fix anytime this century because it's actually relatively difficult to do so and as stated in the report this will never happen in real life.

Note that we might revisit the way we generate lazy constructors, and there's a chance this bug will end up solving itself when we do.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Feb 14, 2012 at 00:39 UTC

Whoops - the same problem occurs with something like:

@ Getter(lazy=true) private long foo = someExpensiveCalculationThatReturnsAnInt();

Fortunately, we figured out a really easy and elegant fix which we'll be committing shortly.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Feb 14, 2012 at 00:39 UTC

Whoops - the same problem occurs with something like:

@ Getter(lazy=true) private long foo = someExpensiveCalculationThatReturnsAnInt();

Fortunately, we figured out a really easy and elegant fix which we'll be committing shortly.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Feb 14, 2012 at 17:20 UTC

Fixed. Will be in whatever follows 0.10.8

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Feb 14, 2012 at 17:20 UTC

Fixed. Will be in whatever follows 0.10.8

@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

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