This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227682 - Inline temp: Cannot inline variable - error 'Variable is assigned to more than once'
Summary: Inline temp: Cannot inline variable - error 'Variable is assigned to more tha...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-19 22:59 UTC by markiewb
Modified: 2013-05-22 02:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Shows the issue (43.25 KB, image/png)
2013-03-19 22:59 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2013-03-19 22:59:39 UTC
Created attachment 132807 [details]
Shows the issue

<code>
    public List<Fix> run(CompilationInfo compilationInfo, String diagnosticKey, int offset, TreePath treePath, Data<Void> data) {
	boolean isClass = (treePath.getLeaf().getKind() == Kind.CLASS);
	if (!isClass) {
	    return null;
	}
        //..
	return Collections.<Fix>emptyList();
    }
</code>

* Try to inline "isClass" 

ACTUAL:
* popup with error "Variable is assigned to more than once", variable cannot be inlined - see screenshot

EXPECTED:
* variable can be inlined


Product Version: NetBeans IDE Dev (Build 201303152300)
Comment 1 markiewb 2013-04-22 22:09:10 UTC
@Ralph: What's the status here? You started the issue one month ago?
Comment 2 Ralph Ruijs 2013-05-21 13:55:49 UTC
(In reply to comment #1)
> @Ralph: What's the status here? You started the issue one month ago?

@markiewb: apologies, it has been a month again. I lost the previous fix when I moved to a new machine. I have a new fix now and will push it today.
Comment 3 Ralph Ruijs 2013-05-21 14:02:07 UTC
changeset   : http://hg.netbeans.org/jet-main/rev/fe703675cf25
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Tue May 21 15:56:31 CEST 2013
summary     : #227682 - Inline temp: Cannot inline variable - error 'Variable is assigned to more than once'
Comment 4 Quality Engineering 2013-05-22 02:34:48 UTC
Integrated into 'main-golden', will be available in build *201305212300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/fe703675cf25
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #227682 - Inline temp: Cannot inline variable - error 'Variable is assigned to more than once'