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

Summary: [Override Methods] dialog is very slow.
Product: java Reporter: Petr Nejedly <pnejedly>
Component: UnsupportedAssignee: Tomas Hurka <thurka>
Status: VERIFIED FIXED    
Severity: blocker Keywords: PERFORMANCE
Priority: P2    
Version: -S1S-   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 26581    
Attachments: Part of thread dump during the freeze.

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