Bug 10182

Summary: Illegal argument selecting in interface
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: UIAssignee: Adam Kiezun <akiezun>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description John Arthorne CLA 2002-02-25 11:54:18 EST
Build 20020214

1) Create the following CU:

package packagea;
/**
 */
public interface ITest {
	public void foo(int arg);
}

2) Open in java editor, and select "int arg".
3) Hit Alt + Left arrow

Internal error, null argument.  Stack trace is:

org.eclipse.jdt.internal.corext.refactoring.Assert$AssertionFailedException: 
null argument;
	at 
org.eclipse.jdt.internal.corext.refactoring.Assert.isNotNull(Assert.java:101)
	at 
org.eclipse.jdt.internal.corext.refactoring.Assert.isNotNull(Assert.java:77)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSele
ctPreviousAction.getNextNode(StructureSelectPreviousAction.java:42)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSele
ctPreviousAction.internalGetNewSelectionRange(StructureSelectPreviousAction.java
:28)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSele
ctionAction.getNewSelectionRange(StructureSelectionAction.java:54)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSele
ctionAction.run(StructureSelectionAction.java:41)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionCont
ributionItem.java:407)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContribu
tionItem.java:361)
	at 
org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.
java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(Actio
nContributionItem.java:47)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled 
Code))
Comment 1 Adam Kiezun CLA 2002-02-28 06:00:36 EST
problem was in 
StructureSelectionAction::containsStatements(AstNode)

which did not check if method really has statements.

i added a test case and fixed the bug
build >= 20020228