diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-04-23 22:36:07 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-04-23 22:36:07 +0200 |
commit | a27826b268c28a7aa1596bb07461ab1cfb113d82 (patch) | |
tree | ed589f67954005c4169855e75ac8fcbde9decd6c /src | |
parent | 472d602693bdccde135ff084c44bfebd285a2101 (diff) | |
download | lombok-a27826b268c28a7aa1596bb07461ab1cfb113d82.tar.gz lombok-a27826b268c28a7aa1596bb07461ab1cfb113d82.tar.bz2 lombok-a27826b268c28a7aa1596bb07461ab1cfb113d82.zip |
[bugfix] generics on inner classes whose outer type has generics, when the outer type is an interface, caused bugs in ecj.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java index 75339f7c..3e226269 100644 --- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java @@ -479,14 +479,16 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH list.add(type.getName()); if (addWildcards) genericsCount.add(arraySizeOf(((TypeDeclaration) type.get()).typeParameters)); - boolean staticContext = (((TypeDeclaration) type.get()).modifiers & Modifier.STATIC) != 0; + boolean staticContext = (((TypeDeclaration) type.get()).modifiers & ClassFileConstants.AccStatic) != 0; EclipseNode tNode = type.up(); + if (!staticContext && tNode.getKind() == Kind.TYPE && (((TypeDeclaration) tNode.get()).modifiers & ClassFileConstants.AccInterface) != 0) staticContext = true; while (tNode != null && tNode.getKind() == Kind.TYPE) { list.add(tNode.getName()); if (addWildcards) genericsCount.add(staticContext ? 0 : arraySizeOf(((TypeDeclaration) tNode.get()).typeParameters)); if (!staticContext) staticContext = (((TypeDeclaration) tNode.get()).modifiers & Modifier.STATIC) != 0; tNode = tNode.up(); + if (!staticContext && tNode.getKind() == Kind.TYPE && (((TypeDeclaration) tNode.get()).modifiers & ClassFileConstants.AccInterface) != 0) staticContext = true; } Collections.reverse(list); if (addWildcards) Collections.reverse(genericsCount); |