Bug 10182 - Illegal argument selecting in interface
Summary: Illegal argument selecting in interface
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-25 11:54 EST by John Arthorne CLA
Modified: 2002-02-28 06:00 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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