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 84047

Summary: IDE eats CPU after applying Salami Slice to OTA schema
Product: xml Reporter: Andrei Chistiakov <ca-nb>
Component: Text-EditAssignee: Marek Fukala <mfukala>
Status: VERIFIED FIXED    
Severity: blocker CC: cwebster, htt, ivansidorkin, kozlov, pjiricka
Priority: P3 Keywords: PERFORMANCE
Version: 5.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 81655    
Attachments: ota schema

Description Andrei Chistiakov 2006-09-01 17:11:31 UTC
Reproduced in build 060831_2 (JDK 1.6 Beta 2)

To reproduce the bug:

- open a single file OTA schema;
- apply Salami Slice pattern to the schema;
- after the pattern is applied, close the schema and discard the changes.

CPU consumpltion remains at ~50% until IDE is closed.
Comment 1 Ayub Khan 2006-09-05 08:45:05 UTC
This seems to be a NB5.5 XML editor issue.

Steps to reproduce.
==================

1. Install NB5.5 (plain, ie., no ent55 pack)
2. Open IDE, create a new java project P1
3. Create a new schema file 'f.xsd'.
4. Open attached schema 'ota.xsd' in the IDE (you can open from favourites or
save this file into the project P1 'Source packages')
5. Copy(CTL+A followed by CTL+C) contents of ota into clipboard.
6. Now select contents of f.xsd by doing CTL+A. Then paste contents of clipboard
into selected contents of f.xsd by doing CTL+V.
(Note: You can also use mouse to copy/paste contents of ota.xsd onto f.xsd)
7. Now IDE will eat up CPU.
Comment 2 Ayub Khan 2006-09-05 08:48:07 UTC
Created attachment 33586 [details]
ota schema
Comment 3 Marek Fukala 2006-09-05 12:23:21 UTC
The problem is reproducible, I am working on evaluation and a fix. Downgrading
to P2 since the problem happens only for extraordinarily big files and just
unders some circumstrances.
Comment 4 Marek Fukala 2006-09-05 17:10:13 UTC
fixed. Now it is much more faster, though I still have a performance (algorithm)
problem in TreeNodeAdapter which causes a similar problem when deleting the
entire content of a big XML file. I will fix that. Reporter, please verify your
original issue. 

Checking in
tageditorsupport/src/org/netbeans/modules/editor/structure/api/DocumentModel.java;
/cvs/xml/tageditorsupport/src/org/netbeans/modules/editor/structure/api/DocumentModel.java,v
 <--  DocumentModel.java
new revision: 1.7.2.2.2.7; previous revision: 1.7.2.2.2.6
done
Checking in
text-edit/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java;
/cvs/xml/text-edit/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java,v
 <--  TreeNodeAdapter.java
new revision: 1.2.2.2.2.7; previous revision: 1.2.2.2.2.6
don
Comment 5 Marek Fukala 2006-09-06 10:57:29 UTC
fixed the problem with deleting the document content.

Checking in TreeNodeAdapter.java;
/cvs/xml/text-edit/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java,v
 <--  TreeNodeAdapter.java
new revision: 1.2.2.2.2.8; previous revision: 1.2.2.2.2.7
done


However, I have just realized that the original problem is not fully fixed when
code folding is enabled. I have disabled it yestarday to simplify debugging of
navigator and forgot to check it before committing. I'll try to fix this as well. 
Comment 6 Marek Fukala 2006-09-06 11:57:44 UTC
fixed the performance problem when code folding is enabled.

Checking in XmlFoldManager.java;
/cvs/xml/text-edit/src/org/netbeans/modules/xml/text/folding/XmlFoldManager.java,v
 <--  XmlFoldManager.java
new revision: 1.6.2.2.2.2; previous revision: 1.6.2.2.2.1
done
Comment 7 Andrei Chistiakov 2006-09-07 10:05:49 UTC
Verified in build 060906_1.