mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 12:14:31 +00:00
Remove equals and now final hashCode method from test compilation unit
hashCode is now final in the parent class, so we cannot override it. To avoid an NPE in the base implementation, we need to set the owner field. The PRIMARY working copy owner seems to be sufficient.
This commit is contained in:
1 parent
cad428ea74
commit
dd95627811
1 file changed
+2
-9
@@ -52,6 +52,7 @@ import org.eclipse.jdt.internal.compiler.batch.FileSystem;
|
||||
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
|
||||
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
|
||||
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
|
||||
import org.eclipse.jdt.internal.core.DefaultWorkingCopyOwner;
|
||||
import org.eclipse.jdt.internal.core.JavaModelManager;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
@@ -308,7 +309,7 @@ public class RunTestsViaEcj extends AbstractRunTests {
|
||||
private final char[] mainTypeName;
|
||||
|
||||
private TestCompilationUnitEclipse(String name, String source) {
|
||||
super(null, name, null);
|
||||
super(null, name, DefaultWorkingCopyOwner.PRIMARY);
|
||||
this.source = source.toCharArray();
|
||||
|
||||
char[] fileNameCharArray = getFileName();
|
||||
@@ -320,14 +321,6 @@ public class RunTestsViaEcj extends AbstractRunTests {
|
||||
mainTypeName = CharOperation.subarray(fileNameCharArray, start, end);
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj) {
|
||||
return this == obj;
|
||||
}
|
||||
|
||||
@Override public char[] getContents() {
|
||||
return source;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user