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.
Steps to reproduce: - Reverse engineer the following java class into a UML project: --------------------------------------------------------------------- public class Test { double[][] array = new double[][] { {1, 2}, {3, 4} }; } --------------------------------------------------------------------- - Create a Class diagram for 'Test' class element The 'Test' class element has the following attribute: --------------------------------------------------------------------- package double[0..*,0..*] array = new double[[]], { {1, 2}, {3, 4} } --------------------------------------------------------------------- The initial value is generated incorrectly - Try generating code for the UML project and building it. There are some compiler errors: --------------------------------------------------------------------- JavaApplication2-ModelSources\src\pack\Test.java:9: illegal start of expression double[][] array = new double[[]], {{1, 2}, {3, 4}}; JavaApplication2-ModelSources\src\pack\Test.java:9: ']' expected double[][] array = new double[[]], {{1, 2}, {3, 4}}; 2 errors ---------------------------------------------------------------------
ArrayDeclarationExpression.toString() needed to change the order in which the declaration was being created.
The fix is incomplete. The excessive comma is added after the multidimensional array type declaration. See the attached IDE snapshot.
Created attachment 37524 [details] The excessive comma is added (IDE snapshot)
low use case not currently impacting our installed user base.
The same is for one-dimensional arrays: public class Test { private Object[] obj = new Object[] { "4", null }; }
removed comma from ExpressionStateHandler.toString()
verified in trunk build 070919