-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NotJavadoc
: IllegalArgumentException: Overlapping ranges not permitted but found [89..95] overlapping [89..95]
#4040
Comments
This looks like the same crash as #4034 Do you know what code lombok is generating, e.g. what the output of https://projectlombok.org/features/delombok is? |
Delombok output.package name.remal.gradle_plugins.toolkit;
final class CrossCompileServiceImpl {
private final String className;
private final CrossCompileServiceDependencyVersion dependencyVersion;
public boolean isFallback() {
return getDependencyVersion().getVersion() == null;
}
@Override
public String toString() {
return getClassName() + " (" + "dependency=" + getDependencyVersion().getDependency() + ", version=" + getDependencyVersion().getVersion() + ", earlierIncluded=" + getDependencyVersion().isEarlierIncluded() + ", selfIncluded=" + getDependencyVersion().isSelfIncluded() + ", laterIncluded=" + getDependencyVersion().isLaterIncluded() + ')';
}
CrossCompileServiceImpl(final String className, final CrossCompileServiceDependencyVersion dependencyVersion) {
this.className = className;
this.dependencyVersion = dependencyVersion;
}
public static class CrossCompileServiceImplBuilder {
private String className;
private CrossCompileServiceDependencyVersion dependencyVersion;
CrossCompileServiceImplBuilder() {
}
/**
* @return {@code this}.
*/
@javax.annotation.Nonnull
public CrossCompileServiceImpl.CrossCompileServiceImplBuilder className(final String className) {
this.className = className;
return this;
}
/**
* @return {@code this}.
*/
@javax.annotation.Nonnull
public CrossCompileServiceImpl.CrossCompileServiceImplBuilder dependencyVersion(final CrossCompileServiceDependencyVersion dependencyVersion) {
this.dependencyVersion = dependencyVersion;
return this;
}
@javax.annotation.Nonnull
public CrossCompileServiceImpl build() {
return new CrossCompileServiceImpl(this.className, this.dependencyVersion);
}
@javax.annotation.Nonnull
@Override
public String toString() {
return "CrossCompileServiceImpl.CrossCompileServiceImplBuilder(className=" + this.className + ", dependencyVersion=" + this.dependencyVersion + ")";
}
}
@javax.annotation.Nonnull
public static CrossCompileServiceImpl.CrossCompileServiceImplBuilder builder() {
return new CrossCompileServiceImpl.CrossCompileServiceImplBuilder();
}
private CrossCompileServiceImpl() {
this.className = null;
this.dependencyVersion = null;
}
public String getClassName() {
return this.className;
}
public CrossCompileServiceDependencyVersion getDependencyVersion() {
return this.dependencyVersion;
}
@Override
public boolean equals(@javax.annotation.Nullable final Object o) {
if (o == this) return true;
if (!(o instanceof CrossCompileServiceImpl)) return false;
final CrossCompileServiceImpl other = (CrossCompileServiceImpl) o;
final Object this$className = this.getClassName();
final Object other$className = other.getClassName();
if (this$className == null ? other$className != null : !this$className.equals(other$className)) return false;
final Object this$dependencyVersion = this.getDependencyVersion();
final Object other$dependencyVersion = other.getDependencyVersion();
if (this$dependencyVersion == null ? other$dependencyVersion != null : !this$dependencyVersion.equals(other$dependencyVersion)) return false;
return true;
}
@Override
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $className = this.getClassName();
result = result * PRIME + ($className == null ? 43 : $className.hashCode());
final Object $dependencyVersion = this.getDependencyVersion();
result = result * PRIME + ($dependencyVersion == null ? 43 : $dependencyVersion.hashCode());
return result;
}
}
I also set a breakpoint to BugChecker:321. What ErrorProne sees.package name.remal.gradle_plugins.toolkit;
import lombok.Builder;
import lombok.Value;
@Value()
@Builder()
final class CrossCompileServiceImpl {
private final String className;
private final CrossCompileServiceDependencyVersion dependencyVersion;
public boolean isFallback() {
return getDependencyVersion().getVersion() == null;
}
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
CrossCompileServiceImpl(final String className, final CrossCompileServiceDependencyVersion dependencyVersion) {
super();
this.className = className;
this.dependencyVersion = dependencyVersion;
}
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public static class CrossCompileServiceImplBuilder {
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
private String className;
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
private CrossCompileServiceDependencyVersion dependencyVersion;
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
CrossCompileServiceImplBuilder() {
super();
}
/**
* @return {@code this}.
*/
@javax.annotation.Nonnull()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public CrossCompileServiceImpl.CrossCompileServiceImplBuilder className(final String className) {
this.className = className;
return this;
}
/**
* @return {@code this}.
*/
@javax.annotation.Nonnull()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public CrossCompileServiceImpl.CrossCompileServiceImplBuilder dependencyVersion(final CrossCompileServiceDependencyVersion dependencyVersion) {
this.dependencyVersion = dependencyVersion;
return this;
}
@javax.annotation.Nonnull()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public CrossCompileServiceImpl build() {
return new CrossCompileServiceImpl(this.className, this.dependencyVersion);
}
@javax.annotation.Nonnull()
@java.lang.Override()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public java.lang.String toString() {
return "CrossCompileServiceImpl.CrossCompileServiceImplBuilder(className=" + this.className + ", dependencyVersion=" + this.dependencyVersion + ")";
}
}
@javax.annotation.Nonnull()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public static CrossCompileServiceImpl.CrossCompileServiceImplBuilder builder() {
return new CrossCompileServiceImpl.CrossCompileServiceImplBuilder();
}
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
private CrossCompileServiceImpl() {
super();
this.className = null;
this.dependencyVersion = null;
}
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public String getClassName() {
return this.className;
}
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public CrossCompileServiceDependencyVersion getDependencyVersion() {
return this.dependencyVersion;
}
@java.lang.Override()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public boolean equals(@javax.annotation.Nullable()
final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof CrossCompileServiceImpl)) return false;
final CrossCompileServiceImpl other = (CrossCompileServiceImpl)o;
final java.lang.Object this$className = this.getClassName();
final java.lang.Object other$className = other.getClassName();
if (this$className == null ? other$className != null : !this$className.equals(other$className)) return false;
final java.lang.Object this$dependencyVersion = this.getDependencyVersion();
final java.lang.Object other$dependencyVersion = other.getDependencyVersion();
if (this$dependencyVersion == null ? other$dependencyVersion != null : !this$dependencyVersion.equals(other$dependencyVersion)) return false;
return true;
}
@java.lang.Override()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $className = this.getClassName();
result = result * PRIME + ($className == null ? 43 : $className.hashCode());
final java.lang.Object $dependencyVersion = this.getDependencyVersion();
result = result * PRIME + ($dependencyVersion == null ? 43 : $dependencyVersion.hashCode());
return result;
}
@javax.annotation.Nonnull()
@java.lang.Override()
@java.lang.SuppressWarnings(value = "all")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code")
@lombok.Generated()
public java.lang.String toString() {
return "CrossCompileServiceImpl(className=" + this.getClassName() + ", dependencyVersion=" + this.getDependencyVersion() + ")";
}
} |
We are seeing this same new crash in the NullAway repo when updating to EP 2.21.0. To repro, check out this branch: https://github.com/msridhar/NullAway/tree/not-javadoc-lombok-crash-repro And then run
I see the same crash when updating our Lombok dependence to the latest version, 1.18.28. |
Some printf debugging with the NullAway repro shows the usual issue with Lombok generating AST nodes with synthetic nodes with bogus positions that overlap, e.g.
|
Also reported at projectlombok/lombok#3476 in case it can be fixed on the Lombok side |
I have a pending fix to handle the overlapping ranges, I think it's harmless to ignore the overlaps and that will result in |
#4040 PiperOrigin-RevId: 553865143
#4040 PiperOrigin-RevId: 553911083
Confirmed that Error Prone 2.21.1 works without crashing for NullAway's Lombok test. Thanks @cushon! |
I referenced this issue in google/guava#3033; that feature could prevent issues such as this one in the future. |
error-prone version: 2.21.0
BugPattern: NotJavadoc
Stack Trace:
The class that fails:
lombok.config
:The text was updated successfully, but these errors were encountered: