aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java7
-rw-r--r--src/core/lombok/javac/JavacResolution.java6
2 files changed, 11 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index 010dc9d8..438314ca 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -893,7 +893,12 @@ public class EclipseHandlerUtil {
WildcardBinding wildcard = (WildcardBinding) binding;
if (wildcard.boundKind == Wildcard.EXTENDS) {
if (!allowCompound) {
- return makeType(wildcard.bound, pos, false);
+ TypeBinding bound = wildcard.bound;
+ boolean isObject = bound.id == TypeIds.T_JavaLangObject;
+ TypeBinding[] otherBounds = wildcard.otherBounds;
+ if (isObject && otherBounds != null && otherBounds.length > 0) {
+ return makeType(otherBounds[0], pos, false);
+ } else return makeType(bound, pos, false);
} else {
Wildcard out = new Wildcard(Wildcard.EXTENDS);
setGeneratedBy(out, pos);
diff --git a/src/core/lombok/javac/JavacResolution.java b/src/core/lombok/javac/JavacResolution.java
index abbf6726..7f940d2a 100644
--- a/src/core/lombok/javac/JavacResolution.java
+++ b/src/core/lombok/javac/JavacResolution.java
@@ -336,7 +336,7 @@ public class JavacResolution {
if (type instanceof ClassType) {
List<Type> ifaces = ((ClassType) type).interfaces_field;
Type supertype = ((ClassType) type).supertype_field;
- if (ifaces != null && ifaces.length() == 1) {
+ if (isObject(supertype) && ifaces != null && ifaces.length() > 0) {
return typeToJCTree(ifaces.get(0), ast, allowCompound, allowVoid);
}
if (supertype != null) return typeToJCTree(supertype, ast, allowCompound, allowVoid);
@@ -402,6 +402,10 @@ public class JavacResolution {
return genericsToJCTreeNodes(generics, ast, replacement);
}
+ private static boolean isObject(Type supertype) {
+ return supertype.tsym.toString().equals("java.lang.Object");
+ }
+
private static JCExpression genericsToJCTreeNodes(List<Type> generics, JavacAST ast, JCExpression rawTypeNode) throws TypeNotConvertibleException {
if (generics != null && !generics.isEmpty()) {
ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();