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 160478

Summary: Go to Type blocks EQ
Product: java Reporter: Jesse Glick <jglick>
Component: SourceAssignee: Rastislav Komara <moonko>
Status: RESOLVED FIXED    
Severity: blocker CC: hmichel
Priority: P3 Keywords: PERFORMANCE, THREAD
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Thread dump

Description Jesse Glick 2009-03-17 16:56:22 UTC
090313. Open a module group, press C-O right away during scanning, pick a class, and hit Enter. The editor tab opens
blank and the IDE freezes for quite a while.

Looks like JavaTypeDescription.open should be made to run asynch?
Comment 1 Jesse Glick 2009-03-17 16:57:02 UTC
Created attachment 78313 [details]
Thread dump
Comment 2 Rastislav Komara 2009-03-25 16:17:48 UTC
In this case we have only one reasonable option. Open file on 0 offset. Then schedule task which locates correct offset
of element and after this task is finished the cursor will be moved appropriately based on condition (e.g. the caret has
not been moved since opening the file...). This will not affect opening file when scan is not running.
Comment 3 Jesse Glick 2009-03-25 17:08:25 UTC
Even just opening at offset 0 and not scheduling any further correction would be better than the current state. Most of
the time I am opening a top-level type and do not really care what caret position you initially open the editor to; if I
want to see something else I will use Page Down.
Comment 4 Rastislav Komara 2009-03-30 14:46:03 UTC
Fixed. If there is indexing in progress the editor is opened on 0 offset in document.
Comment 5 Jesse Glick 2009-03-30 16:51:47 UTC
Excellent!

BTW it is normal to include changeset information in comment, in this case probably

jet-main #0871113eeaa3

A note on impl: ErrorManager should not be used in new code. Anyway
ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, "...") will by default not be displayed anywhere, which may or
may not be what you want. Use e.g.

Logger.getLogger(ElementOpen.class.getName()).log(Level.FINE, "Opening {0} at offset 0", fileName);

or whatever you need. INFO displayed by default (probably undesirable in this case), FINE not unless you pass
-J-Dorg.netbeans.api.java.source.level=FINE or similar.
Comment 6 Rastislav Komara 2009-03-31 08:10:36 UTC
@jglick: The ErrorManager was removed in jet-main #0871113eeaa3