Replace != with equals (#5617)

Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
Xin,Zhang 2020-10-02 15:57:11 +08:00 committed by GitHub
parent 1f79367417
commit d02ee0af3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);