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 237313

Summary: Manual array copy remove previous comments
Product: java Reporter: david_kral
Component: HintsAssignee: Svata Dedic <sdedic>
Status: VERIFIED FIXED    
Severity: normal CC: mmirilovic
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 8 x64   
Issue Type: DEFECT Exception Reporter:

Description david_kral 2013-10-18 12:38:52 UTC
Product Version: NetBeans IDE 7.4 (Build 201310101600)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 8 version 6.2 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\David\AppData\Roaming\NetBeans\7.4
Cache directory: C:\Users\David\AppData\Local\NetBeans\Cache\7.4

Steps to reproduce:
1. create method and paste inside this code:
        String[] str = new String[10];
        String[] str1 = new String[12];
        /*koment1
          koment2
          koment3*/
        for (int i = 0; i < str.length; i++) {
            str1[i] = str[i];
        }
2. Allow netbeans to replace your for loop with System.arraycopy()
3. Your previous comment disappears (this problem is also for single line comment)
Comment 1 Svata Dedic 2013-11-25 15:29:45 UTC
Uses RewriteFix. Fixed in http://hg.netbeans.org/jet-main/rev/c6f518969ecb
Comment 2 Jiri Prox 2013-12-03 11:49:50 UTC
verified in trunk
Comment 3 Svata Dedic 2013-12-13 13:26:19 UTC
Grafted into 7.4 as #4d90f068f418
Comment 4 Quality Engineering 2014-03-26 17:04:44 UTC
Integrated into 'releases/release74', will be available in build *201403261440* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/4d90f068f418
User: Svata Dedic <sdedic@netbeans.org>
Log: #237313, #234134: rewrite fix preserves comments for (only!) the replaced nodes