File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
dubbo-common/src/main/java/org/apache/dubbo/common/extension Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,8 @@ public boolean hasExtension(String name) {
346346 if (name == null || name .length () == 0 ) {
347347 throw new IllegalArgumentException ("Extension name == null" );
348348 }
349- try {
350- this .getExtensionClass (name );
351- return true ;
352- } catch (Throwable t ) {
353- return false ;
354- }
349+ Class <?> c = this .getExtensionClass (name );
350+ return c != null ;
355351 }
356352
357353 public Set <String > getSupportedExtensions () {
@@ -565,11 +561,7 @@ private Class<?> getExtensionClass(String name) {
565561 if (name == null ) {
566562 throw new IllegalArgumentException ("Extension name == null" );
567563 }
568- Class <?> clazz = getExtensionClasses ().get (name );
569- if (clazz == null ) {
570- throw new IllegalStateException ("No such extension \" " + name + "\" for " + type .getName () + "!" );
571- }
572- return clazz ;
564+ return getExtensionClasses ().get (name );
573565 }
574566
575567 private Map <String , Class <?>> getExtensionClasses () {
You can’t perform that action at this time.
0 commit comments