first let me say that I'm very excited after coming across Lombok
today. I was once again fed up with writing/generating boilerplate
code which just makes the code more difficult to read, so I thought
about writing something like this, did a Google search - and voila.
Lombo goodness!
In order to have PropertyChangeSupport in my objects, I also installed
the Lombok Beans plugin. As there's no contact information specified
on the site, I take the liberty to post here and hope for an answer :)
Everything works fine but it throws this exception upon every save,
which is a bit annoying. This happens only if I replace @Data with
@Bean:
java.lang.ArrayIndexOutOfBoundsException: 2
at org.eclipse.jdt.core.dom.ASTConverter.convertType
(ASTConverter.java:3333)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:
772)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:
450)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations
(ASTConverter.java:179)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:
2694)
at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations
(ASTConverter.java:184)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:
2694)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:
1264)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert
(CompilationUnitResolver.java:256)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST
(ASTParser.java:933)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:657)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run
(ASTProvider.java:544)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST
(ASTProvider.java:537)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST
(ASTProvider.java:478)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:
126)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager
$PartListenerGroup.calculateASTandInform
(SelectionListenerWithASTManager.java:169)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager
$3.run(SelectionListenerWithASTManager.java:154)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Also it would be great to have facade/proxy methods for [add|remove]
PropertyChangeListener(String,PropertyChangeListener)
Best regards
Marcus
As to the PropertyChangeListener methods, there are some new methods,
in an as yet unpublished version. I am in the middle of a change to
the HandleFieldRef code (which works in Eclipse but not Javac
currently) and so it might be touch difficult to produce you a new
version instantly. As you are using Eclipse as long as you do not
need Javac to work in the same way I could produce an interim version
for you now.
David
thanks for the quick feedback. I have taken a closer look at the
circumstances under which the exception occurs.
It seems like it only gets thrown when enabling any actions in
"Preferences->Java->Editor->Save Actions"
Checking "Organize Imports" is enough to trip it; interestingly this
even happens if there are no actual unnecessary imports to remove.
If producing an interim version isn't too much trouble for you, I'd
appreciate it, but I can wait for a proper release also.
Greetings
Marcus
On 27 Jan., 17:15, David Goodenough <david.goodeno...@btconnect.com>
wrote:
David
Greetings
Marcus
NOTE 1- The Javac version in the git master is seriously broken, so
delombok is not functional. But Eclipse and ecj should work. Anyway
delombok does not seem to notice the changes I make in the handler and
so it is of little use with fieldRef.
NOTE 2- For the new Eclipse version rather than having to use
FieldRef.<Pojo,String>fieldRef(pojo.getField()) you now use fieldRef
(pojo.getField()) and the handler will work out the <Pojo,String> for
you.
NOTE 3- There is a new class ConvertingFieldRef with a static method
convert. There is also a FieldConverter which you subclass to do the
conversion. So if you have a target that requires a <Pojo,String> and
a source which has a value of Integer you would code convert(new
Int2String(),fieldRef(pojo.getValue())) where getValue returns an
Integer. Currently the converters are elsewhere, but I move them into
the project shortly.
David
On Jan 27, 6:40 pm, Marcus Ilgner <marcus.ilg...@gmail.com> wrote:
> A git version is fine.
> Thanks for the quick feedback again!
>
> Greetings
> Marcus
>
> On Wed, Jan 27, 2010 at 6:44 PM, David Goodenough
>
NOTE The javac handler is still broken in the git version.
On Jan 28, 11:08 am, David Goodenough <david.goodeno...@btconnect.com>
wrote:
All the best
Marcus
> --
> You received this message because you are subscribed to the Google
> Groups group for http://projectlombok.org/
>
> To post to this group, send email to project...@googlegroups.com
> To unsubscribe from this group, send email to
> project-lombo...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/project-lombok?hl=en
I have also just fixed a small problem in the FieldRef object (again a
corner case you are probably not using) but you might want to be sure
you have the latest version.
David
On Feb 1, 3:44 pm, Marcus Ilgner <marcus.ilg...@gmail.com> wrote:
> Great news! I just gave the new version a try and everything seems to
> work as expected now!
>
> All the best
> Marcus
>
> On Mon, Feb 1, 2010 at 2:47 PM, David Goodenough
>
> > Groups group forhttp://projectlombok.org/