opwvhk commented on code in PR #1637:
URL: https://github.com/apache/avro/pull/1637#discussion_r916880917


##########
lang/java/avro/src/main/java/org/apache/avro/Protocol.java:
##########
@@ -275,15 +274,29 @@ public Protocol(Protocol p) {
 
   public Protocol(String name, String doc, String namespace) {
     super(PROTOCOL_RESERVED);
-    this.name = name;
+    setName(name, namespace);
     this.doc = doc;
-    this.namespace = namespace;
   }
 
   public Protocol(String name, String namespace) {
     this(name, null, namespace);
   }
 
+  private void setName(String name, String namespace) {
+    int lastDot = name.lastIndexOf('.');
+    if (lastDot < 0) {
+      this.name = name;
+      this.namespace = namespace;
+    } else {
+      this.name = name.substring(lastDot) + 1;
+      this.namespace = name.substring(0, lastDot);
+    }
+    if ("".equals(this.namespace)) {

Review Comment:
   Changed.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to