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 262802

Summary: AssertionError thrown when using org.netbeans.modules.localhistory.ui.actions.RevertDeletedAction
Product: versioncontrol Reporter: sproger1
Component: LocalhistoryAssignee: Tomas Stupka <tstupka>
Status: RESOLVED INCOMPLETE    
Severity: normal CC: sproger1
Priority: P1    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Full Netbeans IDE log

Description sproger1 2016-07-13 15:30:30 UTC
Created attachment 160375 [details]
Full Netbeans IDE log

I'm using the Dev build 201607120002 (downloaded from: http://bits.netbeans.org/download/trunk/nightly/latest/) and when I try to recover a recently deleted file by right-clicking on a folder and choosing 'History' -> "Revert Deleted" from the menu I get the following error and am thus unable to recover the deleted file.

java.lang.AssertionError
	at org.openide.awt.HtmlRendererImpl.reset(HtmlRendererImpl.java:103)
	at org.openide.awt.HtmlRendererImpl.getTreeCellRendererComponent(HtmlRendererImpl.java:147)
	at org.netbeans.modules.localhistory.ui.actions.DeletedListRenderer.getTreeCellRendererComponent(DeletedListRenderer.java:90)
	at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimensions(BasicTreeUI.java:2807)
	at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:492)
	at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(VariableHeightLayoutCache.java:1360)
	at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1487)
	at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1288)
	at javax.swing.tree.VariableHeightLayoutCache.rebuild(VariableHeightLayoutCache.java:743)
	at javax.swing.tree.VariableHeightLayoutCache.setModel(VariableHeightLayoutCache.java:109)
	at javax.swing.plaf.basic.BasicTreeUI.setModel(BasicTreeUI.java:412)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.propertyChange(BasicTreeUI.java:3414)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
	at java.awt.Component.firePropertyChange(Component.java:8430)
	at javax.swing.JTree.setModel(JTree.java:882)
	at org.netbeans.modules.localhistory.ui.actions.RevertPanel.setRootNode(RevertPanel.java:134)
	at org.netbeans.modules.localhistory.ui.actions.RevertDeletedAction.retrieveDeletedFiles(RevertDeletedAction.java:139)
	at org.netbeans.modules.localhistory.ui.actions.RevertDeletedAction.access$100(RevertDeletedAction.java:91)
	at org.netbeans.modules.localhistory.ui.actions.RevertDeletedAction$1.run(RevertDeletedAction.java:110)
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to
	at org.openide.util.RequestProcessor.post(RequestProcessor.java:420)
	at org.netbeans.modules.localhistory.ui.actions.RevertDeletedAction.performAction(RevertDeletedAction.java:107)
	at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:586)
	at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:95)
	at org.openide.util.actions.ActionInvoker$ActionRunnable.actionPerformed(ActionInvoker.java:162)
	at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:109)
	at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:60)
	at org.openide.util.actions.ActionInvoker$ActionRunnable.doRun(ActionInvoker.java:153)
	at org.openide.util.actions.ActionInvoker$2.run(ActionInvoker.java:110)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)


Similar bug existed on a different action that may help point to a solution for this bug: See: https://netbeans.org/bugzilla/show_bug.cgi?id=262202

This issue is popping up on multiple actions means needs to be testing on all the Actions in the IDE to pre-emptively catch these bugs.
Comment 1 sproger1 2016-07-13 15:57:19 UTC
There is a high probability that more Action classes (those that extend NodeAction) in the Dev build (after 5 May 2016 due to commits by Jaroslav Tulach on 5 May hg rev# 169964 and/or rev#169962) have this same bug, if said actions do not explicitly set asynchronous to false, and they create/launch ui/swing/awt... objects.


The default of asynchronous = false has somehow changed, since RevertDeletedAction has not been modified and it used to work before. Some underlying behaviour has changed that is causing this issue, and hence I think it is not enough to simply fix this RevertActionDeleted class but also to check/fix the underlying issue (i.e. verify that ALL actions that require asyncronous=false are indeed setting the property).
Comment 2 Tomas Stupka 2016-07-13 16:09:42 UTC
fixed in jet-main #673a47796c3c
Comment 3 Tomas Stupka 2016-07-13 16:12:21 UTC
> There is a high probability that more Action classes (those that extend NodeAction) ...
there probably will be more cases than just the mentioned actions
> I think it is not enough to simply fix this RevertActionDeleted class but also ...
guess that it was one of the ideas of the assert being set - to identify the relevant cases, report and fix them
Comment 4 sproger1 2016-07-13 16:47:02 UTC
Thanks for the quick response. I verified/tested your commit and it does fix the problem for the RevertDeletedAction.

I understand, that the current approach is to report and fix as needed. Just wish there was some automated UI testing that would exersise all the Action classes so that your user's don't experience so many bugs that could be caught by regression testing. I understand that this is likely due to limited resources, and also the scope and length of time it would take to run such tests. Just nit picking :) . I will do my best to report any I encounter, and thanks again for the quick fix.
Comment 5 sproger1 2016-07-13 17:12:24 UTC
With the fix (jet-main #673a47796c3c), I'm still bombarded with the warning message: 

WARNING [org.openide.util.actions.CallableSystemAction]: Warning - org.netbeans.modules.localhistory.ui.actions.RevertDeletedAction should override CallableSystemAction.asynchronous() to return false


Why does it give this message and it still thing asynchronous should be set to false? 

Other than the warning, it works fine. Can you make the message go away by explicitly setting asynchronous to true?
Comment 6 sproger1 2016-07-13 17:13:17 UTC
Almost complete, please make warning message go away, see previous comment
Comment 7 Quality Engineering 2016-07-14 01:50:53 UTC
Integrated into 'main-silver', will be available in build *201607140002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/673a47796c3c
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #262802 - AssertionError thrown when using  org.netbeans.modules.localhistory.ui.actions.RevertDeletedAction