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.
Product Version = NetBeans IDE Dev (Build 051013) Operating System = Windows XP version 5.1 running on x86 Java; VM; Vendor = 1.5.0_05; Java HotSpot(TM) Client VM 1.5.0_05-b05; Sun Microsystems Inc. Java Home = d:\Java\jdk1.5.0_05\jre Steps: 1. Check out sources, open project. 2. Create new JFrame in it. Open it into editor area. 3. Invoke "CVS | Commit" on it. 4. In design view add some components. Save and commit it again. 5. Select JFrame and invoke "CVS | Show Annotations ..." 6. In "Annotation" column invoke "Rollback to 1.1" popup menu action Source code of JFrame is now guarded. It can be changed.
I am unable to reproduce it.
We do not set or maintain guarded blocks, we just change local files on disk and then fire events that these files have changed. I do not see how we can do something that would break guarded blocks. Please evaluate.
Reassigning to java. I do not see how form can cause this behaviour, but I am sure that you will find some reason ;-).
Is this one reproducible?
The bug is probably in editor. I'm attaching debug thread dumps showing, that although GuardedDocument.setCharacterAttributes() is called with correct values ("Mark Guarded(start, length)"), value of GuardedDocument.guardedBlockChain.chain.startMark.multiMark.rawOffset is really strange. It is "1073741823".
Created attachment 26311 [details] Debug messages. "System.outs" and Thread.dumpStack()'s added to GuardedDocument.setCharacterAttributes()
Please don't look at rawOffset values, they are really "raw" but even 1073741823 can be OK because (Integer.MAX_INT / 2) gets subtracted from the rawOffset because it's a gap storage. The only relevant value is mark.getOffset() or position.getOffset().
OK. In this case docLen=30673 GuardedDocument.guardedBlockChain.chain.startMark.multiMark.getOffset() is 30673 GuardedDocument.guardedBlockChain.chain.next.startMark.multiMark.getOffset() is 30673 GuardedDocument.guardedBlockChain.chain.next.next.startMark.multiMark.getOffset() is 30673 This is also strange, isn't it?
Yes, it looks like the positions were there before the document's loading and they were moved by the subsequent insertion of the reloaded content but it might be some deficiency in the MarkBlockChain implementation as well. Honzo, did you check that first the content gets loaded into the document and then the new guarded sections get assigned through the GuardedDocument.setCharacterAttributes()? If so then it's likely the second possibility.
I was able to reproduce this issue, but I'm not any more. Probably reloading of form files was improved somehow.
Verified. Source code can be changed. NetBeans IDE Dev (Build 200511211900)
*** Issue 70318 has been marked as a duplicate of this issue. ***
Still reproducible with scenario in Issue 70318. It can be related to issue 70331. JavaEditor does: kit.read(reader, doc, 0); fillSections(reader, doc), where GuardedDocument.setCharacterAttributes() is called with correct attributes.
*** Issue 65500 has been marked as a duplicate of this issue. ***
I have tried to reproduce this issue with steps I have provided. Now it occured randomly.
The MarkBlockChain did not handle well the situation when there were empty blocks (after removal of the document content during reload). Fixed in trunk: Checking in libsrc/org/netbeans/editor/MarkBlockChain.java; /cvs/editor/libsrc/org/netbeans/editor/MarkBlockChain.java,v <-- MarkBlockChain.java new revision: 1.21; previous revision: 1.20
Graphical diff: http://www.netbeans.org/source/browse/editor/libsrc/org/netbeans/editor/MarkBlockChain.java.diff?r1=1.20&r2=1.21 I would like to ask QE to test the fix. Thanks. Dusane, could you please review the fix? Thanks.
Verified - I'm not able to reproduce the issue in trunk build 200601031900. Peter please verify your use case too. Thanks.
My case with the use of cvs - verified.
The fix looks OK.
When do you plan to fix this in the 5.0 branch? Just curious.
Integrated into release50: Checking in MarkBlockChain.java; /cvs/editor/libsrc/org/netbeans/editor/MarkBlockChain.java,v <-- MarkBlockChain.java new revision: 1.20.96.1; previous revision: 1.20
Verified in NetBeans IDE 5.0 Dev (Build 200601052030).
*** Issue 71198 has been marked as a duplicate of this issue. ***