dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beiwei30 (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] beiwei30 commented on pull request #3410: refactor loadClass method
Date Fri, 01 Feb 2019 06:44:02 GMT
We should use defensive programming to judge **names** is not either null or empty, plus, I
suggest we should loop **names** once and only once, see below:

            String[] names = NAME_SEPARATOR.split(name);
            if (ArrayUtils.isNotEmpty(names)) {
                cacheActivateClass(clazz, names[0]);
                for (String n : names) {
                    cacheName(clazz, n);
                    saveInExtensionClass(extensionClasses, clazz, name);

Let's loop outside, and change cacheNames to cacheName, and change saveInExtensionClasses
to saveInExtensionClass

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

View raw message