You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/09/09 10:08:12 UTC

[GitHub] [netbeans] pedro-w opened a new issue, #4604: Deprecation inspection does not produce any output

pedro-w opened a new issue, #4604:
URL: https://github.com/apache/netbeans/issues/4604

   ### Apache NetBeans version
   
   Apache NetBeans 15 release candidate
   
   ### What happened
   
   I wanted to find uses of deprecated API in a Java (Maven) project. But running the Inspect... item did not give any output in the Inspector window.
   
   
   ### How to reproduce
   
   I have a minimal test case
   ``` java
   public class Mavenproject2 {
   
       public static void main(String[] args) {
           Mavenproject2 it  = new Mavenproject2();
           System.out.println(it.test(123));
           System.out.println(it.test("Hello World!"));
       }
       /**
        * Test a number
        * @param x a number
        * @return another number
        */
       public int test(int x) {
           return x;
       }
       /**
        * Test a String
        * @param x
        * @return a number
        * @deprecated Use Support#test(int) instead
        */
       @Deprecated()
       public int test(String x) {
           return x.length();
       }
   }
   ```
   With this code in a maven project, select menu Source | Inspect... and choose Scope: current file and Use: single inspection deprecated. I believe this should cite use of deprecated `test(String)` in the Inspector panel but it does not.
   
   ![Screenshot 2022-09-09 110241](https://user-images.githubusercontent.com/22172519/189326314-7748f0fd-c81b-4912-9d75-dc9e52399104.png)
   
   Note the IDE does show strikethrough on both the declaration and use of that method.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 10 version 10.0 running on amd64; Cp1252; en_GB (nb)
   
   ### JDK
   
   11.0.9.1; OpenJDK 64-Bit Server VM 11.0.9.1+1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   Log file attached, as far as I can no relevant entries.
   [ide-log.txt](https://github.com/apache/netbeans/files/9534464/ide-log.txt)
   
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
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: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] pedro-w commented on issue #4604: Deprecation inspection does not produce any output

Posted by GitBox <gi...@apache.org>.
pedro-w commented on issue #4604:
URL: https://github.com/apache/netbeans/issues/4604#issuecomment-1241777953

   I took the "Operating System" text from what Help | About shows in Netbeans itself, my system is actually
   
       Edition	Windows 11 Pro
       Version	21H2
       Installed on	‎06/‎10/‎2021
       OS build	22000.918
       Experience	Windows Feature Experience Pack 1000.22000.918.0
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on issue #4604: Deprecation inspection does not produce any output

Posted by GitBox <gi...@apache.org>.
mbien commented on issue #4604:
URL: https://github.com/apache/netbeans/issues/4604#issuecomment-1292766426

   The deprecation warnings come directly from javac ([StandardJavacWarnings](https://github.com/apache/netbeans/blob/c084119009d2e0f736f225d706bc1827af283501/java/java.hints/src/org/netbeans/modules/java/hints/StandardJavacWarnings.java)). The current implementation won't work as code inspection since the hint isn't doing anything (it basically only sets compiler flags).
   
   During the inspection, [BatchSearch](https://github.com/apache/netbeans/blob/4ae01ea70f4530443343beee3292e880a74099bd/java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/batch/BatchSearch.java#L603-L607) can't find anything since the pattern is null.
   
   This applies not only for deprecations but to all other standard compiler warnings like raw types etc.
   
   It would be fairly easy to implement a code inspection for finding usage of deprecated methods, but this wouldn't solve the other javac warnings. Would be great to find a way to fix this properly. 
   
   @jlahoda any hints? ;)
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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