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 175590 - Unable to open plain editor for xml files (switch from design view)
Summary: Unable to open plain editor for xml files (switch from design view)
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: XML Multiview (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: mslama
URL: http://statistics.netbeans.org/analyt...
Keywords: REGRESSION
: 175792 175852 (view as bug list)
Depends on:
Blocks: 175745 175960
  Show dependency tree
 
Reported: 2009-10-28 13:47 UTC by Alexey Butenko
Modified: 2009-11-05 10:15 UTC (History)
10 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (143.62 KB, image/png)
2009-10-28 13:49 UTC, Alexey Butenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Butenko 2009-10-28 13:47:55 UTC
Reproduced on latest development build.
web.xml, sun-web.xml, faces-config.xml can not be opened in plain editor see attached screenshot
Comment 1 Alexey Butenko 2009-10-28 13:49:33 UTC
Created attachment 90174 [details]
screenshot
Comment 2 Sergey Petrov 2009-10-28 15:03:13 UTC
reproducible with persistence.xml
Comment 3 Sergey Petrov 2009-10-28 15:32:15 UTC
seems the same or worst for midlets etc in mobility, may need to be moved to xml-multiview category
Comment 4 Sergey Lunegov 2009-10-28 15:48:40 UTC
Not clear why is it reassign to xml/multiview. Please provide deeper analysis. Test project will be also good. Reassign
back.
Comment 5 Sergey Petrov 2009-10-28 16:14:32 UTC
no project is required, it's easily reproducible with fresh user dir and fresh web/mobility project.
gui (JFrame) editor works fine.
the only problem in case if xml have design view if it can be in some more general category rather then web please
reassing to one, but it's not in web even it was initially filesd as web it have the same sense to assign it to web back
as to any other nb category, just reassign to uml with the same arguments. 
Otherwise provide more details why web affect xml mutliview in case of mobility.
The issue is reproducible on more then 1 system also.
see http://statistics.netbeans.org/analytics/exception.do?id=289163 for opening svg files in latest build.
Comment 6 Sergey Lunegov 2009-10-28 16:23:17 UTC
Alex, please find out when this issue started to show up. 
Comment 7 Sergey Petrov 2009-10-28 21:04:54 UTC
next data may help
http://bertram.netbeans.org/hudson/job/javaee/490/testReport/ have failed xml multiview test, 3 days earlier there was
no failure.
Comment 8 Sergey Petrov 2009-10-30 16:04:41 UTC
*** Issue 175792 has been marked as a duplicate of this issue. ***
Comment 9 Petr Jiricka 2009-11-02 11:20:39 UTC
*** Issue 175852 has been marked as a duplicate of this issue. ***
Comment 10 Petr Jiricka 2009-11-03 11:39:31 UTC
Hi Alex, are you investigating please?
Comment 11 Petr Jiricka 2009-11-03 13:37:48 UTC
There were no code changes in the XML multiview module since Sep 3, so this must be a regression in some other place
than xml/multiview. Assigning to xml/text-edit.
Comment 12 _ alexpetrov 2009-11-03 16:15:45 UTC
Please, look at the e-mails below - XML team is sure that this issue is not related to XML modules at all.
In our opinion it's time to change a value of this bug component from "XML" to another proper value. 
----------------------------------------------------------------------------------------------------------

Hi,

the mentioned Dafe's changeset below is only a merge changeset. So
nothing that Dafe would actually do, he just merged with the other
changes coming from the server to him.

I found the original changesets which introduced the two file changes below:

http://hg.netbeans.org/main-golden/rev/573874e8ea54
(a fix of http://www.netbeans.org/issues/show_bug.cgi?id=174776)

and

http://hg.netbeans.org/main-golden/rev/14af00615ebd
(just logged as "Removal of unnecessary class")

HTH,
~tonda


Sergey Lunegov wrote:
> > Hi Dafe,
> > 
> > there is the P1 issue http://www.netbeans.org/issues/show_bug.cgi?id=175590
> > filed against xml/multiview.
> > 
> > My team spend bit of time trying to understand root cause of the problem
> > but we still far from the resolution.
> > 
> > We found out 2 things:
> > - it's the regression
> > - bug appeared after your commit (changeset
> > http://hg.netbeans.org/main/rev/82edf0f592e2)
> > 
> > Would you please take a look at your commit and reevaluate it ?
> > 
> > Bug is reproducible on configuration including only Base IDE and Java SE
> > (no cnd, groovy, java ee, mobility etc)
> > 
> > In your changeset the  following classes look suspicious to me:
> > java.editor/src/org/netbeans/modules/java/editor/imports/CancellableTask
> >
<http://hg.netbeans.org/main/diff/82edf0f592e2/java.editor/src/org/netbeans/modules/java/editor/imports/CancellableTask.java>.java
> > 
> > java.hints/src/org/netbeans/modules/java/hints/EqualsOnIncompatibleType.jav
> >
<http://hg.netbeans.org/main/diff/82edf0f592e2/java.hints/src/org/netbeans/modules/java/hints/EqualsOnIncompatibleType.java>a
> > 
> > 
> > 
> > Thanks,
> > Sergey
Comment 13 mslama 2009-11-04 12:40:39 UTC
I am looking what happens.
Comment 14 mslama 2009-11-04 13:03:53 UTC
You must call CloneableEditor.componentShowing. Form editor does it as follows:
at org.openide.text.CloneableEditor.componentShowing(CloneableEditor.java:208)
at org.netbeans.modules.form.FormEditorSupport$JavaEditorTopComponent.componentShowing(FormEditorSupport.java:1240)
at org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:295)
at org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:265)
at org.netbeans.core.multiview.MultiViewPeer$SelectionListener.selectionChanged(MultiViewPeer.java:676)
at org.netbeans.core.multiview.MultiViewModel.fireSelectionChanged(MultiViewModel.java:243)
at org.netbeans.core.multiview.MultiViewModel.setActiveDescription(MultiViewModel.java:115)
at org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:293)
at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:237)
at javax.swing.ButtonGroup.setSelected(ButtonGroup.java:147)
at org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:289)
...

