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 233559 - "static imports"-hint generates uncompileable code when invoked via transform&inspect and applied to several imports
Summary: "static imports"-hint generates uncompileable code when invoked via transform...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-28 15:27 UTC by markiewb
Modified: 2013-08-01 15:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Shows the issue in reproducible steps (198.12 KB, image/png)
2013-07-28 15:27 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2013-07-28 15:27:54 UTC
Created attachment 137911 [details]
Shows the issue in reproducible steps

Steps:
* take this code
<code>
package javaapplication5;

import java.util.regex.Pattern;

public class JavaApplication5 {

    public static void main(String[] args) {
        
        Pattern.compile("reg");
        Pattern.matches("a","b");
    }
    
}
</code>
* invoke the hint "Static imports" via "inspect and transform" on this code

ACTUAL: non-compileable code - see screenshot for the step-by-step description
EXPECTED: compileable code

---
Product Version: NetBeans IDE Dev (Build 201307262300)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Jan Lahoda 2013-07-29 08:17:42 UTC
Should be better after:
http://hg.netbeans.org/jet-main/rev/526372c840f4
Comment 2 Quality Engineering 2013-08-01 02:36:46 UTC
Integrated into 'main-silver', will be available in build *201307312300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/526372c840f4
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #233559: when changing imports, need to append to existing changes, not overwrite them.
Comment 3 markiewb 2013-08-01 15:25:10 UTC
Verified in 201307312300. Thanks Jan!