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.
(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
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.
Resolved for 3.4.x or earlier, no new info since then -> closing.