Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361047

Summary: Refactoring: NPE while renaming local variable
Product: [Eclipse Project] JDT Reporter: Dmitry Vyazelenko <vyazelenko>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: amj87.iitr, daniel_megert, manoj.palat, markus.kell.r, Olivier_Thomann, remy.suen, srikanth_sankaran, stephan.herrmann
Version: 3.7.1   
Target Milestone: 4.14 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Full stacktrace of the error none

Description Dmitry Vyazelenko CLA 2011-10-15 07:26:46 EDT
Build Identifier: M20110909-1335

Attempt to use rename variable refactoring fails with NullPointerExxception.

Reproducible: Sometimes

Steps to Reproduce:
1. Select local variable
2. Refactor->Rename
3. Type in new name
4. Press OK - action is rollbacked and you see exception in the error log
Comment 1 Dmitry Vyazelenko CLA 2011-10-15 07:27:20 EDT
Created attachment 205248 [details]
Full stacktrace of the error

Stacktrace added.
Comment 2 Remy Suen CLA 2011-10-17 07:59:07 EDT
Java tooling bugs go to JDT, not Platform IDE.
Comment 3 Dani Megert CLA 2011-10-17 08:54:07 EDT

*** This bug has been marked as a duplicate of bug 348024 ***
Comment 4 Dmitry Vyazelenko CLA 2011-10-17 17:14:43 EDT
OK, I see that the bug was marked as duplicate of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=348024">bug 348024</a>. However I do not agree that it can be closed because I have 3.7.1 Eclipse version in which bug is reproducible. And as far I understood the fix was suppose to be delivered as part of 3.7.1 RC2?!
Comment 5 Stephan Herrmann CLA 2011-10-17 17:36:38 EDT
(In reply to comment #4)
> OK, I see that the bug was marked as duplicate of <a
> href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=348024">bug 348024</a>.
> However I do not agree that it can be closed because I have 3.7.1 Eclipse
> version in which bug is reproducible. And as far I understood the fix was
> suppose to be delivered as part of 3.7.1 RC2?!

Yes, the fix for bug 348024 is in 3.7.1.

To understand similarity/difference to that bug, can you please tell us
whether there's also a file package-info.java involved in your case?

Can you share an example program where the exception can be reproduced?
Comment 6 Dmitry Vyazelenko CLA 2011-10-18 03:25:58 EDT
Yes, the package containing class in which local variable rename fails also contains package-info.java file.

Unfortunately I was not able to reproduce issue with sample project. The error occurs only on closed source project.
Comment 7 Ayushman Jain CLA 2011-10-18 05:13:12 EDT
I tried to reproduce with a simple case with a package-info.java file, but works ok. 
Dmitry, can you extract the method into another one, omitting much of your code except the local variable on which ur'e using the refactoring? If you can still reproduce, then submitting that testcase here will help us and make sure you don't cause any IP issues. Thanks!
Comment 8 Markus Keller CLA 2011-11-08 10:31:43 EST
Ping. We cannot do much here without a reproducible example.
Comment 9 Srikanth Sankaran CLA 2011-12-09 20:12:08 EST
Dmitry, have you had chance to try out Ayush's suggestion from comment#7 ?
Comment 10 Eclipse Genie CLA 2019-10-04 16:28:10 EDT
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.
Comment 11 Stephan Herrmann CLA 2019-10-04 16:44:39 EDT
We don't have sufficient information for investigation.
Comment 12 Manoj N Palat CLA 2019-10-09 06:17:54 EDT
Verified for Eclipse Version: 2019-12 (4.14) M1 with  Build id: I20191008-1800