aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-06-18 03:33:13 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2013-06-18 03:33:13 +0200
commite047d2b94e1206bbf304725c20ee20afbd1681fb (patch)
tree7a029712048261591be7d49409a3772618a1c3f4 /src/core
parent359b7845f21ac7ad023ce1a13af8f6b5d1833068 (diff)
downloadlombok-e047d2b94e1206bbf304725c20ee20afbd1681fb.tar.gz
lombok-e047d2b94e1206bbf304725c20ee20afbd1681fb.tar.bz2
lombok-e047d2b94e1206bbf304725c20ee20afbd1681fb.zip
Added a ClassDef wrapper, because its signature changed between javac1.6 and javac1.7. (The wrapper uses reflection). Need for: javac @Builder impl.
Also added some utilities to JavacHandlerUtil.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index 23bc2daf..92cebf4c 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -730,11 +730,11 @@ public class JavacHandlerUtil {
*
* Also takes care of updating the JavacAST.
*/
- public static void injectField(JavacNode typeNode, JCVariableDecl field) {
- injectField(typeNode, field, false);
+ public static JavacNode injectField(JavacNode typeNode, JCVariableDecl field) {
+ return injectField(typeNode, field, false);
}
- private static void injectField(JavacNode typeNode, JCVariableDecl field, boolean addSuppressWarnings) {
+ private static JavacNode injectField(JavacNode typeNode, JCVariableDecl field, boolean addSuppressWarnings) {
JCClassDecl type = (JCClassDecl) typeNode.get();
if (addSuppressWarnings) addSuppressWarningsAll(field.mods, typeNode, field.pos, getGeneratedBy(field));
@@ -760,7 +760,7 @@ public class JavacHandlerUtil {
insertAfter.tail = fieldEntry;
}
- typeNode.add(field, Kind.FIELD);
+ return typeNode.add(field, Kind.FIELD);
}
private static boolean isEnumConstant(final JCVariableDecl field) {
@@ -1026,6 +1026,13 @@ public class JavacHandlerUtil {
return result.toList();
}
+ public static List<JCTypeParameter> copyTypeParams(TreeMaker maker, List<JCTypeParameter> params) {
+ if (params == null || params.isEmpty()) return params;
+ ListBuffer<JCTypeParameter> out = ListBuffer.lb();
+ for (JCTypeParameter tp : params) out.append(maker.TypeParameter(tp.name, tp.bounds));
+ return out.toList();
+ }
+
public static JCExpression namePlusTypeParamsToTypeReference(TreeMaker maker, Name typeName, List<JCTypeParameter> params) {
ListBuffer<JCExpression> typeArgs = ListBuffer.lb();