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 29548 - [Override Methods] dialog is very slow.
Summary: [Override Methods] dialog is very slow.
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: -S1S-
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 26581
  Show dependency tree
 
Reported: 2002-12-13 16:50 UTC by Petr Nejedly
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Part of thread dump during the freeze. (2.24 KB, text/plain)
2002-12-13 16:51 UTC, Petr Nejedly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Nejedly 2002-12-13 16:50:30 UTC
Steps to reproduce:
Create new JFrame, invoke Override Methods wizard,
select the class Componet in inherited class
chooser.
It takes ethernity before the IDE becomes
reponsive again
and every repaint of the wizard is quite slow as
well.

No surprise it's slow when it creates/loads new
document
just to obtain the display name of *each* item in
the methods list. I'll attach relevant part of a
thread dump.
Comment 1 Petr Nejedly 2002-12-13 16:51:13 UTC
Created attachment 8328 [details]
Part of thread dump during the freeze.
Comment 2 Petr Nejedly 2002-12-13 16:57:40 UTC
OK, I don't have the best stack trace handy, but this snippet of code
speaks for itself (from org.openide.src.Element):

    public String toString()
{                                                  
        StringWriter sw = new
StringWriter();                                   
        StyledDocument doc =
createDocument();                                  
        IndentEngine indentator =
IndentEngine.find(doc);                       
        PrintWriter pw = new PrintWriter(indentator.createWriter(doc,
0, sw));  
        //    PrintWriter pw = new
PrintWriter(sw);                             
        try
{                                                                   
            print(new
DefaultElementPrinter(pw));                               
       
}                                                                       
        catch (ElementPrinterInterruptException e)
{                            
            // could not
happen.                                                
       
}                                                                       
       
pw.close();                                                             
        return
sw.toString();                                                   
    }

Now look at the createDocument()...

So maybe the problem is in teh editor
(Too long time to prepare the indent engine but still it seems
too heavyweight to just paint an item in a list...
Comment 3 Tomas Hurka 2003-01-23 14:15:06 UTC
Fixed in trunk. I found out that the Element.toString() can be completely omitted. 
Comment 4 Petr Nejedly 2003-01-29 13:04:58 UTC
OK, it is fast enough now.
Comment 5 Quality Engineering 2007-09-20 10:42:21 UTC
Reorganization of java component