wu-sheng commented on a change in pull request #4307: Clean up legacy v1 header
logic, use built-in Base64 since JDK8
URL: https://github.com/apache/skywalking/pull/4307#discussion_r373829678
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java
##########
@@ -163,27 +141,16 @@ public boolean isValid() {
* @return true for unbroken {@link ContextCarrier} or no-initialized.
Otherwise, false;
*/
boolean isValid(HeaderVersion version) {
- if (HeaderVersion.v1.equals(version)) {
- return traceSegmentId != null
- && traceSegmentId.isValid()
- && getSpanId() > -1
- && parentServiceInstanceId != DictionaryUtil.nullValue()
- && entryServiceInstanceId != DictionaryUtil.nullValue()
- && !StringUtil.isEmpty(peerHost)
- && !StringUtil.isEmpty(entryEndpointName)
- && !StringUtil.isEmpty(parentEndpointName)
- && primaryDistributedTraceId != null;
- } else if (HeaderVersion.v2.equals(version)) {
+ if (HeaderVersion.v2 == version) {
return traceSegmentId != null
&& traceSegmentId.isValid()
&& getSpanId() > -1
&& parentServiceInstanceId != DictionaryUtil.nullValue()
&& entryServiceInstanceId != DictionaryUtil.nullValue()
&& !StringUtil.isEmpty(peerHost)
&& primaryDistributedTraceId != null;
- } else {
- throw new IllegalArgumentException("Unimplemented header version."
+ version);
}
+ throw new IllegalArgumentException("Unimplemented header version." +
version);
Review comment:
Same here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services