Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-16477

Buglets in JaxrsResourceMethodValidatorDelegate.validatePublicModifierOnJavaMethod()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 4.1.2.CR1
    • 4.1.1.Final
    • webservices
    • None

      JAX-RS resource methods are often declared in classes, but it is also valid to declare them in interfaces. Methods in classes have to be explicitly declared public (and that's what this validator method checks for – good), but methods in Java interfaces are implicitly public; explicitly writing "public" just adds clutter.

      The JAX-RS validator does discover resource methods in interfaces and validates them (good), but if the methods aren't explicitly labelled public then a couple of minor bugs surface in this validator method:

      (1) It adds a RESOURCE_METHOD_NO_PUBLIC_MODIFIER problem marker, and

      (2) The Description that's displayed for the marker is "The method '

      {0}' should be public.", i.e. the "{0}

      " isn't replaced with a method name

      (Yes, I can certainly dodge this by changing the "Missing 'public' method modifier" preference from Warning to Ignore, but I'm definitely a fan of having the validators there to save me from myself).

            xcoulon@redhat.com Xavier Coulon
            xcoulon@redhat.com Xavier Coulon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: