提交 bc0c25ad 编写于 作者: T tzy1316106836 提交者: wu-sheng

the static paramater is best to be referenced by the class (#2868)

* fix potential NullPointerException

* Revert "fix potential NullPointerException"

This reverts commit 8393656

* fix potential NullPointerException
the static paramater is best to use the class to reference
上级 c3de8e8b
...@@ -175,7 +175,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis { ...@@ -175,7 +175,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
if (request != null) { if (request != null) {
endpoint = request.getPath(); endpoint = request.getPath();
String schema = request.getScheme(); String schema = request.getScheme();
if (schema.equals("http") || schema.equals("https")) { if ("http".equals(schema) || "https".equals(schema)) {
protocol = Protocol.HTTP; protocol = Protocol.HTTP;
} else { } else {
protocol = Protocol.gRPC; protocol = Protocol.gRPC;
...@@ -278,7 +278,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis { ...@@ -278,7 +278,7 @@ public class K8sALSServiceMeshHTTPAnalysis implements ALSHTTPAnalysis {
if (request != null) { if (request != null) {
endpoint = request.getPath(); endpoint = request.getPath();
String schema = request.getScheme(); String schema = request.getScheme();
if (schema.equals("http") || schema.equals("https")) { if ("http".equals(schema) || "https".equals(schema)) {
protocol = Protocol.HTTP; protocol = Protocol.HTTP;
} else { } else {
protocol = Protocol.gRPC; protocol = Protocol.gRPC;
......
...@@ -275,7 +275,7 @@ public class SegmentParse { ...@@ -275,7 +275,7 @@ public class SegmentParse {
segmentParse.setStandardizationWorker(standardizationWorker); segmentParse.setStandardizationWorker(standardizationWorker);
boolean parseResult = segmentParse.parse(bufferData, Source.Buffer); boolean parseResult = segmentParse.parse(bufferData, Source.Buffer);
if (parseResult) { if (parseResult) {
segmentParse.TRACE_BUFFER_FILE_OUT.inc(); TRACE_BUFFER_FILE_OUT.inc();
} }
return parseResult; return parseResult;
......
...@@ -275,7 +275,7 @@ public class SegmentParseV2 { ...@@ -275,7 +275,7 @@ public class SegmentParseV2 {
segmentParse.setStandardizationWorker(standardizationWorker); segmentParse.setStandardizationWorker(standardizationWorker);
boolean parseResult = segmentParse.parse(bufferData, SegmentSource.Buffer); boolean parseResult = segmentParse.parse(bufferData, SegmentSource.Buffer);
if (parseResult) { if (parseResult) {
segmentParse.TRACE_BUFFER_FILE_OUT.inc(); TRACE_BUFFER_FILE_OUT.inc();
} }
return parseResult; return parseResult;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册