[jboss-jira] [JBoss JIRA] (DROOLS-1632) Warning "Getter overloaded" is sometimes inaccurate

Geoffrey De Smet (JIRA) issues at jboss.org
Sun Jun 25 01:34:00 EDT 2017


Geoffrey De Smet created DROOLS-1632:
----------------------------------------

             Summary: Warning "Getter overloaded" is sometimes inaccurate
                 Key: DROOLS-1632
                 URL: https://issues.jboss.org/browse/DROOLS-1632
             Project: Drools
          Issue Type: Enhancement
          Components: core engine
            Reporter: Geoffrey De Smet
            Assignee: Mario Fusco
            Priority: Minor


A user got this warning:

{code}
Getter overloading detected in class mypackage.MyClass : getId (class java.lang.Object) vs getId (class java.lang.Long) 
{code}

The warning happened for a case with 2 methods that are NOT overloaded:

* Object getId() {...}
* Long getId() {...}

Methods are only overloaded if they have the same name and a different parameter list. 

In this case they might be overwritten (if the first one is from a parent class). Or the user somehow managed to circumvent the JLS (unlikely).

1) The error message should be accurate. Don't use "overloaded " when "overwritten".
2) The error message should mention the declaring class for every method, so it's easier to recognize class hierachy's involvement. So "MyClass.getId()" or "Parent.getId()" instead of just "getId".
3) The error message should not put the return type between braces after the method name as that makes it look like a paremeter. Use "getId() returns java.lang.object" instead of "getId (class java.lang.Object)"

Full user's case:
https://stackoverflow.com/questions/44723889/drools-claims-that-method-was-overloaded



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list