Bug 42647 - when assertion has no text, it is not possible to rename method
Summary: when assertion has no text, it is not possible to rename method
Status: RESOLVED DUPLICATE of bug 38732
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-05 17:20 EDT by Calin Medianu CLA
Modified: 2003-09-08 10:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Calin Medianu CLA 2003-09-05 17:20:44 EDT
Given this code:

/*
 * Created on Sep 5, 2003
 *
 */
package domainpeople.sample;

import java.sql.SQLException;

/**
 * @author calinm
 */
public class EclipseTest {
	public static EclipseTest getByLogin(String loginName, String password)
			throws SQLException {
			EclipseTest ret = null;
			assert(password != null) : "null password";
			assert(loginName != null) ;
			return ret;
	}		

}

if I highlight getByLogin, then rightclick > refactor > rename, the dialog does 
not pop up. The second assert is causing this, as it has no text after it.

This is the stacktrace:

!ENTRY org.eclipse.ui 4 4 Sep 05, 2003 14:12:28.248
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Sep 05, 2003 14:12:28.248
!MESSAGE java.lang.IllegalArgumentException
!STACK 0
java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:1469)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1801)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1708)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:719)
	at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations
(ASTConverter.java:242)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:181)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:79)
	at org.eclipse.jdt.core.dom.AST.parseCompilationUnit(AST.java:265)
	at 
org.eclipse.jdt.internal.corext.refactoring.rename.RenameTempRefactoring.initAST
(RenameTempRefactoring.java:211)
	at 
org.eclipse.jdt.internal.corext.refactoring.rename.RenameTempRefactoring.checkAc
tivation(RenameTempRefactoring.java:199)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.RenameTempAction.canRun
(RenameTempAction.java:69)
	at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:124)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:193)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:169)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:456)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:403)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:397)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:72)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1838)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1545)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:858)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
	at org.eclipse.core.launcher.Main.run(Main.java:747)
	at org.eclipse.core.launcher.Main.main(Main.java:583)
Comment 1 Olivier Thomann CLA 2003-09-05 17:29:55 EDT
I will investigate.
Comment 2 Olivier Thomann CLA 2003-09-08 10:11:54 EDT
It is a duplicate of bug 38732.
I have the fix ready to be backported to 2.1. maintenance stream.

*** This bug has been marked as a duplicate of 38732 ***