Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext 2.2] NPE in JvmMemberRenameStrategy in a JDT project
[Xtext 2.2] NPE in JvmMemberRenameStrategy in a JDT project [message #762355] Wed, 07 December 2011 23:40 Go to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Greetings,

I upgraded to Xtext 2.2 (v2.2.0.v201112071226) this morning in Eclipse 3.7.1. I'm doing a simple rename refactoring in a JDT project (a project that does not have any Xtext-related files) and refactoring fails with the following stack trace:

ava.lang.NullPointerException
	at org.eclipse.xtext.common.types.ui.refactoring.participant.JvmMemberRenameStrategy.setName(JvmMemberRenameStrategy.java:56)
	at org.eclipse.xtext.common.types.ui.refactoring.participant.JvmMemberRenameStrategy.revertDeclarationChange(JvmMemberRenameStrategy.java:51)
	at org.eclipse.xtext.ui.refactoring.impl.RenamedElementTracker.renameAndTrack(RenamedElementTracker.java:39)
	at org.eclipse.xtext.ui.refactoring.impl.RenameElementProcessor.checkFinalConditions(RenameElementProcessor.java:208)
	at org.eclipse.xtext.ui.refactoring.impl.AbstractProcessorBasedRenameParticipant.checkConditions(AbstractProcessorBasedRenameParticipant.java:113)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:257)
	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:2344)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)



Is anybody seeing the same?

Thanks,
-Alex

[Updated on: Wed, 07 December 2011 23:41]

Report message to a moderator

Re: [Xtext 2.2] NPE in JvmMemberRenameStrategy in a JDT project [message #762358 is a reply to message #762355] Wed, 07 December 2011 23:48 Go to previous messageGo to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
The same operation (Java enum renaming) throws the following error in Xtext 2.1.1 (but at least the rename succeeds)

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1949)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:85)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.impl.AbstractClassMirror.getEObject(AbstractClassMirror.java:86)
	at org.eclipse.xtext.common.types.access.TypeResource.getEObject(TypeResource.java:54)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:219)
	at org.eclipse.xtext.common.types.ui.refactoring.participant.JvmMemberRenameStrategy.setName(JvmMemberRenameStrategy.java:55)
	at org.eclipse.xtext.common.types.ui.refactoring.participant.JvmMemberRenameStrategy.revertDeclarationChange(JvmMemberRenameStrategy.java:51)
	at org.eclipse.xtext.ui.refactoring.impl.RenamedElementTracker.renameAndTrack(RenamedElementTracker.java:39)
	at org.eclipse.xtext.ui.refactoring.impl.RenameElementProcessor.checkFinalConditions(RenameElementProcessor.java:208)
	at org.eclipse.xtext.ui.refactoring.impl.AbstractProcessorBasedRenameParticipant.checkConditions(AbstractProcessorBasedRenameParticipant.java:113)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:257)
	at org.eclipse.ltk.core.refactoring.Refactoring.checkAllConditions(Refactoring.java:160)
	at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:80)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4873)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Re: [Xtext 2.2] NPE in JvmMemberRenameStrategy in a JDT project [message #762361 is a reply to message #762358] Wed, 07 December 2011 23:57 Go to previous messageGo to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
It seems that the problem only happens when renaming a Java enum. I just renamed an interface and a class without problems. Sorry for being lazy and not finding out myself but...is this a known bug?

Thanks,
-Alex
Re: [Xtext 2.2] NPE in JvmMemberRenameStrategy in a JDT project [message #762537 is a reply to message #762361] Thu, 08 December 2011 09:00 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Alex,

please file a ticket. This looks rather critical to me.

Thanks,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 08.12.11 00:57, schrieb Alex Ruiz:
> It seems that the problem only happens when renaming a Java enum. I just
> renamed an interface and a class without problems. Sorry for being lazy
> and not finding out myself but...is this a known bug?
>
> Thanks,
> -Alex
Re: [Xtext 2.2] NPE in JvmMemberRenameStrategy in a JDT project [message #762597 is a reply to message #762537] Thu, 08 December 2011 11:08 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I've filed a bug for this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366005


---
Get professional support from the Xtext committers at www.typefox.io
Re: [Xtext 2.2] NPE in JvmMemberRenameStrategy in a JDT project [message #763440 is a reply to message #762597] Fri, 09 December 2011 19:16 Go to previous message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Thanks Sebastian and Jan Smile
Previous Topic:[xtend2.2] Semantics of "it" with "switch"
Next Topic:content assist across files
Goto Forum:
  


Current Time: Thu Mar 28 09:46:25 GMT 2024

Powered by FUDForum. Page generated in 0.05305 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top