File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
dubbo-common/src/main/java/org/apache/dubbo/common/extension Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -492,12 +492,15 @@ public T getAdaptiveExtension() {
492492 return (T ) instance ;
493493 }
494494
495- private IllegalStateException findException (String name ) {
495+ private void findException (String name ) {
496496 for (Map .Entry <String , IllegalStateException > entry : exceptions .entrySet ()) {
497497 if (entry .getKey ().toLowerCase ().contains (name .toLowerCase ())) {
498- return entry .getValue ();
498+ throw entry .getValue ();
499499 }
500500 }
501+ }
502+
503+ private IllegalStateException noExtensionException (String name ) {
501504 StringBuilder buf = new StringBuilder ("No such extension " + type .getName () + " by name " + name );
502505
503506
@@ -519,9 +522,11 @@ private IllegalStateException findException(String name) {
519522
520523 @ SuppressWarnings ("unchecked" )
521524 private T createExtension (String name ) {
525+ // throws any possible exception in loading period.
526+ findException (name );
522527 Class <?> clazz = getExtensionClasses ().get (name );
523528 if (clazz == null ) {
524- throw findException (name );
529+ throw noExtensionException (name );
525530 }
526531 try {
527532 T instance = (T ) EXTENSION_INSTANCES .get (clazz );
You can’t perform that action at this time.
0 commit comments