Skip to content

Commit 280e023

Browse files
committed
fix: sonar
1 parent e0507e8 commit 280e023

File tree

1 file changed

+3
-4
lines changed
  • arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet

1 file changed

+3
-4
lines changed

arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/SpringUtil.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.springframework.web.util.pattern.PathPattern;
1111

1212
import java.lang.reflect.Method;
13-
import java.util.HashSet;
1413
import java.util.Set;
1514

1615
/**
@@ -23,9 +22,9 @@ public class SpringUtil {
2322

2423
private static Method parseAndCacheMethod = null;
2524

26-
private static ApplicationContext springApplicationContext;
25+
private static ApplicationContext springApplicationContext = null;
2726

28-
private static Set<RequestMappingInfo> springRequestMappings;
27+
private static Set<RequestMappingInfo> springRequestMappings = null;
2928

3029
public static ApplicationContext getApplicationContext(Object servletContext) {
3130
if (springApplicationContext != null) {
@@ -62,7 +61,7 @@ public static String getPatternFromRequestMapping(Object httpServletRequest, Obj
6261
"getMatchingCondition", httpServletRequest.getClass().getInterfaces()[0].getName());
6362
}
6463

65-
Set<PathPattern> patterns = new HashSet<>();
64+
Set<PathPattern> patterns = null;
6665
for (RequestMappingInfo mappingInfo : requestMappingInfos) {
6766
/*
6867
* execute RequestMappingInfo.getMatchingCondition to get matched pattern

0 commit comments

Comments
 (0)