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 239082 - [Replace by string] Replace by string hint produces invalid code
Summary: [Replace by string] Replace by string hint produces invalid code
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 252830 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-03 14:19 UTC by Jiri Prox
Modified: 2015-06-05 10:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2013-12-03 14:19:50 UTC
Replace by string hint produces invalid code

Steps to reproduce:

1) apply hint on following code:
        int x = 3;        
        StringBuffer s = new StringBuffer(x);
        String y = s.toString();

-> int x = 3;        
   String s = new StringBuffer(x); // <- error
   String y = s;

BTW the hint is in category "perf", it should probably be "Performance"

Product Version: NetBeans IDE Dev (Build 20131202-95d36d354e99)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b49
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b107
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 1 Svata Dedic 2013-12-03 17:21:20 UTC
Fixed in http://hg.netbeans.org/jet-main/rev/052962cab80c
Comment 2 Jiri Prox 2015-06-05 10:34:22 UTC
*** Bug 252830 has been marked as a duplicate of this bug. ***