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 246095

Summary: Signal long write-lock sections (such as reformat) by setting a document property and skip document readlock
Product: editor Reporter: Miloslav Metelka <mmetelka>
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 241545    

Description Miloslav Metelka 2014-07-29 08:56:07 UTC
Although previously we abandoned the idea due to BasicTextUI.paint() being final:

    public final void paint(Graphics g, JComponent c) {
        if ((rootView.getViewCount() > 0) && (rootView.getView(0) != null)) {
            Document doc = editor.getDocument();
            if (doc instanceof AbstractDocument) {
                ((AbstractDocument)doc).readLock();
            }
            try {
                paintSafely(g);
            } finally {
                if (doc instanceof AbstractDocument) {
                    ((AbstractDocument)doc).readUnlock();
                }
            }
        }
    }

I've found that we could possibly override BasicTextUI.update().
Comment 1 Ondrej Vrabec 2014-07-29 09:28:16 UTC
versioning diff sidebars requires read-lock when painting, it would help if it had a chance to ask whether to repaint or not: bug 241545
Comment 2 Martin Balin 2016-07-07 07:27:02 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss