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 10759 - java code generation produces incorrect java files
Summary: java code generation produces incorrect java files
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-03-28 11:13 UTC by Tomas Hurka
Modified: 2007-09-26 09:14 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 Tomas Hurka 2001-03-28 11:13:28 UTC
(Michael Watzek)
Code generation of java classes sometimes produces java files which do
not compile due to syntax errors. The syntax errors are caused by a
misplaced closing curly bracket for the outer class definition. The
closing curly bracket is generated in the middle of the file (more or
less). After this curly bracket methods and inner classes are still
generated.

This bug does not show up deterministically in the sence that most of
the classes are generated correctly, but some are not. You can reproduce
this bug running the java generator on a particular dbschema file, which
you find in the attachment of this bug report. This dbschema file
contains a table definition 'MEMBER'. The generated file for class
'Member' contains this bug.

This bug was moved from bugtraq. Bugtraq ID 4427732
Comment 1 Svata Dedic 2001-03-28 13:34:47 UTC
This bug appeared because code that was using OpenAPIs was passing text
information with "\r\n" as line delimiters. Unexpectedly, NetBeans' standard
Document does silently line delimiter conversion internally. This way
assumptions made by the code generator about what and how is placed into the
document were violated.
I fixed the bug on my side to filter everything that goes to the document
through System.getProperty("line.separator") -> "\n" conversion routine.
The best approach is, however, do such conversion during I/O and not during
internal processing.
Comment 2 Quality Engineering 2003-07-01 13:21:01 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.