You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/07/03 01:34:23 UTC

[GitHub] [dubbo] xh1202 opened a new pull request #8207: Fix the NPE (#8195)

xh1202 opened a new pull request #8207:
URL: https://github.com/apache/dubbo/pull/8207


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] xh1202 closed pull request #8207: Fix the NPE (#8195)

Posted by GitBox <gi...@apache.org>.
xh1202 closed pull request #8207:
URL: https://github.com/apache/dubbo/pull/8207


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] horizonzy commented on a change in pull request #8207: Fix the NPE (#8195)

Posted by GitBox <gi...@apache.org>.
horizonzy commented on a change in pull request #8207:
URL: https://github.com/apache/dubbo/pull/8207#discussion_r663355750



##########
File path: dubbo-container/dubbo-container-api/src/main/java/org/apache/dubbo/container/Main.java
##########
@@ -61,9 +61,10 @@ public static void main(String[] args) {
             final List<Container> containers = new ArrayList<Container>();
             for (int i = 0; i < args.length; i++) {
                 Container container = LOADER.getExtension(args[i]);
-                if (null != container) {
-                    containers.add(LOADER.getExtension(args[i]));
+                if (null == container) {
+                    throw new IllegalArgumentException("Default extension is not configured, but the extension name is 'true'");

Review comment:
       msg can be String.format("The extension is not find, pls check your param: %s is match spi", args[i]);

##########
File path: dubbo-container/dubbo-container-api/src/main/java/org/apache/dubbo/container/Main.java
##########
@@ -61,9 +61,10 @@ public static void main(String[] args) {
             final List<Container> containers = new ArrayList<Container>();
             for (int i = 0; i < args.length; i++) {
                 Container container = LOADER.getExtension(args[i]);
-                if (null != container) {
-                    containers.add(LOADER.getExtension(args[i]));
+                if (null == container) {
+                    throw new IllegalArgumentException("Default extension is not configured, but the extension name is 'true'");
                 }
+                containers.add(LOADER.getExtension(args[i]));

Review comment:
       here can reuse container




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] horizonzy commented on a change in pull request #8207: Fix the NPE (#8195)

Posted by GitBox <gi...@apache.org>.
horizonzy commented on a change in pull request #8207:
URL: https://github.com/apache/dubbo/pull/8207#discussion_r663338152



##########
File path: dubbo-container/dubbo-container-api/src/main/java/org/apache/dubbo/container/Main.java
##########
@@ -60,7 +60,10 @@ public static void main(String[] args) {
 
             final List<Container> containers = new ArrayList<Container>();
             for (int i = 0; i < args.length; i++) {
-                containers.add(LOADER.getExtension(args[i]));
+                Container container = LOADER.getExtension(args[i]);

Review comment:
       here maybe throw exception will be better, tell user the args maybe wrong.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] horizonzy commented on pull request #8207: Fix the NPE (#8195)

Posted by GitBox <gi...@apache.org>.
horizonzy commented on pull request #8207:
URL: https://github.com/apache/dubbo/pull/8207#issuecomment-873566192


   This issue maybe be fixed by #8215.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org