| Summary: | [1.8][infer type arguments] AssertionFailedException while performing Infer Generic Type Arguments | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Martin Mathew <manju656> |
| Component: | Core | Assignee: | Sasikanth Bharadwaj <sasikanth.bharadwaj> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | noopur_gupta, srikanth_sankaran |
| Version: | 4.4 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
Reproducible using Eclipse Build id: I20140318-0830 and Java 1.8_b132 The binding for "Gen<>" in the given example is different in Java7 and Java8 projects, and hence the difference in behavior. Moving to JDT/Core for comments. Sasi, please follow up. TIA. 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. |
Tested using BETA_JAVA8 WS and Java 8_b132. The exception occurs only if the project compiler compliance is Java 1.8, hence marking it as 1.8 bug. Consider the below code snippet: package p; import java.util.ArrayList; import java.util.List; import java.util.RandomAccess; class Gen<E extends List<String> & RandomAccess> extends ArrayList<E> { void foo() { Gen<?> g = new Gen<>(); g.get(0); // Refactor > Infer Generic Type Arguments... } } Invoke "Refactor > Infer Generic Type Arguments.." and click OK/Preview, the below exception is thrown. org.eclipse.core.runtime.AssertionFailedException: null argument: at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85) at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:32) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createStandardType(TypeEnvironment.java:377) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:219) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:38) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:405) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:199) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:42) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:32) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:405) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:199) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:42) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:32) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:405) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:199) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:37) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:32) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:405) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:199) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:37) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:32) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:405) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:199) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.HierarchyType.initialize(HierarchyType.java:37) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ParameterizedType.initialize(ParameterizedType.java:32) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.createParameterizedType(TypeEnvironment.java:405) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment.create(TypeEnvironment.java:199) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.createTType(InferTypeArgumentsTCModel.java:304) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.getBoxedType(InferTypeArgumentsTCModel.java:314) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeImmutableTypeVariable(InferTypeArgumentsTCModel.java:494) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintCreator.endVisit(InferTypeArgumentsConstraintCreator.java:124) at org.eclipse.jdt.internal.corext.dom.HierarchicalASTVisitor.endVisit(HierarchicalASTVisitor.java:1088) at org.eclipse.jdt.core.dom.ParameterizedType.accept0(ParameterizedType.java:178) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2763) at org.eclipse.jdt.core.dom.ClassInstanceCreation.accept0(ClassInstanceCreation.java:315) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2763) at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:263) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2786) at org.eclipse.jdt.core.dom.VariableDeclarationStatement.accept0(VariableDeclarationStatement.java:267) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2786) at org.eclipse.jdt.core.dom.Block.accept0(Block.java:137) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2763) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:639) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2786) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:470) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2786) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:212) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2715) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring$1$1.run(InferTypeArgumentsRefactoring.java:208) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring$1.acceptAST(InferTypeArgumentsRefactoring.java:197) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:900) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:589) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:900) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.checkFinalConditions(InferTypeArgumentsRefactoring.java:192) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2333) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)