netbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "negora (Jira)" <>
Subject [jira] [Created] (NETBEANS-4451) "Override Method..." doesn't replicate annotations on methods and types
Date Mon, 15 Jun 2020 06:40:00 GMT
negora created NETBEANS-4451:

             Summary: "Override Method..." doesn't replicate annotations on methods and types
                 Key: NETBEANS-4451
             Project: NetBeans
          Issue Type: Improvement
          Components: editor - Completion &amp; Templates
    Affects Versions: 12.0
         Environment: Debian GNU/Linux 10 (buster)
Linux my-computer 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux
OpenJDK 14.0.0+36
            Reporter: negora

When I use the feature that creates delegated methods, the editor doesn't replicate the annotations
of the delegate methods and their types (i.e. the types used in the arguments). I'm referring
to the feature that is accessible through the menu {{"Source → Insert Code... → Delegate

In my code, I use the Checker Framework a lot, which uses multiple annotations to add certain
checks at compilation time. For example, consider a method like this:
public @Nullable Foo createFoo (@Nullable String bar) {
} {code}
When I create a delegated method with Netbeans IDE, it creates this:
public Foo createFoo (String bar) {
  return delegate.createFoo (bar);
Instead of this:
public @Nullable Foo createFoo (@Nullable String bar) {
  return delegate.createFoo (bar);
It would be really useful if the editor took these annotations into account. Maybe the wizard
could add a checkbox that made this inclusion optional.

There is a case that should be treated in a special way, I guess. It's the "@Override" annotation.
If the class that delegates the method isn't overriding such method, that annotation should
be ignored.

Thank you.


This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

For further information about the NetBeans mailing lists, visit:

View raw message