This change was done in CloneableEditor to fix semantics of CloneableEditor.close.
Comment 15 Milan Kuchtiak 2009-11-04 14:05:45 UTC
Marek,
From your instruction, I don't know what to do.
XML Multiview doesn't inherit from CloneableEditor, so it doesn't have access to protected componentShowing() method.
Please, look at XML Multiview implementation and give us the exact instructions what should be changed. The best would
be to have patch.
Comment 16 Petr Jiricka 2009-11-04 14:11:26 UTC
I was just about to say the same. Form module has a subclass of CloneableEditor, xml/multiview does not.

Next, I still don't know which specific change caused this regression. Can you please send a pointer?

And also, normally, whoever causes a regression is also responsible for fixing it.
Comment 17 Sergey Petrov 2009-11-04 14:53:11 UTC
also, see blocked issues, there may be more editor types except form and xml-multiview with different implementations.
Comment 18 mslama 2009-11-04 16:23:06 UTC
core-main #8840af87cc50

It was caused by http://hg.netbeans.org/core-main/rev/481670dcdf35

But I have no way how to find out that someone does not call callback methods on CloneableEditor. Form has
CloneableEditor subclass which also implements MultiViewElement.
Comment 19 Petr Jiricka 2009-11-04 16:36:05 UTC
Thanks many times, Marek!
Comment 20 Quality Engineering 2009-11-05 10:15:33 UTC
Integrated into 'main-golden', will be available in build *200911050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8840af87cc50
User: Marek Slama <mslama@netbeans.org>
Log: #175590: Call CloneableEditor callback methods from XmlMultiViewElement.