Replace != with equals (#5617)
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
parent
1f79367417
commit
d02ee0af3e
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue