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

@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
Milestone

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 345)

@lombokissues
Copy link
Author

👤 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
Copy link
Author

👤 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
Copy link
Author

👤 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
Copy link
Author

👤 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
Copy link
Author

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant