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.
My module is a filesystem module, it uses UserQuestionException to handle user confirmation in lock(). This exception should have two descriptions, one to confirm the action and the other to notify the exception when the lock()cannot be done. Currently there is no way to attach two different messages to the exception. A workaroud is to use the ErrorManger.annotate to add the second message as a localized message. However this rely on all the components which call lock() to implement the workaround. Instead of relying on the workaround, a proper API should be implemented. VCS module has the same problem.
Target milestone -> 3.3
API changes are enhancements, too late for 3.2.
Filed against 3.2 originally.
Target milestone -> 3.3.1.
Set target milestone to TBD
I`m not sure If I understand correctly. Impl. of UserQuestionException expects to redefine method confirm that fires IOException (so IOException with arbitrary message can be fired). And if lock fails then doesn`t need to be fired UserQuestionException at all (suffices IOException) or new UserQuestionException with arbitrary message again. I`m confused. Moreover UserQuestionException is used only in VcsFileSystem and this usage seems to me that has sense. So, will be closed as WONTFIX, but if anybody can make it clear, then don`t hasitate do it and perhaps reopen.
I'm writing non-VCS code and was given this workaround to do in my data node to handle readonly files because of the need to checkout challenge: try { getDataObject().setModified(modified); } // workaround for bugzilla bug 11960 catch (final UserQuestionException uqe) { // This will popup the "do you want to check out" // dialog for TW and a proper message for CVS SwingUtilities.invokeLater(new Runnable () { public void run () { String message = uqe.getLocalizedMessage(); if (Util.checkForWarning(message)) { try { uqe.confirmed(); } catch (IOException ioe) { Util.showError(ioe); } } } }); } // end workaround catch (IOException e) { throw new PropertyVetoException(e.getMessage(), event); }
Please address what should be done instead of the code sample provided.
From my point of view: 1/ UserQuestionException shouldn't have been used in fs API at all 2/ there is no fs implementation (except VCSFileSystem) that throws this exception (maybe should be changed - because its unpleasant to catch everywhere) 3/ there are actually 2 messages in UserQuestionException - first one is obvious - second one is part of IOException fired from confirm method.
As I asked before, how should my code be changed?