Skip to content

Commit

Permalink
Fix for issue #174: correct bridge method for generic array return type
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Sep 9, 2017
1 parent c364ded commit 4955df2
Show file tree
Hide file tree
Showing 7 changed files with 1,165 additions and 1,144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ public void testExtendingGenerics_GroovyExtendsJava13() {
* at MIData.<init>(MIData.groovy)
* at Main.main(Main.groovy:3)
*/
@Test @Ignore
@Test
public void testExtendingGenerics_GroovyExtendsJava14() {
assumeTrue(isAtLeastGroovy(20));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import org.codehaus.groovy.ast.stmt.ExpressionStatement;
import org.codehaus.groovy.ast.stmt.ReturnStatement;
import org.codehaus.groovy.ast.stmt.Statement;
import org.codehaus.groovy.ast.tools.GenericsUtils;
import org.codehaus.groovy.classgen.asm.BytecodeHelper;
import org.codehaus.groovy.classgen.asm.MopWriter;
import org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.ClassNodeSkip;
Expand Down Expand Up @@ -1340,7 +1341,10 @@ private MethodNode getCovariantImplementation(final MethodNode oldMethod, final
MethodNode newMethod = new MethodNode(
oldMethod.getName(),
overridingMethod.getModifiers() | ACC_SYNTHETIC | ACC_BRIDGE,
oldMethod.getReturnType().getPlainNodeReference(),
// GRECLIPSE edit
//oldMethod.getReturnType().getPlainNodeReference(),
GenericsUtils.nonGeneric(oldMethod.getReturnType()),
// GRECLIPSE end
cleanParameters(oldMethod.getParameters()),
oldMethod.getExceptions(),
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.codehaus.groovy.ast.*;
import org.codehaus.groovy.ast.expr.*;
import org.codehaus.groovy.ast.stmt.*;
import org.codehaus.groovy.ast.tools.GenericsUtils;
import org.codehaus.groovy.classgen.asm.BytecodeHelper;
import org.codehaus.groovy.classgen.asm.MopWriter;
import org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.ClassNodeSkip;
Expand Down Expand Up @@ -1304,7 +1305,10 @@ private MethodNode getCovariantImplementation(final MethodNode oldMethod, final
MethodNode newMethod = new MethodNode(
oldMethod.getName(),
overridingMethod.getModifiers() | ACC_SYNTHETIC | ACC_BRIDGE,
oldMethod.getReturnType().getPlainNodeReference(),
// GRECLIPSE edit
//oldMethod.getReturnType().getPlainNodeReference(),
GenericsUtils.nonGeneric(oldMethod.getReturnType()),
// GRECLIPSE end
cleanParameters(oldMethod.getParameters()),
oldMethod.getExceptions(),
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.codehaus.groovy.ast.*;
import org.codehaus.groovy.ast.expr.*;
import org.codehaus.groovy.ast.stmt.*;
import org.codehaus.groovy.ast.tools.GenericsUtils;
import org.codehaus.groovy.classgen.asm.BytecodeHelper;
import org.codehaus.groovy.classgen.asm.MopWriter;
import org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.ClassNodeSkip;
Expand Down Expand Up @@ -1327,7 +1328,10 @@ private MethodNode getCovariantImplementation(final MethodNode oldMethod, final
MethodNode newMethod = new MethodNode(
oldMethod.getName(),
overridingMethod.getModifiers() | ACC_SYNTHETIC | ACC_BRIDGE,
oldMethod.getReturnType().getPlainNodeReference(),
// GRECLIPSE edit
//oldMethod.getReturnType().getPlainNodeReference(),
GenericsUtils.nonGeneric(oldMethod.getReturnType()),
// GRECLIPSE end
cleanParameters(oldMethod.getParameters()),
oldMethod.getExceptions(),
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
import org.codehaus.groovy.ast.stmt.BlockStatement;
import org.codehaus.groovy.ast.stmt.ExpressionStatement;
import org.codehaus.groovy.ast.stmt.ReturnStatement;
import org.codehaus.groovy.ast.stmt.Statement;
import org.codehaus.groovy.ast.stmt.Statement;
import org.codehaus.groovy.ast.tools.GenericsUtils;
import org.codehaus.groovy.classgen.asm.BytecodeHelper;
import org.codehaus.groovy.classgen.asm.MopWriter;
import org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.ClassNodeSkip;
Expand Down Expand Up @@ -1365,7 +1366,10 @@ private MethodNode getCovariantImplementation(final MethodNode oldMethod, final
MethodNode newMethod = new MethodNode(
oldMethod.getName(),
overridingMethod.getModifiers() | ACC_SYNTHETIC | ACC_BRIDGE,
oldMethod.getReturnType().getPlainNodeReference(),
// GRECLIPSE edit
//oldMethod.getReturnType().getPlainNodeReference(),
GenericsUtils.nonGeneric(oldMethod.getReturnType()),
// GRECLIPSE end
cleanParameters(oldMethod.getParameters()),
oldMethod.getExceptions(),
null
Expand Down
Loading

0 comments on commit 4955df2

Please sign in to comment.