aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2020-04-16 23:37:14 +0200
committerGitHub <noreply@github.com>2020-04-16 23:37:14 +0200
commitc8e21dd3367876a73fba2539b7d3831a934832f9 (patch)
tree854e241afe411230d312cd4a256a21df07e331a1
parent94440a8bd73f176637a9890dc10df67d26615674 (diff)
parent736904298202bb75c27243f930c9e48bf2139be9 (diff)
downloadlombok-c8e21dd3367876a73fba2539b7d3831a934832f9.tar.gz
lombok-c8e21dd3367876a73fba2539b7d3831a934832f9.tar.bz2
lombok-c8e21dd3367876a73fba2539b7d3831a934832f9.zip
Merge pull request #2409 from janrieke/superBuilderFixAIOOBE
[SuperBuilder] fix IndexOutOfBounds (fixes #2407)
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSuperBuilder.java2
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderBasic.java4
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderBasic.java4
-rw-r--r--test/transform/resource/before/SuperBuilderBasic.java2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
index 6634d1c8..a49c20a4 100644
--- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
@@ -242,7 +242,7 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> {
String superclassBuilderClassName = builderClassNameTemplate.replace("*", superclassClassName);
char[][] tokens = Arrays.copyOf(qualifiedTypeReference.tokens, qualifiedTypeReference.tokens.length + 1);
- tokens[tokens.length] = superclassBuilderClassName.toCharArray();
+ tokens[tokens.length-1] = superclassBuilderClassName.toCharArray();
long[] poss = new long[tokens.length];
Arrays.fill(poss, p);
diff --git a/test/transform/resource/after-delombok/SuperBuilderBasic.java b/test/transform/resource/after-delombok/SuperBuilderBasic.java
index c347e41c..c3fa86f2 100644
--- a/test/transform/resource/after-delombok/SuperBuilderBasic.java
+++ b/test/transform/resource/after-delombok/SuperBuilderBasic.java
@@ -81,10 +81,10 @@ public class SuperBuilderBasic {
return new SuperBuilderBasic.Parent.ParentBuilderImpl();
}
}
- public static class Child extends Parent {
+ public static class Child extends SuperBuilderBasic.Parent {
double field3;
@java.lang.SuppressWarnings("all")
- public static abstract class ChildBuilder<C extends SuperBuilderBasic.Child, B extends SuperBuilderBasic.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ public static abstract class ChildBuilder<C extends SuperBuilderBasic.Child, B extends SuperBuilderBasic.Child.ChildBuilder<C, B>> extends SuperBuilderBasic.Parent.ParentBuilder<C, B> {
@java.lang.SuppressWarnings("all")
private double field3;
@java.lang.Override
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasic.java b/test/transform/resource/after-ecj/SuperBuilderBasic.java
index b47f318d..7902c95f 100644
--- a/test/transform/resource/after-ecj/SuperBuilderBasic.java
+++ b/test/transform/resource/after-ecj/SuperBuilderBasic.java
@@ -71,8 +71,8 @@ public class SuperBuilderBasic {
return new SuperBuilderBasic.Parent.ParentBuilderImpl();
}
}
- public static @lombok.experimental.SuperBuilder class Child extends Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderBasic.Child, B extends SuperBuilderBasic.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ public static @lombok.experimental.SuperBuilder class Child extends SuperBuilderBasic.Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderBasic.Child, B extends SuperBuilderBasic.Child.ChildBuilder<C, B>> extends SuperBuilderBasic.Parent.ParentBuilder<C, B> {
private @java.lang.SuppressWarnings("all") double field3;
public ChildBuilder() {
super();
diff --git a/test/transform/resource/before/SuperBuilderBasic.java b/test/transform/resource/before/SuperBuilderBasic.java
index f4e8c670..99d7284e 100644
--- a/test/transform/resource/before/SuperBuilderBasic.java
+++ b/test/transform/resource/before/SuperBuilderBasic.java
@@ -8,7 +8,7 @@ public class SuperBuilderBasic {
}
@lombok.experimental.SuperBuilder
- public static class Child extends Parent {
+ public static class Child extends SuperBuilderBasic.Parent {
double field3;
}