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 155224 - Streams not handled properly, locale specific code
Summary: Streams not handled properly, locale specific code
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-11 13:20 UTC by Petr Hejl
Modified: 2009-02-19 21:00 UTC (History)
0 users

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 Petr Hejl 2008-12-11 13:20:16 UTC
Last change to j2eeserver code (10898e092440) contains 2 important bugs.

- stream won't be closed on exception, writer is not closed at all - you could end up with empty file
- I don't think it is reasonable to convert ByteArrayOutputStream to String and from String to byte array - there is
ByteArrayOutputStream.toByteArray() - consider it for new ByteArrayInputStream and fileOS. This can lead to unintended
results depending on default charset (locale settings)

- it is not much common pattern in NetBeans to compare boolean value with boolean literal, please consider usage of
if(file.exists()) rather than comparing it to true
Comment 1 Trey Spiva 2008-12-18 20:03:31 UTC
Changes have been made

http://hg.netbeans.org/main/rev/bd2b51675c8a