negora commented on issue #4709:
URL: https://github.com/apache/netbeans/issues/4709#issuecomment-1264398089

   I've found another case, similar to the previous one, in which the 
visibility of a class member affects the result of this type of check. However, 
this time it affects a method parameter instead of a local variable. Look at 
this:
   
   ```java
   public class Main {
   
       public Main() {
           checkParameter(1);
       }
   
       public static void checkParameter(int myParameter) {
                                       // ^^^ This variable should be marked as 
unused,
                                       // but it isn't.
       }
   
   }
   ```
   
   Now, if you change the visibility of the method from `public` to `private`, 
NetBeans correctly detects that `myParameter` is not used at all in the body of 
the method.
   
   I've tested this in versions 13, 14 and 15 and this *bug* happens in all 
them.
   
   I was tempted to open a separate issue, because I'm not sure that it's 100% 
related to the original issue. If you think that it deserves a separate one, 
please, let me know.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
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