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 122038

Summary: "Last Edit" button dangerously duplicates buffer of html files
Product: web Reporter: _ rkusterer <rkusterer>
Component: HTML EditorAssignee: issues@web <issues>
Status: RESOLVED FIXED    
Severity: blocker CC: dkonecny, pjiricka
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: "last change" button causes, duplicated buffers, broken icons.

Description _ rkusterer 2007-11-15 17:06:04 UTC
I have several files open (most of the HTML files under CVS). I edit one of the open files, and move the caret around in
it. I have not yet saved my changes. When I now click the "Last Edit" button, I get a NEW buffer of the file, and the
caret jumps to the edited line in the new buffer. (two buffers with same title are visible in screenshot)

But the file is already open, it should not be duplicated! Having two buffers with the same file is dangerous, because
they do not appear to be in sync. If I make changes in both, and then close one of them, will they overwrite each other?

Then when I use this button several times in a row, and jump from file to file, some files end up with the "Go
back/Forward" editor buttons broken. The buttons show as text in one buffer, while they are icons in other buffers.
(also visible in screenshot)

Sometimes I end up in a state where a file is marked as modified (asterisk in title), but I cannot save any changes
(Save menu item is disabled), because I already saved (and closed) the duplicate buffer, and the second buffer is in an
inconsistent state now.

I noticed that with Java files this bug never happened, but with HTML it happens so often that I no longer use the
button anymore. The bug is still there in RC1.
Comment 1 _ rkusterer 2007-11-15 17:10:51 UTC
Created attachment 53066 [details]
"last change" button causes, duplicated buffers, broken icons.
Comment 2 Vitezslav Stejskal 2007-11-15 17:36:08 UTC
I'm not sure who implements support for wsdl files, but whoever they are they should fixed their DataObject's lookup.
I'm pretty sure their Lookup is missing an EditorCookie. This would explain both the broken visual appearance of the
buttons and broken navigation. The navigation actions are the same for all file types (and work for most of the file
types) and rely on EditorCookie.
Comment 3 Lukas Jungmann 2007-11-15 18:11:04 UTC
=>xml/wsdl
Comment 4 Shivanand Kini 2007-11-15 18:31:12 UTC
For wsdl files, it works fine.

The bug description cleary mentions that this occurs for html files. Assigning to the html component.
Comment 5 David Konecny 2007-11-19 11:49:18 UTC
Checking in src/org/netbeans/modules/html/HtmlDataObject.java
new revision: 1.34; previous revision: 1.33
Comment 6 _ rkusterer 2007-11-21 19:19:21 UTC
I just tried the RC2
- OK the icons are no longer broken
- It still opens a second buffer for an already open file. (reproducibly)
Comment 7 David Konecny 2007-11-22 08:05:13 UTC
Target Milestone = Dev that means it was fixed only in trunk and not in NB6. I afraid it is too late to get this fix
into NB6. Although it has higher priority then P3.
Comment 8 pgebauer 2007-12-03 14:46:28 UTC
The fix has been ported into the release60_fixes branch.

Checking in HtmlDataObject.java;
/cvs/html/src/org/netbeans/modules/html/HtmlDataObject.java,v  <--  HtmlDataObject.java
new revision: 1.33.4.1; previous revision: 1.33
done