This is an automated email from the ASF dual-hosted git repository.

neilcsmith pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
     new c0d4090c0c Never mark overriding methods as unused, fixes GH4276.
     new 9c253484f7 Merge pull request #4857 from neilcsmith-net/gh4276
c0d4090c0c is described below

commit c0d4090c0c3ffefef14e61307930fc8961758878
Author: Neil C Smith <[email protected]>
AuthorDate: Tue Oct 25 12:53:24 2022 +0100

    Never mark overriding methods as unused, fixes GH4276.
---
 .../org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java
 
b/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java
index f2c8ca0686..d5a7cadce4 100644
--- 
a/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java
+++ 
b/java/java.editor.base/src/org/netbeans/modules/java/editor/base/semantic/UnusedDetector.java
@@ -141,7 +141,8 @@ public class UnusedDetector {
                     }
                 }
             } else if ((el.getKind() == ElementKind.CONSTRUCTOR || 
el.getKind() == ElementKind.METHOD) && (isPrivate || isPkgPrivate)) {
-                if (!isSerializationMethod(info, (ExecutableElement)el) && 
!uses.contains(UseTypes.USED)) {
+                if (!isSerializationMethod(info, (ExecutableElement)el) && 
!uses.contains(UseTypes.USED)
+                        && 
!info.getElementUtilities().overridesMethod((ExecutableElement)el)) {
                     if (isPrivate || isUnusedInPkg(info, el, cancel)) {
                         result.add(new UnusedDescription(el, declaration, 
UnusedReason.NOT_USED));
                     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to