dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ifdevil (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] Ifdevil commented on issue #3795: Found hard code Strings, which should be replace by constants.
Date Thu, 04 Apr 2019 07:57:32 GMT
In the Wrapper Class has same issue ,like:
           
           private static final String[] OBJECT_METHODS = new String[]{"getClass", "hashCode",
"toString", "equals"};

            if ("getClass".equals(mn)) {
                return instance.getClass();
            }
            if ("hashCode".equals(mn)) {
                return instance.hashCode();
            }
            if ("toString".equals(mn)) {
                return instance.toString();
            }
            if ("equals".equals(mn)) {
                if (args.length == 1) {
                    return instance.equals(args[0]);
                }
                throw new IllegalArgumentException("Invoke method [" + mn + "] argument number
error.");
            }

Maybe these can be replaced by OBJECT_METHODS[i]?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3795 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


Mime
View raw message