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.
Invoke Override Method tool. Try to add the same method twice: "Unexpected Exception" warning appears instead of "A method named "..." is already present in the class" SourceException is not probably annotated well? Or is this bug a problem of ErrorManager?
Fixed in trunk. Severity was changed from EXCEPTION to USER.
Verified
Probably somehow related to issue 31254 and issue 30947.
It is regression. Should be fixed for 3.5.
I guess Honza is right, this related to issue 31254 and issue 30947. No changes in the code in Java module, Exception is annotated with USER severity. See java/src/org/netbeans/modules/java/tools/OverridePanelBase.java Version 1.13
I am looking at it. Can reproduce in trunk.
Relevant stack trace for example: org.openide.src.SourceException: A method named "addComponentListener" is already present in the class. at org.netbeans.modules.java.tools.OverrideActionPanel.throwAddException(OverrideActionPanel.java:78) at org.netbeans.modules.java.tools.OverrideActionPanel.overrideMethod(OverrideActionPanel.java:64) [catch] at org.netbeans.modules.java.tools.OverridePanelBase.overrideSelectedMethods(OverridePanelBase.java:292) The bug is in OverrideActionPanel.throwAddException. It does not give the exception a localized annotation. The detail message happens to come from a bundle, but message == localizedMessage and there is no ErrorManager-annotated localized message. So ErrorManager has no way of knowing that there is a human-displayable message; it assumes that there is none, and therefore displays a generic exception dialog suited to unexpected exceptions. Recommended code would be like: private void throwAddException(MethodElement m) throws SourceException { SourceException e = new SourceException("Adding dupe: " + m.getName().getName()); // NOI18N ErrorManager.getDefault().annotate(e, NbBundle.getMessage(OverrideActionPanel.class, "FMT_METHOD_PRESENT", m.getName().getName())); throw e; }
Fixed in trunk Checking in OverrideActionPanel.java; /cvs/java/src/org/netbeans/modules/java/tools/OverrideActionPanel.java,v <-- OverrideActionPanel.java new revision: 1.5; previous revision: 1.4 done
Reviewed the patch, it is OK to fix the issue and it does not affect any other functionality.
Created attachment 9922 [details] Patch for release35 branch
Fix verified on continuous build 20030414-1639
approved for 3.5
Fixed in release35 branch. Checking in OverrideActionPanel.java; /cvs/java/src/org/netbeans/modules/java/tools/OverrideActionPanel.java,v <-- OverrideActionPanel.java new revision: 1.4.44.1; previous revision: 1.4 done
VERIFIED