[test] this covers more eclipse versions

This commit is contained in:
Reinier Zwitserloot committed 2020-07-10 02:57:45 +02:00
1 parent 1fd2401bad
commit 4fdcdd126a
9 files changed
+104 -45

No files matched your search

@@ -124,7 +124,7 @@ class CheckerFrameworkSuperBuilder {
return new CheckerFrameworkSuperBuilder.Parent.ParentBuilderImpl();
}
}
public static class Child extends Parent {
public static class ZChild extends Parent {
int a;
int b;
@java.lang.SuppressWarnings("all")
@@ -132,7 +132,7 @@ class CheckerFrameworkSuperBuilder {
return 1;
}
@java.lang.SuppressWarnings("all")
public static abstract class ChildBuilder<C extends CheckerFrameworkSuperBuilder.Child, B extends CheckerFrameworkSuperBuilder.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
public static abstract class ChildBuilder<C extends CheckerFrameworkSuperBuilder.ZChild, B extends CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
@java.lang.SuppressWarnings("all")
private boolean a$set;
@java.lang.SuppressWarnings("all")
@@ -147,17 +147,17 @@ class CheckerFrameworkSuperBuilder {
@org.checkerframework.dataflow.qual.SideEffectFree
@java.lang.Override
@java.lang.SuppressWarnings("all")
public abstract C build(@org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.Child this);
public abstract C build(@org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.ZChild this);
@org.checkerframework.checker.builder.qual.ReturnsReceiver
@java.lang.SuppressWarnings("all")
public B a(@org.checkerframework.checker.builder.qual.NotCalledMethods("a") CheckerFrameworkSuperBuilder.Child.ChildBuilder<C, B> this, final int a) {
public B a(@org.checkerframework.checker.builder.qual.NotCalledMethods("a") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<C, B> this, final int a) {
this.a$value = a;
a$set = true;
return self();
}
@org.checkerframework.checker.builder.qual.ReturnsReceiver
@java.lang.SuppressWarnings("all")
public B b(@org.checkerframework.checker.builder.qual.NotCalledMethods("b") CheckerFrameworkSuperBuilder.Child.ChildBuilder<C, B> this, final int b) {
public B b(@org.checkerframework.checker.builder.qual.NotCalledMethods("b") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<C, B> this, final int b) {
this.b = b;
return self();
}
@@ -165,41 +165,41 @@ class CheckerFrameworkSuperBuilder {
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "CheckerFrameworkSuperBuilder.Child.ChildBuilder(super=" + super.toString() + ", a$value=" + this.a$value + ", b=" + this.b + ")";
return "CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder(super=" + super.toString() + ", a$value=" + this.a$value + ", b=" + this.b + ")";
}
}
@java.lang.SuppressWarnings("all")
private static final class ChildBuilderImpl extends CheckerFrameworkSuperBuilder.Child.ChildBuilder<CheckerFrameworkSuperBuilder.Child, CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl> {
private static final class ZChildBuilderImpl extends CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<CheckerFrameworkSuperBuilder.ZChild, CheckerFrameworkSuperBuilder.ZChild.ChildBuilderImpl> {
@org.checkerframework.common.aliasing.qual.Unique
@java.lang.SuppressWarnings("all")
private ChildBuilderImpl() {
private ZChildBuilderImpl() {
}
@java.lang.Override
@org.checkerframework.checker.builder.qual.ReturnsReceiver
@org.checkerframework.dataflow.qual.Pure
@java.lang.SuppressWarnings("all")
protected CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl self() {
protected CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl self() {
return this;
}
@org.checkerframework.dataflow.qual.SideEffectFree
@java.lang.Override
@java.lang.SuppressWarnings("all")
public CheckerFrameworkSuperBuilder.Child build(@org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl this) {
return new CheckerFrameworkSuperBuilder.Child(this);
public CheckerFrameworkSuperBuilder.ZChild build(@org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl this) {
return new CheckerFrameworkSuperBuilder.ZChild(this);
}
}
@org.checkerframework.dataflow.qual.SideEffectFree
@java.lang.SuppressWarnings("all")
protected Child(final CheckerFrameworkSuperBuilder.Child.ChildBuilder<?, ?> b) {
protected ZChild(final CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<?, ?> b) {
super(b);
if (b.a$set) this.a = b.a$value;
else this.a = CheckerFrameworkSuperBuilder.Child.$default$a();
else this.a = CheckerFrameworkSuperBuilder.ZChild.$default$a();
this.b = b.b;
}
@org.checkerframework.dataflow.qual.SideEffectFree
@java.lang.SuppressWarnings("all")
public static CheckerFrameworkSuperBuilder.Child.ChildBuilder<?, ?> builder() {
return new CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl();
public static CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<?, ?> builder() {
return new CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl();
}
}
}
@@ -1,4 +1,6 @@
// version 8:
import java.io.Serializable;
class ValLambda {
static {
final java.lang.Runnable foo = (System.currentTimeMillis() > 0) ? (Runnable) () -> {
@@ -15,8 +17,8 @@ class ValLambda {
};
}
public void easyIntersectionLambda() {
final java.lang.Runnable foo = (Runnable & java.io.Serializable) () -> {
public void intersectionLambda() {
final java.io.Serializable foo = (Runnable & Serializable) () -> {
};
final java.io.Serializable bar = (java.io.Serializable & Runnable) () -> {
};
@@ -94,38 +94,38 @@ class CheckerFrameworkSuperBuilder {
return new CheckerFrameworkSuperBuilder.Parent.ParentBuilderImpl();
}
}
public static @lombok.experimental.SuperBuilder class Child extends Parent {
public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends CheckerFrameworkSuperBuilder.Child, B extends CheckerFrameworkSuperBuilder.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
public static @lombok.experimental.SuperBuilder class ZChild extends Parent {
public static abstract @java.lang.SuppressWarnings("all") class ZChildBuilder<C extends CheckerFrameworkSuperBuilder.ZChild, B extends CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
private @java.lang.SuppressWarnings("all") int a$value;
private @java.lang.SuppressWarnings("all") boolean a$set;
private @java.lang.SuppressWarnings("all") int b;
public ChildBuilder() {
public ZChildBuilder() {
super();
}
protected abstract @java.lang.Override @org.checkerframework.checker.builder.qual.ReturnsReceiver @org.checkerframework.dataflow.qual.Pure @java.lang.SuppressWarnings("all") B self();
public abstract @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") C build(final @org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.Child.ChildBuilder this);
public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B a(final @org.checkerframework.checker.builder.qual.NotCalledMethods("a") CheckerFrameworkSuperBuilder.Child.ChildBuilder this, final int a) {
public abstract @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") C build(final @org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder this);
public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B a(final @org.checkerframework.checker.builder.qual.NotCalledMethods("a") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder this, final int a) {
this.a$value = a;
a$set = true;
return self();
}
public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B b(final @org.checkerframework.checker.builder.qual.NotCalledMethods("b") CheckerFrameworkSuperBuilder.Child.ChildBuilder this, final int b) {
public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B b(final @org.checkerframework.checker.builder.qual.NotCalledMethods("b") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder this, final int b) {
this.b = b;
return self();
}
public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") java.lang.String toString() {
return (((((("CheckerFrameworkSuperBuilder.Child.ChildBuilder(super=" + super.toString()) + ", a$value=") + this.a$value) + ", b=") + this.b) + ")");
return (((((("CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder(super=" + super.toString()) + ", a$value=") + this.a$value) + ", b=") + this.b) + ")");
}
}
private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends CheckerFrameworkSuperBuilder.Child.ChildBuilder<CheckerFrameworkSuperBuilder.Child, CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl> {
private ChildBuilderImpl() {
private static final @java.lang.SuppressWarnings("all") class ZChildBuilderImpl extends CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<CheckerFrameworkSuperBuilder.ZChild, CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl> {
private ZChildBuilderImpl() {
super();
}
protected @java.lang.Override @org.checkerframework.checker.builder.qual.ReturnsReceiver @org.checkerframework.dataflow.qual.Pure @java.lang.SuppressWarnings("all") CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl self() {
protected @java.lang.Override @org.checkerframework.checker.builder.qual.ReturnsReceiver @org.checkerframework.dataflow.qual.Pure @java.lang.SuppressWarnings("all") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl self() {
return this;
}
public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") CheckerFrameworkSuperBuilder.Child build(final @org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl this) {
return new CheckerFrameworkSuperBuilder.Child(this);
public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") CheckerFrameworkSuperBuilder.ZChild build(final @org.checkerframework.checker.builder.qual.CalledMethods("b") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl this) {
return new CheckerFrameworkSuperBuilder.ZChild(this);
}
}
@lombok.Builder.Default int a;
@@ -133,16 +133,16 @@ class CheckerFrameworkSuperBuilder {
private static @java.lang.SuppressWarnings("all") int $default$a() {
return 1;
}
protected @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") Child(final CheckerFrameworkSuperBuilder.Child.ChildBuilder<?, ?> b) {
protected @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") ZChild(final CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<?, ?> b) {
super(b);
if (b.a$set)
this.a = b.a$value;
else
this.a = CheckerFrameworkSuperBuilder.Child.$default$a();
this.a = CheckerFrameworkSuperBuilder.ZChild.$default$a();
this.b = b.b;
}
public static @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") CheckerFrameworkSuperBuilder.Child.ChildBuilder<?, ?> builder() {
return new CheckerFrameworkSuperBuilder.Child.ChildBuilderImpl();
public static @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<?, ?> builder() {
return new CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl();
}
}
CheckerFrameworkSuperBuilder() {
@@ -0,0 +1,53 @@
import java.lang.annotation.*;
@lombok.EqualsAndHashCode class EqualsAndHashCodeAnnotated {
@Target(ElementType.TYPE_USE) @Retention(RetentionPolicy.SOURCE) @interface Annotated {
}
@Annotated int primitive;
@Annotated Object object;
int @Annotated [] primitiveValues;
int @Annotated [] @Annotated [] morePrimitiveValues;
Integer @Annotated [] objectValues;
Integer @Annotated [] @Annotated [] moreObjectValues;
EqualsAndHashCodeAnnotated() {
super();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
if ((! (o instanceof EqualsAndHashCodeAnnotated)))
return false;
final EqualsAndHashCodeAnnotated other = (EqualsAndHashCodeAnnotated) o;
if ((! other.canEqual((java.lang.Object) this)))
return false;
if ((this.primitive != other.primitive))
return false;
final java.lang.Object this$object = this.object;
final java.lang.Object other$object = other.object;
if (((this$object == null) ? (other$object != null) : (! this$object.equals(other$object))))
return false;
if ((! java.util.Arrays.equals(this.primitiveValues, other.primitiveValues)))
return false;
if ((! java.util.Arrays.deepEquals(this.morePrimitiveValues, other.morePrimitiveValues)))
return false;
if ((! java.util.Arrays.deepEquals(this.objectValues, other.objectValues)))
return false;
if ((! java.util.Arrays.deepEquals(this.moreObjectValues, other.moreObjectValues)))
return false;
return true;
}
protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
return (other instanceof EqualsAndHashCodeAnnotated);
}
public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
final int PRIME = 59;
int result = 1;
result = ((result * PRIME) + this.primitive);
final java.lang.Object $object = this.object;
result = ((result * PRIME) + (($object == null) ? 43 : $object.hashCode()));
result = ((result * PRIME) + java.util.Arrays.hashCode(this.primitiveValues));
result = ((result * PRIME) + java.util.Arrays.deepHashCode(this.morePrimitiveValues));
result = ((result * PRIME) + java.util.Arrays.deepHashCode(this.objectValues));
result = ((result * PRIME) + java.util.Arrays.deepHashCode(this.moreObjectValues));
return result;
}
}
@@ -1,3 +1,5 @@
import java.io.Serializable;
class ValLambda {
static {
final @lombok.val java.lang.Runnable foo = ((System.currentTimeMillis() > 0) ? (Runnable) () -> {
@@ -16,8 +18,8 @@ class ValLambda {
final @lombok.val java.lang.Runnable foo = (Runnable) () -> {
};
}
public void easyIntersectionLambda() {
final @lombok.val java.lang.Runnable foo = (Runnable & java.io.Serializable) () -> {
public void intersectionLambda() {
final @lombok.val java.io.Serializable foo = (Runnable & Serializable) () -> {
};
final @lombok.val java.io.Serializable bar = (java.io.Serializable & Runnable) () -> {
};
@@ -12,7 +12,7 @@ class CheckerFrameworkSuperBuilder {
}
@lombok.experimental.SuperBuilder
public static class Child extends Parent {
public static class ZChild extends Parent {
@lombok.Builder.Default int a = 1;
int b;
}
@@ -1,4 +1,6 @@
// version 8:
import java.io.Serializable;
class ValLambda {
static {
@@ -12,8 +14,8 @@ class ValLambda {
lombok.val foo = (Runnable)()-> {};
}
public void easyIntersectionLambda() {
lombok.val foo = (Runnable & java.io.Serializable)()-> {};
public void intersectionLambda() {
lombok.val foo = (Runnable & Serializable)()-> {};
lombok.val bar = (java.io.Serializable & Runnable)()-> {};
}
+5 -5
View File
@@ -1,21 +1,21 @@
class ValLub {
public void easyLub() {
java.util.Map<String, Number> m = java.util.Collections.emptyMap();
lombok.val foo = (System.currentTimeMillis() > 0) ? m : java.util.Collections.<String, Number>emptyMap();
}
public void sillyLubWithUnboxingThatProducesErrorThatVarIsPrimitive() {
Integer i = 20;
Double d = 20.0;
lombok.val thisShouldBePrimitiveDouble = (System.currentTimeMillis() > 0) ? i : d;
}
public void hardLub() {
java.util.List<String> list = new java.util.ArrayList<String>();
java.util.Set<String> set = new java.util.HashSet<String>();
lombok.val thisShouldBeCollection = (System.currentTimeMillis() > 0) ? list : set;
thisShouldBeCollection.add("");
String foo = thisShouldBeCollection.iterator().next();
@@ -1,2 +1,2 @@
23 Function is a raw type. References to generic type Function<T,R> should be parameterized
24 Function is a raw type. References to generic type Function<T,R> should be parameterized
24 Function is a raw type. References to generic type Function<T,R> should be parameterized
25 Function is a raw type. References to generic type Function<T,R> should be parameterized