diff options
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleDelegate.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleDelegate.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/lombok/javac/handlers/HandleDelegate.java b/src/core/lombok/javac/handlers/HandleDelegate.java index 89ab97e4..c9da4738 100644 --- a/src/core/lombok/javac/handlers/HandleDelegate.java +++ b/src/core/lombok/javac/handlers/HandleDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2012 The Project Lombok Authors. + * Copyright (C) 2010-2014 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -190,7 +190,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { for (MethodSig sig : signaturesToDelegate) generateAndAdd(sig, annotationNode, delegateName, delegateReceiver); } - private void generateAndAdd(MethodSig sig, JavacNode annotation, Name delegateName, DelegateReceiver delegateReceiver) { + public void generateAndAdd(MethodSig sig, JavacNode annotation, Name delegateName, DelegateReceiver delegateReceiver) { List<JCMethodDecl> toAdd = new ArrayList<JCMethodDecl>(); try { toAdd.add(createDelegateMethod(sig, annotation, delegateName, delegateReceiver)); @@ -207,7 +207,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { } } - private static class CantMakeDelegates extends Exception { + public static class CantMakeDelegates extends Exception { Set<String> conflicted; } @@ -218,7 +218,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { * * @throws CantMakeDelegates If there's a conflict. Conflict list is in ex.conflicted. */ - private void checkConflictOfTypeVarNames(MethodSig sig, JavacNode annotation) throws CantMakeDelegates { + public void checkConflictOfTypeVarNames(MethodSig sig, JavacNode annotation) throws CantMakeDelegates { // As first step, we check if there's a conflict between the delegate method's type vars and our own class. if (sig.elem.getTypeParameters().isEmpty()) return; @@ -258,7 +258,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { } } - private JCMethodDecl createDelegateMethod(MethodSig sig, JavacNode annotation, Name delegateName, DelegateReceiver delegateReceiver) throws TypeNotConvertibleException, CantMakeDelegates { + public JCMethodDecl createDelegateMethod(MethodSig sig, JavacNode annotation, Name delegateName, DelegateReceiver delegateReceiver) throws TypeNotConvertibleException, CantMakeDelegates { /* public <T, U, ...> ReturnType methodName(ParamType1 name1, ParamType2 name2, ...) throws T1, T2, ... { * (return) delegate.<T, U>methodName(name1, name2); * } @@ -320,11 +320,11 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { return recursiveSetGeneratedBy(maker.MethodDef(mods, sig.name, returnType, toList(typeParams), toList(params), toList(thrown), bodyBlock, null), annotation.get(), annotation.getContext()); } - private static <T> com.sun.tools.javac.util.List<T> toList(ListBuffer<T> collection) { + public static <T> com.sun.tools.javac.util.List<T> toList(ListBuffer<T> collection) { return collection == null ? com.sun.tools.javac.util.List.<T>nil() : collection.toList(); } - private void addMethodBindings(List<MethodSig> signatures, ClassType ct, JavacTypes types, Set<String> banList) { + public void addMethodBindings(List<MethodSig> signatures, ClassType ct, JavacTypes types, Set<String> banList) { TypeSymbol tsym = ct.asElement(); if (tsym == null) return; @@ -347,7 +347,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { } } - private static class MethodSig { + public static class MethodSig { final Name name; final ExecutableType type; final boolean isDeprecated; @@ -374,7 +374,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { } } - private static String printSig(ExecutableType method, Name name, JavacTypes types) { + public static String printSig(ExecutableType method, Name name, JavacTypes types) { StringBuilder sb = new StringBuilder(); sb.append(name.toString()).append("("); boolean first = true; @@ -386,12 +386,12 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { return sb.append(")").toString(); } - private static String typeBindingToSignature(TypeMirror binding, JavacTypes types) { + public static String typeBindingToSignature(TypeMirror binding, JavacTypes types) { binding = types.erasure(binding); return binding.toString(); } - private enum DelegateReceiver { + public enum DelegateReceiver { METHOD { public JCExpression get(final JavacNode node, final Name name) { com.sun.tools.javac.util.List<JCExpression> nilExprs = com.sun.tools.javac.util.List.nil(); |