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: 1. open a class 2. define fields of one type on a line: String a, b; 3. run Auto Comment 4. selecte field 'a' and write new comment 5. select field 'b' and write new comment to JavaDoc Comment Text textarea 6. immediately switch to the source file an IOE will be thrown
Created attachment 18744 [details] IOE's stacktrace
Not sure if this issue is P2. It is really corner case.
I know. Decrease priority if you know that the problem occures only in this usecase.
This should be fixed. Validity check is missing in AutoCommenter.setJavadoc(). Honzo, please fix it.
But I propose we fix it for 4.1, since this is an edge case - it really happens only for field groups and the fix will probably be more complicated and risky. Nothing gets screwed up - if you close the auto comment window and reopen it again, it should work fine - so an easy workaround exists.
Martine, I do not think adding the validity check would solve something here. The exception will not be thrown but user will lose his customized javadoc anyway. Modifications are being stored when the AC loses the focus. Any idea why the element is invalid? Would it help to gather elements for AC under the write transaction instead of the read one?
As Martin told me offline the problem is in the field group. I found that if I change the javadoc of each field in their field group then the second and next fields are invalidated which is wrong. The matcher should keep the identity of fields even after their group is broken via eg Field.setJavadocText. Reassigning to javacore.
I found the problem. I will fix it.
Fixed. Checking in src/org/netbeans/modules/javacore/jmiimpl/javamodel/FieldGroupImpl.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/FieldGroupImpl.java,v <-- FieldGroupImpl.java new revision: 1.15; previous revision: 1.14 done Checking in src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java,v <-- JavaClassImpl.java new revision: 1.47; previous revision: 1.46 done
verified
Reorganization of java component