You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "beiwei30 (GitHub)" <gi...@apache.org> on 2019/02/01 06:42:52 UTC

[GitHub] [incubator-dubbo] beiwei30 commented on pull request #3410: refactor loadClass method

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:


```suggestion
            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);
                }
            }
```

[ 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