mbien commented on issue #7167: URL: https://github.com/apache/netbeans/issues/7167#issuecomment-2079396770
yeah enums have the same issue (`toString()` isn't final interestingly, NB will also suggest that): ``` getClass()java.lang.Class -> [public, final, native] notify()void -> [public, final, native] notifyAll()void -> [public, final, native] wait()void -> [public, final] wait(long)void -> [public, final, native] wait(long,int)void -> [public, final] name()java.lang.String -> [public, final] ordinal()int -> [public, final] toString()java.lang.String -> [public] equals(java.lang.Object)boolean -> [public, final] hashCode()int -> [public, final] clone()java.lang.Object -> [protected, final] compareTo(com.mycompany.mavenproject1.AEnum)int -> [public, final] getDeclaringClass()java.lang.Class -> [public, final] describeConstable()java.util.Optional -> [public, final] valueOf(java.lang.Class,java.lang.String)java.lang.Enum -> [public, static] finalize()void -> [protected, final] values()com.mycompany.mavenproject1.AEnum[] -> [public, static] valueOf(java.lang.String)com.mycompany.mavenproject1.AEnum -> [public, static] ``` A record is a final class which extends `java.lang.Record`. The problem is that javac generates all methods as final **unless** they are added by the user, then it will skip that method. I don't see a way to distinguish between the generated method and a user provided method just by using the compiler api. But I also don't have a lot of experience with it, maybe there is a query for generated code or something similar. NB can't only take the supertype into consideration due to various reasons (e.g you don't want to generate the same method twice). I am sure this can be solved but I don't see a elegant way right now. -- 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
