Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Support a compile time warning with @Warning #114

Closed
fommil opened this Issue Jul 26, 2012 · 8 comments

Comments

Projects
None yet
3 participants

fommil commented Jul 26, 2012

I had the same idea as this chap

http://stackoverflow.com/questions/6889659

and it occurred to me that Lombok might be the place to implement such functionality.

For example, I might wish to mark a method with the following:

@Warning("See upstream issue #HHH-7476 for details")
public void read() {
         ...
}

and then I would expect to see a println from my compiler when I compile the class, something like

WARNING in path.to.MyClass.read: "See upstream issue #HHH-7476 for details"

@ghost ghost assigned peichhorn Jul 26, 2012

Owner

peichhorn commented Jul 26, 2012

How should the IDE behave? If it's OK, to see a warning there as well, it should be super easy. Otherwise I don't know how hard it's going to be.

fommil commented Jul 26, 2012

I think optimally the IDE should show a warning when the method is used but - like @deprecated - that might need to be supported in the IDE (e.g. with a NetBeans 'hint').

For the Lombok implementation, it would be good just to print it to the console on compile.

Sam

On 26 Jul 2012, at 17:43, Philipp Eichhorn wrote:

How should the IDE behave? If it's OK to see a warning there as well, it should be super easy. Otherwise I don't know hard it's going to be.


Reply to this email directly or view it on GitHub:
#114 (comment)

Owner

peichhorn commented Jul 26, 2012

Done. Both Netbeans IDE and Eclipse show the warning as well.
(it would have been a lot harder not to show a warning, that's why I asked)

example: 8:21 WARNING in method test.WarningPlain.read(): "See upstream issue #HHH-7476 for details"

@peichhorn peichhorn closed this Jul 26, 2012

fommil commented Jul 26, 2012

Awesome, thanks!

Owner

peichhorn commented Jul 26, 2012

I've also created a wiki page for the feature.
Feel free to add anything to the page, if you think something is missing.

@peichhorn peichhorn added a commit that referenced this issue Jul 26, 2012

@peichhorn peichhorn [Issue #114] readme update 50223e2
Owner

peichhorn commented Jul 30, 2012

Please use the 0.11.3 release available on maven central, link

EDIT: Sorry this feature is not in the release.. I have to deploy a new snapshot then..
BTW the snapshots are removed automatically once a proper release has been published.

I haven't tried it yet, so please don't be mad if i ask an obvious question:
Can you suppress this warning? I think that you can't at the moment because a warning type is missing.

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