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 46234

Summary: By adding the new project the NumberFormatException occured
Product: projects Reporter: rudyment <rudyment>
Component: AntAssignee: Jesse Glick <jglick>
Status: CLOSED WORKSFORME    
Severity: blocker CC: jlahoda, lahodaj
Priority: P3    
Version: 4.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535    
Attachments: Zipped messages.log file

Description rudyment 2004-07-16 12:27:32 UTC
I wonted to add new, not main project. I selected 
the "Java Project with Existing Sources". After 
selecting folders I prssed "Finish" and 
NumberFormatException occured.
Comment 1 rudyment 2004-07-16 12:29:58 UTC
Created attachment 16292 [details]
Zipped messages.log file
Comment 2 Jan Lahoda 2004-07-16 14:45:15 UTC
It seems to me that the EditableProperties try to decode some string
with some strange unicode sequence. Passing to ant module for evaluation.
Comment 3 Jan Lahoda 2004-07-16 14:46:01 UTC
*** Issue 46233 has been marked as a duplicate of this issue. ***
Comment 4 Jesse Glick 2004-07-16 20:44:37 UTC
Yes, but I have no idea how to reproduce that. I will improve the
class to at least throw an IOException so the error is better.
Comment 5 Jesse Glick 2004-07-16 21:01:25 UTC
I did find a bug that if the .properties file contained malformed
Unicode escapes, a NFE would be thrown rather than handling the
problem more gracefully.

Reporter: beware that the properties file format requires \ to be
escaped if it is to be treated literally e.g. as a file separator.
Comment 6 Jesse Glick 2004-07-16 23:39:11 UTC
That fix:

committed   * Up-To-Date  1.8        
ant/project/src/org/netbeans/spi/project/support/ant/EditableProperties.java
committed   * Up-To-Date  1.6        
ant/project/test/unit/src/org/netbeans/spi/project/support/ant/EditablePropertiesTest.java
committed   * Up-To-Date  1.3        
ant/project/test/unit/src/org/netbeans/spi/project/support/ant/data/test.properties

EditableProperties now silently ignores malformed Unicode escapes (as
it already ignored truncated Unicode escapes).

Note that since java.util.Properties throws an
IllegalArgumentException in such a case, property files with such a
syntax error would be quite useless anyway.
Comment 7 Marian Mirilovic 2005-07-12 10:11:45 UTC
closed