未验证 提交 d02ee0af 编写于 作者: X Xin,Zhang 提交者: GitHub

Replace != with equals (#5617)

Co-authored-by: wu-sheng's avatar吴晟 Wu Sheng <wu.sheng@foxmail.com>
上级 1f793674
......@@ -130,7 +130,7 @@ public class MakeWrapperInterceptor implements StaticMethodsAroundInterceptor {
boolean override = false;
for (Method m2 : methods) {
if (m != m2 && m.getName().equals(m2.getName())) {
if (!m.equals(m2) && m.getName().equals(m2.getName())) {
override = true;
break;
}
......
......@@ -130,7 +130,7 @@ public class MakeWrapperInterceptor implements StaticMethodsAroundInterceptor {
boolean override = false;
for (Method m2 : methods) {
if (m != m2 && m.getName().equals(m2.getName())) {
if (!m.equals(m2) && m.getName().equals(m2.getName())) {
override = true;
break;
}
......
......@@ -35,7 +35,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
ExecutionStrategyParameters parameters = (ExecutionStrategyParameters) allArguments[1];
if (parameters == null || parameters.getParent().getPath() != ExecutionPath.rootPath()) {
if (parameters == null || !parameters.getParent().getPath().equals(ExecutionPath.rootPath())) {
return;
}
AbstractSpan span = ContextManager.createLocalSpan(parameters.getField().getSingleField().getName());
......@@ -46,7 +46,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
ExecutionStrategyParameters parameters = (ExecutionStrategyParameters) allArguments[1];
if (parameters == null || parameters.getParent().getPath() != ExecutionPath.rootPath()) {
if (parameters == null || !parameters.getParent().getPath().equals(ExecutionPath.rootPath())) {
return ret;
}
ContextManager.stopSpan();
......@@ -56,7 +56,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t) {
ExecutionStrategyParameters parameters = (ExecutionStrategyParameters) allArguments[1];
if (parameters == null || parameters.getParent().getPath() != ExecutionPath.rootPath()) {
if (parameters == null || !parameters.getParent().getPath().equals(ExecutionPath.rootPath())) {
return;
}
dealException(t);
......
......@@ -65,7 +65,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
Field field = ExecutionPath.class.getDeclaredField("parent");
field.setAccessible(true);
ExecutionPath parentPath = (ExecutionPath) field.get(path);
if (parentPath != ExecutionPath.rootPath()) {
if (!parentPath.equals(ExecutionPath.rootPath())) {
return ret;
}
ContextManager.stopSpan();
......@@ -85,7 +85,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
Field field = ExecutionPath.class.getDeclaredField("parent");
field.setAccessible(true);
ExecutionPath parentPath = (ExecutionPath) field.get(path);
if (parentPath != ExecutionPath.rootPath()) {
if (!parentPath.equals(ExecutionPath.rootPath())) {
return;
}
dealException(t);
......
......@@ -35,7 +35,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
ExecutionStrategyParameters parameters = (ExecutionStrategyParameters) allArguments[1];
if (parameters == null || parameters.getParent().getPath() != ExecutionPath.rootPath()) {
if (parameters == null || !parameters.getParent().getPath().equals(ExecutionPath.rootPath())) {
return;
}
AbstractSpan span = ContextManager.createLocalSpan(parameters.getField().get(0).getName());
......@@ -46,7 +46,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
ExecutionStrategyParameters parameters = (ExecutionStrategyParameters) allArguments[1];
if (parameters == null || parameters.getParent().getPath() != ExecutionPath.rootPath()) {
if (parameters == null || !parameters.getParent().getPath().equals(ExecutionPath.rootPath())) {
return ret;
}
ContextManager.stopSpan();
......@@ -56,7 +56,7 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t) {
ExecutionStrategyParameters parameters = (ExecutionStrategyParameters) allArguments[1];
if (parameters == null || parameters.getParent().getPath() != ExecutionPath.rootPath()) {
if (parameters == null || !parameters.getParent().getPath().equals(ExecutionPath.rootPath())) {
return;
}
dealException(t);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册