Project: JDT
Bug 176742 [infer type arguments] NPE in TypeEnvironment.cacheSubType for ParameterizedType
Reported: 2007-03-08 13:56:14 | Status: resolved fixed

Build ID: I20070222-0951 Steps To Reproduce: I have not constructed an isolated test case for this problem, hopefully the exception logged will be enough to pinpoint the problem. More information: !ENTRY org.eclipse.jdt.ui 4 2 2007-03-08 11:42:42.710 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui". !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.hashCode(ParameterizedType.java:73) at java.util.HashMap.get(HashMap.java:343) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.cacheSubType(TypeEnvironment.java:259) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.cacheSubTypes(TypeEnvironment.java:271) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:368) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:176) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.AbstractTypeVariable.initialize(AbstractTypeVariable.java:35) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeVariable.initialize(TypeVariable.java:32) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createTypeVariable(TypeEnvironment.java:422) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:178) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:37) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:366) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:176) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:42) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.GenericType.initialize(GenericType.java:29) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createGenericType(TypeEnvironment.java:351) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:174) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:33) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:366) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:176) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:37) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createStandardType(TypeEnvironment.java:338) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:192) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.createTType(InferTypeArgumentsTCModel.java:300) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.getBoxedType(InferTypeArgumentsTCModel.java:310) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeVariableVariable(InferTypeArgumentsTCModel.java:352) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintCreator.endVisit(InferTypeArgumentsConstraintCreator.java:171) at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:148) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2523) at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:170) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546) at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:244) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2523) at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:224) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546) at org.eclipse.jdt.core.dom.VariableDeclarationStatement.accept0(VariableDeclarationStatement.java:272) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546) at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2523) at org.eclipse.jdt.core.dom.IfStatement.accept0(IfStatement.java:189) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546) at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2523) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:501) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:213) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring$2.run(InferTypeArgumentsRefactoring.java:197) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring$1.acceptAST(InferTypeArgumentsRefactoring.java:186) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:712) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:466) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:705) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.checkFinalConditions(InferTypeArgumentsRefactoring.java:182) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:118) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:208) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1798) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/InferTypeArguments/testCuParameterizedTypes1/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/ParameterizedType.java