opwvhk commented on code in PR #1637:
URL: https://github.com/apache/avro/pull/1637#discussion_r916875707
##########
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 {
Review Comment:
The intent is to use the same namespace the the definition itself, and any
enclosed definitions that don't specify one themselves. This is a lot easier to
comprehend than using different namespaces.
--
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]