Project: JDT
Bug 86699 infer type args: Problems with supertype calculation of raw types and type variables
Reported: 2005-02-25 15:56:04 | Status: verified fixed

3.1M5a public class TypeParams9<T1 extends Number & Comparable> { Comparable f(T1 t1){ Vector v1= new Vector(); v1.add(t1); v1.add(new Integer(1)); v1.add(""); return (Comparable)v1.get(0); } } try 'infer type args' you get .... Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.createTypeVariablesEqualityConstraints(InferTypeArgumentsTCModel.java:466) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.createTypeVariablesEqualityConstraints(InferTypeArgumentsTCModel.java:441) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeElementVariables(InferTypeArgumentsTCModel.java:436) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeElementVariables(InferTypeArgumentsTCModel.java:403) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeVariableVariable(InferTypeArgumentsTCModel.java:278) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintCreator.endVisit(InferTypeArgumentsConstraintCreator.java:102) at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:148) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497) at org.eclipse.jdt.core.dom.SingleVariableDeclaration.accept0(SingleVariableDeclaration.java:372) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:501) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:486) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:291) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring$1.acceptAST(InferTypeArgumentsRefactoring.java:137) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:641) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:436) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:651) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.checkFinalConditions(InferTypeArgumentsRefactoring.java:132) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:114) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1702) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:111)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCUTypeParams9/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCUTypeParams9/out/A.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InferTypeArgumentsTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/AbstractTypeVariable.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints2/TTypes.java org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/InferTypeArgumentsWizard.java