diff options
-rw-r--r-- | AUTHORS | 5 | ||||
-rw-r--r-- | doc/changelog.markdown | 5 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleDelegate.java | 11 | ||||
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java | 18 | ||||
-rw-r--r-- | test/transform/resource/after-delombok/DelegateWithDeprecated.java | 24 | ||||
-rw-r--r-- | test/transform/resource/after-ecj/DelegateWithDeprecated.java | 21 | ||||
-rw-r--r-- | test/transform/resource/before/DelegateWithDeprecated.java | 13 | ||||
-rw-r--r-- | website/credits.html | 30 | ||||
-rw-r--r-- | website/features/GetterSetter.html | 3 | ||||
-rw-r--r-- | website/sander.jpg | bin | 0 -> 53317 bytes | |||
-rw-r--r-- | website/unknown_person.gif | bin | 0 -> 412 bytes |
11 files changed, 95 insertions, 35 deletions
@@ -1,10 +1,11 @@ -Lombok contributors: +Lombok contributors in alphabetical order: +Jappe van der Hel <jappe.vanderhel@gmail.com> Philipp Eichhorn <peichhor@web.de> Reinier Zwitserloot <reinier@zwitserloot.com> Robbert Jan Grootjans <grootjans@gmail.com> Roel Spilker <r.spilker@gmail.com> Sander Koning <askoning@gmail.com> -Jappe van der Hel <jappe.vanderhel@gmail.com> +Taiki Sugawara <buzz.taiki@gmail.com> By adding your name to this list, you grant full and irrevocable copyright and patent indemnity to Project Lombok and all use of Project Lombok, and you certify that you have the right to do so for all commits you add to Project Lombok. diff --git a/doc/changelog.markdown b/doc/changelog.markdown index e65ec79b..9499638b 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -3,8 +3,9 @@ Lombok Changelog ### v0.10.9 (edge) * FEATURE: The combination of `@Delegate` and `@Getter` or `@Data` will now delegate to the result of a generated getter. [Issue #328](http://code.google.com/p/projectlombok/issues/detail?id=328) -* BUGFIX: `@Getter(lazy=true)` where the variable type is a primitive and the initializing expression is of a different primitive type that would type coerce implicitly, i.e. ints can be assigned to longs without a cast, didn't work before. [Issue #345](http://code.google.com/p/projectlombok/issues/detail?id=345) +* BUGFIX: When `@Delegate` would generate a method with type parameters of the type `T extends package.Class`, a dot would be prepended to the type name. [Issue #341](http://code.google.com/p/projectlombok/issues/detail?id=341) * BUGFIX: Using `val` with a type like `Outer<TypeArgs>.Inner` now works. [Issue #343](http://code.google.com/p/projectlombok/issues/detail?id=343) +* BUGFIX: `@Getter(lazy=true)` where the variable type is a primitive and the initializing expression is of a different primitive type that would type coerce implicitly, i.e. ints can be assigned to longs without a cast, didn't work before. [Issue #345](http://code.google.com/p/projectlombok/issues/detail?id=345) * BUGFIX: `val` is no longer legal inside basic for loops (the old kind, not the foreach kind). These variables should rarely be final, and in practice it wasn't possible to delombok this code properly. [Issue #346](http://code.google.com/p/projectlombok/issues/detail?id=346) ### v0.10.8 (January 19th, 2012) @@ -156,4 +157,4 @@ annotation is copied to the setter's parameter, and the getter's method. ### v0.8 * Initial release before announcements -* (note: There are a few different editions of lombok out there, all tagged with v0.8.)
\ No newline at end of file +* (note: There are a few different editions of lombok out there, all tagged with v0.8.) diff --git a/src/core/lombok/javac/handlers/HandleDelegate.java b/src/core/lombok/javac/handlers/HandleDelegate.java index 9eca23db..18817d49 100644 --- a/src/core/lombok/javac/handlers/HandleDelegate.java +++ b/src/core/lombok/javac/handlers/HandleDelegate.java @@ -22,6 +22,7 @@ package lombok.javac.handlers; import static lombok.javac.handlers.JavacHandlerUtil.*; +import static com.sun.tools.javac.code.Flags.*; import java.util.ArrayList; import java.util.Arrays; @@ -288,7 +289,13 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { for (TypeMirror param : sig.type.getTypeVariables()) { Name name = ((TypeVar) param).tsym.name; - typeParams.append(maker.TypeParameter(name, maker.Types(types.getBounds((TypeVar) param)))); + + ListBuffer<JCExpression> bounds = types.getBounds((TypeVar) param).isEmpty() ? null : new ListBuffer<JCExpression>(); + for (Type type : types.getBounds((TypeVar) param)) { + bounds.append(JavacResolution.typeToJCTree(type, annotation.getAst(), true)); + } + + typeParams.append(maker.TypeParameter(name, bounds.toList())); typeArgs.append(maker.Ident(name)); } @@ -329,7 +336,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { ExecutableType methodType = (ExecutableType) types.asMemberOf(ct, member); String sig = printSig(methodType, member.name, types); if (!banList.add(sig)) continue; //If add returns false, it was already in there - boolean isDeprecated = exElem.getAnnotation(Deprecated.class) != null; + boolean isDeprecated = (member.flags() & DEPRECATED) != 0; signatures.add(new MethodSig(member.name, methodType, isDeprecated, exElem)); } diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java index 87335b4e..acf1589d 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java @@ -21,8 +21,8 @@ */ package lombok.eclipse.agent; -import static lombok.eclipse.handlers.EclipseHandlerUtil.*; import static lombok.eclipse.Eclipse.*; +import static lombok.eclipse.handlers.EclipseHandlerUtil.*; import java.lang.reflect.Method; import java.util.ArrayList; @@ -65,7 +65,6 @@ import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeParameter; import org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; -import org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding; import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding; import org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.Binding; @@ -416,19 +415,6 @@ public class PatchDelegate { } } - private static boolean hasDeprecatedAnnotation(MethodBinding binding) { - AnnotationBinding[] annotations = binding.getAnnotations(); - if (annotations != null) for (AnnotationBinding ann : annotations) { - ReferenceBinding annType = ann.getAnnotationType(); - char[] pkg = annType.qualifiedPackageName(); - char[] src = annType.qualifiedSourceName(); - - if (charArrayEquals("java.lang", pkg) && charArrayEquals("Deprecated", src)) return true; - } - - return false; - } - public static void checkConflictOfTypeVarNames(BindingTuple binding, EclipseNode typeNode) throws CantMakeDelegates { TypeVariableBinding[] typeVars = binding.parameterized.typeVariables(); if (typeVars == null || typeVars.length == 0) return; @@ -581,7 +567,7 @@ public class PatchDelegate { method.modifiers = ClassFileConstants.AccPublic; method.returnType = makeType(binding.returnType, source, false); - boolean isDeprecated = hasDeprecatedAnnotation(binding); + boolean isDeprecated = binding.isDeprecated(); method.selector = binding.selector; diff --git a/test/transform/resource/after-delombok/DelegateWithDeprecated.java b/test/transform/resource/after-delombok/DelegateWithDeprecated.java new file mode 100644 index 00000000..04e12160 --- /dev/null +++ b/test/transform/resource/after-delombok/DelegateWithDeprecated.java @@ -0,0 +1,24 @@ +class DelegateWithDeprecated { + private Bar bar; + private interface Bar { + @Deprecated + void deprecatedAnnotation(); + /** @deprecated */ + void deprecatedComment(); + void notDeprecated(); + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void deprecatedAnnotation() { + this.bar.deprecatedAnnotation(); + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void deprecatedComment() { + this.bar.deprecatedComment(); + } + @java.lang.SuppressWarnings("all") + public void notDeprecated() { + this.bar.notDeprecated(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateWithDeprecated.java b/test/transform/resource/after-ecj/DelegateWithDeprecated.java new file mode 100644 index 00000000..2a4fdf98 --- /dev/null +++ b/test/transform/resource/after-ecj/DelegateWithDeprecated.java @@ -0,0 +1,21 @@ +import lombok.Delegate; +class DelegateWithDeprecated { + private interface Bar { + @Deprecated void deprecatedAnnotation(); + void deprecatedComment(); + void notDeprecated(); + } + private @Delegate Bar bar; + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void deprecatedAnnotation() { + this.bar.deprecatedAnnotation(); + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void deprecatedComment() { + this.bar.deprecatedComment(); + } + public @java.lang.SuppressWarnings("all") void notDeprecated() { + this.bar.notDeprecated(); + } + DelegateWithDeprecated() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/DelegateWithDeprecated.java b/test/transform/resource/before/DelegateWithDeprecated.java new file mode 100644 index 00000000..b748c6ec --- /dev/null +++ b/test/transform/resource/before/DelegateWithDeprecated.java @@ -0,0 +1,13 @@ +import lombok.Delegate; + +class DelegateWithDeprecated { + @Delegate private Bar bar; + + private interface Bar { + @Deprecated + void deprecatedAnnotation(); + /** @deprecated */ + void deprecatedComment(); + void notDeprecated(); + } +}
\ No newline at end of file diff --git a/website/credits.html b/website/credits.html index f35896f8..36c9895c 100644 --- a/website/credits.html +++ b/website/credits.html @@ -67,31 +67,39 @@ <div class="meat"> <h1>Project Lombok - About the authors and everyone that's helped us create Project Lombok.</h1> <div class="credits"> - <div class="aboutUs personList"> - <h3>Project Lombok was created by us:</h3> + <div class="committers personList"> + <h3>Regular contributors to Project Lombok:</h3> + <div class="person"> + <div class="imgCt"><img class="jappeImg" src="unknown_person.gif" /></div> + <span class="name">Jappe van der Hel</span> + </div> + <div class="person"> + <div class="imgCt"><img class="philippImg" src="unknown_person.gif" /></div> + <span class="name">Philipp Eichhorn</span> + </div> <div class="person"> <div class="imgCt"><img class="reinierImg" src="reinier.jpg" /></div> <span class="name">Reinier Zwitserloot</span> </div> <div class="person"> + <div class="imgCt"><img class="rjImg" src="robbertjan.jpg" /></div> + <span class="name">Robbert Jan Grootjans</span> + </div> + <div class="person"> <div class="imgCt"><img class="roelImg" src="roel.jpg" /></div> <span class="name">Roel Spilker</span> </div> - </div> - <div class="committers personList"> - <h3>These folks also have commit access:</h3> <div class="person"> - <div class="imgCt"><img class="rjImg" src="robbertjan.jpg" /></div> - <span class="name">Robbert Jan Grootjans</span> + <div class="imgCt"><img class="sanderImg" src="sander.jpg" /></div> + <span class="name">Sander Koning</span> </div> </div> <div class="thanks"> We'd like to thank:<ul> <li>Perry Nguyen (pfn on ##java on freenode) for creating the inspiration for project lombok.</li> - <li>Tor Norbye for some feedback on how Netbeans works internally. We haven't cracked the netbeans nut quite yet, and help is - very welcome. Still, we've made some progress in adding netbeans support to Project Lombok thanks to Tor.</li> - <li><a href="http://javaposse.com/">The Java Posse</a> for making the java community <em>awesome</em>. Listen to their podcast!</li> - <li>Petr Jiricka for his help with netbeans and javac.</li> + <li>Tor Norbye, Jan Lahoda, and Petr Jiricka for helping out with Netbeans internals and/or javac.</li> + <li><a href="http://javaposse.com/">The Java Posse</a> for making the java community <em>awesome</em>. Listen to their podcast!</li> + <li>all contributors who submitted patches or helped answering questions!</li> </ul> as well as the authors of the following tools that we use:<ul> <li><a href="http://code.google.com/">Google Code Hosting</a> for hosting our issue tracker as well as the lombok releases.</a></li> diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html index 2d3b4efa..159aa525 100644 --- a/website/features/GetterSetter.html +++ b/website/features/GetterSetter.html @@ -52,8 +52,7 @@ will not be generated if there's already a method <code>getFoo(int x)</code> even though it is technically possible to make the method. This caveat exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. </p><p> - For <code>boolean</code> fields that start with <code>is</code> or <code>has</code> immediately followed by a title-case letter, nothing is prefixed - to generate the getter name. + For <code>boolean</code> fields that start with <code>is</code> immediately followed by a title-case letter, nothing is prefixed to generate the getter name. </p><p> Any variation on <code>boolean</code> will <em>not</em> result in using the <code>is</code> prefix instead of the <code>get</code> prefix; for example, returning <code>java.lang.Boolean</code> results in a <code>get</code> prefix, not an <code>is</code> prefix. diff --git a/website/sander.jpg b/website/sander.jpg Binary files differnew file mode 100644 index 00000000..f3be1b28 --- /dev/null +++ b/website/sander.jpg diff --git a/website/unknown_person.gif b/website/unknown_person.gif Binary files differnew file mode 100644 index 00000000..c5ec6b89 --- /dev/null +++ b/website/unknown_person.gif |