Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 176304

Summary: [infer type arguments] NPEs in "Infer Generic Type Arguments"
Product: [Eclipse Project] JDT Reporter: Hans Meier <eclipseBugs>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug

Description Hans Meier CLA 2007-03-04 03:55:22 EST
Build ID: I20070222-0951 (and others)

Steps To Reproduce:
1. Call "Refactor"->"Infer Generic Type Arguments..." on any folder or file in our project
2. Click "Ok" (state of the two checkboxes does not matter)
3. Watch NPEs appear in the error log

More information:
Stacktrace from error log:

eclipse.buildId=I20070222-0951
java.version=1.5.0_11
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments:  -launcher C:\dev\eclipse\eclipse.exe -name Eclipse -startup C:\dev\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070208a.jar
Command-line arguments:  -os win32 -ws win32 -arch x86 -launcher C:\dev\eclipse\eclipse.exe -name Eclipse -startup C:\dev\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070208a.jar

Error
Sun Mar 04 09:37:36 CET 2007
Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui".

java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeSupertypeElementVariables(InferTypeArgumentsTCModel.java:629)
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeElementVariablesFromSupertypes(InferTypeArgumentsTCModel.java:623)
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeElementVariables(InferTypeArgumentsTCModel.java:612)
	at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeVariableVariable(InferTypeArgumentsTCModel.java:360)
	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.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:223)
	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.TryStatement.accept0(TryStatement.java:194)
	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)


Error started during migration to generics of a few hundred classes in a webapp, it is now reproducible on all our Eclipse installations (3.2/3.3 on Win/Lin) with this project.
Comment 1 Eclipse Genie CLA 2019-04-20 13:03:43 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.