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 51190 - Keep Fields alive even if their FileldGroup is obsolete
Summary: Keep Fields alive even if their FileldGroup is obsolete
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Martin Matula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-05 10:21 UTC by ehucka
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IOE's stacktrace (2.63 KB, text/plain)
2004-11-05 10:22 UTC, ehucka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ehucka 2004-11-05 10:21:30 UTC
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
Comment 1 ehucka 2004-11-05 10:22:00 UTC
Created attachment 18744 [details]
IOE's stacktrace
Comment 2 Jan Becicka 2004-11-05 12:12:09 UTC
Not sure if this issue is P2. It is really corner case.
Comment 3 ehucka 2004-11-05 12:35:19 UTC
I know. Decrease priority if you know that the problem occures only in
this usecase.
Comment 4 Martin Matula 2004-11-05 13:30:14 UTC
This should be fixed. Validity check is missing in
AutoCommenter.setJavadoc(). Honzo, please fix it.
Comment 5 Martin Matula 2004-11-05 13:33:37 UTC
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.
Comment 6 Jan Pokorsky 2005-02-10 15:10:22 UTC
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?
Comment 7 Jan Pokorsky 2005-02-10 15:53:17 UTC
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.
Comment 8 Martin Matula 2005-02-10 16:43:17 UTC
I found the problem. I will fix it.
Comment 9 Martin Matula 2005-02-10 19:40:02 UTC
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
Comment 10 ehucka 2005-04-18 10:24:21 UTC
verified
Comment 11 Quality Engineering 2007-09-20 12:50:46 UTC
Reorganization of java component