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.
When opening a .java file whose size is greater than 1Meg a dialogue is presented to the users asking them if they want to continue as it may cause problems with the IDE. If the file is opened using the project of file browsers there are 2 buttons, labelled yes and no. If the file is opened from a hyperlink (e.g. the file contains a compile error) the dialogue is shown with only an ok button. Clicking ok doesn't open the file (it has the same behaviour as clicking no. To reproduce the error create a large file with one error and click on the error to open the file the incorrect dialogue will be shown.
Created attachment 39427 [details] Only the OK button is present though it has the same effect as clicking no
Created attachment 39429 [details] The correct buttons
I think this is implemented in openide/loaders.
It is not that easy. The code in openide/loaders generates class ME extends org.openide.util.UserQuestionException and it is the responsibility of the caller to understand the exception, show reasonable dialog and then invoke exception.confirmed() I would have to see the stacktrace, but I guess this has to be done somewhere in the hyperlinks code.
I see. I'll then investigate it further. davehun, could you please reproduce the problem and attach your messages.log (<userdir>/var/log/messages.log). Hopefully we will see some stacktraces from there. Thanks a lot.
Created attachment 47146 [details] log file with exception in it
just tried in 6m10. This has the same issue
Ok, I think I tracked this down to CloneableEditorSupport. It allows a document to be opened in two ways - simple open() and through Line.show(kind, column), which translates to CES.openAtImpl(...). In the latter case CES does not handle the UserQuestionException that is thrown when loading a huge file. Therefore the exception is caught and handled in org.netbeans.core.NotifyExcPanel, but because it's got a localized message attached to it the dialog shows that message rather than an ugly stacktrace. Both dialogs look similar, but they are different. IMO CES should handle UQE in both open() and openAtImpl() the same way.
Nontrivial to implement (multiple threads involved, danger of a deadlock), -> future.
*** Issue 129634 has been marked as a duplicate of this issue. ***
This issue doesn't relate to call CES.openAtImpl(...). Possibly mentioned method call CES.openAtImpl(...) will lead to related problem but there should be separate issue with exact steps to reproduce for such behavior. In this issue the problem is in call of Hyperlink.outputLineAction() at org.openide.text.CloneableEditorSupport.openDocument(CloneableEditorSupport.java:710) at org.openide.text.DataEditorSupport.openDocument(DataEditorSupport.java:398) --------> at org.apache.tools.ant.module.run.Hyperlink.outputLineAction(Hyperlink.java:115) at org.netbeans.core.output2.Controller.lineClicked(Controller.java:860) at org.netbeans.core.output2.OutputWindow.lineClicked(OutputWindow.java:277) at org.netbeans.core.output2.OutputTab.lineClicked(OutputTab.java:163) at org.netbeans.core.output2.OutputPane.lineClicked(OutputPane.java:72) at org.netbeans.core.output2.ui.AbstractOutputPane.mouseReleased(AbstractOutputPane.java:600) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272) In this method there is a call to EditorCookie.openDocument(). And this method should be called with special contract ( the problem here that this contract was poorly described in Javadoc but it is fixed some time ago by me ). If one calls this method he should care about UserQuestionExcepotion and catch it in appropriate way. So THIS issue is for class org.apache.tools.ant.module.run.Hyperlink .
I don't know what is exact component for org.apache.tools.ant.module so I just keep it as is.
changeset: 74755:5a6e96cf4592