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

   > 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 think it is intentional to not mark unused parameters in public methods 
since removing them would change your public API, breaking code using that 
method.


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