[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipse.org-committers] Users of projectlombok.org at eclipse.org?
|
I don't see what JSR-308 has to do with
this. AFAIK, that JSR is only about adding annotations in more places in
the code. Lombok is about changing the Java language by adding a preprocessor
that participates in the compilation and that can change the structure
of generated class files.
Normal annotation processors (including
JSR-308-aware) can only add compiler messages to a compilation unit and
generate new types, but they can't change an existing type.
For the mentioned problems (generate
getters, setters, hashCode, equals, toString), a plain annotation processor
would be a more viable solution, since that's fully portable. All of this
can be implemented as an annotation processor that generates super- and/or
sub-classes for an annotated class, see e.g. http://blogs.oracle.com/darcy/entry/properties_via_annotation_processing
. I don't know if any project actually implemented this completely.
HTH,
Markus
From:
| "Werner Keil" <werner.keil@xxxxxxx>
|
To:
| Markus Keller/Zurich/IBM@IBMCH, eclipse.org-committers@xxxxxxxxxxx,
|
Date:
| 2012-01-04 17:08
|
Subject:
| Re: [eclipse.org-committers] Users of
projectlombok.org at eclipse.org? |
Markus,
Thanks for your concerns,
Are there any aspects of Lombok you mentioned, that JSR-308 (Type Annotations
for Java) is not planning to change in different ecosystem but similar
way?
I already suggested to Marcel he might want to get in touch with 308 Checkers
community and consider working together or contributing to this very understaffed
and stuck JCP effort (the JSR is officially inactive since 2007, IBM is
also on the EG btw, but I have no clue to what extent they contribute http://jcp.org/en/jsr/summary?id=308)
HTH,
Werner
-------- Original-Nachricht --------
Datum: Wed, 4 Jan 2012 16:26:58 +0100
Von: Markus Keller <markus_keller@xxxxxxxxxx>
An: eclipse.org-committers@xxxxxxxxxxx
Betreff: Re: [eclipse.org-committers] Users of projectlombok.org at eclipse.org?
> Are there any concerns about using Project Lombok
at Eclipse?
Lombok creates an incompatible dialect of the Java language and it modifies
the IDE and the compiler in unsupported ways. While the goal sounds noble,
Lombok can't be shipped with Eclipse in its current form.
See e.g. http://jnb.ociweb.com/jnb/jnbJan2010.html#controversy
and
http://www.reddit.com/r/programming/comments/9bb1e/project_lombok_automatic_resource_management_for/c0c5f7o
Markus
Hi there,
before we start: A happy new year!
Little more than a month ago Denis mentioned that this list's purpose is
to ask questions related to committer topics. So here is one that bothers
me for a while now (hope this list is the right place to ask this question).
I frequently stumble over little annoying things like missing toString
methods, boilerplate code for getters and setters, as well as "implementing
hashCode" and "equals" etc. Most implementations look the
same. For instance, hashCode, toString and equals almost always look as
follows in our code:
public int hashCode(){
return org.apache.commons.lang3.HashCodeBuilder.reflectiveHashCode(this)
}
public boolean equals(Object other){
return org.apache.commons.lang3.EqualsBuilder.reflectiveEquals(this,other)
}
public String toString(){
return org.apache.commons.lang3.ToStringBuilder.reflectiveToString(this)
}
Project Lombok aims to assist developers here by using annotations such
as @ToString
or @ToString
or @EqualsAndHashCode.
See the screencast on http://projectlombok.org/
for more details on it. http://projectlombok.org/features/
gives a pretty fast overview of its features. It seems that there is also
an integration into Eclipse and into Maven to run the code generation as
part of your build. For the IDE Integration Lombok patches the code so
that it "sees" the generated methods but does not require you
to actually write it in source.
My questions to the list:
Does any project/committer use Project Lombok?
Does any project/committer use Spring Roo (which seems to be "not
that far away")?
Are there any concerns about using Project Lombok at Eclipse?
Thanks,
Marcel
--
Eclipse Code Recommenders:
w www.eclipse.org/recommenders
tw www.twitter.com/marcelbruch
g+ www.gplus.to/marcelbruch
_______________________________________________
eclipse.org-committers mailing list
eclipse.org-committers@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipse.org-committers
IMPORTANT: Membership in this list is generated by processes internal to
the Eclipse Foundation. To be permanently removed from this list,
you must contact emo@xxxxxxxxxxx
to request removal.
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone