Compare commits
No commits in common. "50f2a29e1eaf180ace500be197581a562111a55c" and "12bb613eb0080e57af06f909160ddc89c786ebc4" have entirely different histories.
50f2a29e1e
...
12bb613eb0
@ -1,11 +0,0 @@
|
|||||||
import java.util.List;
|
|
||||||
import java.lang.Integer;
|
|
||||||
import java.lang.String;
|
|
||||||
import java.lang.Object;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class Bug338 {
|
|
||||||
public hashCode() {
|
|
||||||
return List.of(42);
|
|
||||||
}
|
|
||||||
}
|
|
@ -366,6 +366,7 @@ public class ASTToTargetAST {
|
|||||||
for (var i = 0; i < params.size(); i++) {
|
for (var i = 0; i < params.size(); i++) {
|
||||||
var a = TargetType.toPrimitive(params.get(i).pattern().type());
|
var a = TargetType.toPrimitive(params.get(i).pattern().type());
|
||||||
var b = convert(sParams.getFormalparalist().get(i).getType());
|
var b = convert(sParams.getFormalparalist().get(i).getType());
|
||||||
|
System.out.println(a + " " + b);
|
||||||
if (!Objects.equals(a, b)) return false;
|
if (!Objects.equals(a, b)) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -386,11 +387,8 @@ public class ASTToTargetAST {
|
|||||||
var superMethod = findSuperMethodToOverride(currentClass, method.getName(), params);
|
var superMethod = findSuperMethodToOverride(currentClass, method.getName(), params);
|
||||||
if (superMethod.isPresent()) {
|
if (superMethod.isPresent()) {
|
||||||
// If we find a super method to override, use its parameters and return types
|
// If we find a super method to override, use its parameters and return types
|
||||||
var newReturnType = convert(superMethod.get().getReturnType(), this.generics.javaGenerics);
|
returnType = convert(superMethod.get().getReturnType(), this.generics.javaGenerics);
|
||||||
if (newReturnType instanceof TargetPrimitiveType && TargetType.toPrimitive(returnType).equals(newReturnType)) {
|
params = convert(superMethod.get().getParameterList(), method.getParameterList(), this.generics.javaGenerics);
|
||||||
returnType = newReturnType;
|
|
||||||
params = convert(superMethod.get().getParameterList(), method.getParameterList(), this.generics.javaGenerics);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<MethodParameter> finalParams = params;
|
List<MethodParameter> finalParams = params;
|
||||||
|
@ -1101,7 +1101,6 @@ public class TestComplete {
|
|||||||
var res = clazz.getDeclaredMethod("convert", List.class).invoke(instance, list);
|
var res = clazz.getDeclaredMethod("convert", List.class).invoke(instance, list);
|
||||||
assertEquals(res, List.of(6, 7, 8));
|
assertEquals(res, List.of(6, 7, 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBug325() throws Exception {
|
public void testBug325() throws Exception {
|
||||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug325.jav");
|
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug325.jav");
|
||||||
@ -1132,11 +1131,4 @@ public class TestComplete {
|
|||||||
var clazz = classFiles.get("Bug333");
|
var clazz = classFiles.get("Bug333");
|
||||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
var instance = clazz.getDeclaredConstructor().newInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testBug338() throws Exception {
|
|
||||||
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug338.jav");
|
|
||||||
var clazz = classFiles.get("Bug338");
|
|
||||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user