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.
Tested with netbeans-4_2-daily-bin-200508161800-16_Aug_2005_1800 Sometimes (often) new refactorin module in Netbeans 4.2dev totaly destroy code. I tkink, that the proble arise only when code contains non US-ASCII chars (I use UTF8 encoding of source file) For exampple when move this code: /* * Licence */ package cz.test.demo.auto.next; /** * XYZ * @author ěščřžýáíé */ public class FTP { /** Creates a new instance */ public FTP() { } /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } } move to package 'test', result is: /* * Licence */ package test; /** * XYZ * @author ěščřžýáíé */ public class FTP { FTP** Creates a new instance */ public FTP() { FTP} /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } } and after undo: /* * Licence */ packcz.test.demo.auto.nexttest; /** * XYZ * @author ěščřžýáíé */ public class /P { FTP** Creates a new instance */ publ FTP() { FTP} /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } }
If this is reproducible it would be serious issue. But I'm not able to reproduce the issue with provided class. Please could you provide steps to reproduce starting with clean userdir? Also describe how do you create and edit the class (just in editor or you use also some visual editing)? Did you create some form files? Raising prio and marking as INCOMPLETE until there are steps to reproduce.
It’s happen only when I switch to UTF-8 in Options: Editing -> Java Sources -> Default Encoding and use UTF8 file with non US-ASCII characters. When I run NB with parameter -J-Dfile.encoding=UTF-8 is refactoring OK, but files created with my modified templates (they are in UTF-8), which use __USER__ set to ‘Tomáš Prochazka’ is created as ‘Tomáš Procházka’ Why NB use two another and incompatibility way to change default encodings?
Easily reproducible with info provided from reporter. Raising prio to P2. Summary of steps to reproduce: 1) Change default encoding to UTF-8 in Tools | Options (Editing -> Java Sources -> Default Encoding) 2) Modify property String table of Java Sources node to look like this: USER=ěščřžýáíé 3) Create java class from template 4) Rename the class using Refactor | Rename Source code is completly broken.
Perfect, that you (mkubec) managed this issue. But, I still don't know, why NB has two ways to change default encoding :-(
Checking in src/org/netbeans/modules/java/settings/JavaSettings.java; /cvs/java/src/org/netbeans/modules/java/settings/JavaSettings.java,v <-- JavaSettings.java new revision: 1.71; previous revision: 1.70 done Checking in javacore/src/org/netbeans/modules/javacore/parser/Util.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/parser/Util.java,v <-- Util.java new revision: 1.7; previous revision: 1.6 done Checking in javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ResourceImpl.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ResourceImpl.java,v <-- ResourceImpl.java new revision: 1.94; previous revision: 1.93 done Checking in javacore/src/org/netbeans/modules/javacore/JMManager.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v <-- JMManager.java new revision: 1.121; previous revision: 1.120 done > But, I still don't know, why NB has two ways to change default encoding :-( System.property "file.encoding" is general JDK settings for all files while Java Sources | Default Encoding is NetBeans setting for java files.
*** Issue 68166 has been marked as a duplicate of this issue. ***
*** Issue 61446 has been marked as a duplicate of this issue. ***
Verified. --- NetBeans IDE Dev (Build 070214) 1.6.0; Java HotSpot(TM) Server VM 1.6.0-b105 Linux version 2.6.12-1.1390_FC4smp running on i386 en_US (nb); UTF-8
Reorganization of java component