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.
[200302190100] Select any method and do copy/paste into the same class. SourceException is thrown - it is correct, but the user is warned using "Unexpected Exception" dialog.
This seems as an ErrorManager's issue to me. Please fix or advise what I am doing wrong: - I receive a SourceException (annotated with ErrorManager.USER severity) - another code catches this one and produces IOException, which is annotated by the original SourceException and again ErrorManager.USER severity - the code then throws the IOException. => Unexpected Exception dialog is displayed.
ErrorManager -> dstrupl (?)
*** This issue has been marked as a duplicate of 30947 ***
Not fixed in 3.5.
Was fixed already in trunk, just not in 3.5. Trunk got a full fix for issue #30947, whereas 3.5 got a smaller fix that only addressed certain problems.
Created attachment 9816 [details] Patch for r35 (basically the important missing pieces of #30947's trunk fix)
Created attachment 9817 [details] Binary patch - save as $nbhome/lib/patches/31254.jar
If you think this needs to be in 3.5, pls. make P1 accordingly. Note that the patch itself has already been in the trunk for a while and works fine as far as I know.
I tested the patch and it works. But I thought it could fix issue 26419 too, but it didn't. Jesse, could you take a look at it? These two issues should be solved together I think. Thanks.
It is regression. Should be fixed for 3.5. Thanks
Yarda, maybe you could review the source patch if you have a moment? I don't know who besides me is closest to ErrorManager code - David Strupl perhaps.
I have read the test and I think that it is sane - at least we have a documented behaviour for ErrorManager.annotate. One problem is in the last part of the test where checking for "loc msg" seems useless as both exception and also the localized text use this string. Did you not want to use different strings? Probably yes, I suggest to use three different strings. If the test is changed and still passes there is not reason that I can see why not apply for 3.5.
"One problem is in the last part of the test where checking for "loc msg" seems useless as both exception and also the localized text use this string. Did you not want to use different strings? Probably yes, I suggest to use three different strings." - actually the second-to-last section of the test does just that, and passes. I only added the last block - in r35 only, not in trunk - to make sure that this particular issue was solved. SourceException uses the same detail message as the loc annotation, and I wanted to keep as close to the same behavior in the test as possible. Actually I will probably merge that last block to the trunk as the assertTrue(isLocalized()) is important - message == localizedMessage yet there is a localized annotation, which happens sometimes.
approved for 3.5
committed * Up-To-Date 1.49.2.2 core/src/org/netbeans/core/NbErrorManager.java committed * Up-To-Date 1.2.2.1 core/test/unit/src/org/netbeans/core/NbErrorManagerTest.java
Verified