Getting rid of javax.annotation imports [message #1688476] |
Fri, 20 March 2015 15:43  |
Eclipse User |
|
|
|
Hi,
I've initialized at EclipseCon a discussion to get rid of the mandatory
javax.annotation imports.
Bug 462686 - Remove the javax.annotation plug-in content -
https://bugs.eclipse.org/bugs/show_bug.cgi?id=462686
I really really hate them since day 1 (reusing those has been one of the
biggest mistakes in e4 we ever made!)
Now my question is how do e(fx)clipse adopters think about this topic?
If the platform does not push this into Mars, should we e(fx)clipse make
the move before and not ship our custom javax.annotation which is bound
to the JRE classes?
I'm currently in the mood of pushing this. Thoughts?
Tom
|
|
|
|
|
|
Re: Getting rid of javax.annotation imports [message #1689343 is a reply to message #1689313] |
Mon, 23 March 2015 07:14  |
Eclipse User |
|
|
|
The real problem is that there are 2 versions of
javax.annotation.PostConstruct/PreDestroy:
a) version A in the JRE
b) version B in the repackaged bundle
Just to be extra clear, you can now go both ways! The real problem is
that if you forgot the import package for javax.annotation your
@PostConstruct would never have called, while @PostConstruct is often
caught fairly soon, @PreDestroy could leak to memory leaks you'll
discover very hard.
Tom
On 23.03.15 10:31, Christoph Keimel wrote:
> It has caused a lot of bug tracking in our case because this can easily
> be forgotten. The result is often an NPE because some field has not been
> initialized, but it can also be more subtle. So, if you do not know
> about this issue, you think to yourself: Why does @Inject work but not
> @PostConstruct? Isn't that part of the same mechanism? So I am +1 for
> this change.
|
|
|
Powered by
FUDForum. Page generated in 0.30744 seconds