Skip to content

Commit 5197709

Browse files
committed
spotless
1 parent 517f299 commit 5197709

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

  • dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SpringHelper.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ private enum DetectionResult {
1717
}
1818

1919
public static boolean isSpringUsingOnlyMethodParameters(Instrumentation inst) {
20-
DetectionResult detectionResult = isSpringUsingOnlyMethodParametersSpringVersion(inst);
21-
if (detectionResult == DetectionResult.UNKNOWN) {
22-
LOGGER.debug("isSpringUsingOnlyMethodParameters failed for SpringVersion, trying to detect specific class");
23-
// fallback to lookup for specific class
24-
return isSpringUsingOnlyMethodParametersSpecificClass(inst);
25-
}
26-
return detectionResult == DetectionResult.USE_METHOD_PARAMETERS;
20+
DetectionResult detectionResult = isSpringUsingOnlyMethodParametersSpringVersion(inst);
21+
if (detectionResult == DetectionResult.UNKNOWN) {
22+
LOGGER.debug(
23+
"isSpringUsingOnlyMethodParameters failed for SpringVersion, trying to detect specific class");
24+
// fallback to lookup for specific class
25+
return isSpringUsingOnlyMethodParametersSpecificClass(inst);
26+
}
27+
return detectionResult == DetectionResult.USE_METHOD_PARAMETERS;
2728
}
2829

29-
private static DetectionResult isSpringUsingOnlyMethodParametersSpringVersion(Instrumentation inst) {
30+
private static DetectionResult isSpringUsingOnlyMethodParametersSpringVersion(
31+
Instrumentation inst) {
3032
try {
3133
// scan for getting an already loaded class and get the classloader
3234
ClassLoader springClassLoader = null;
@@ -48,7 +50,7 @@ private static DetectionResult isSpringUsingOnlyMethodParametersSpringVersion(In
4850
? DetectionResult.USE_METHOD_PARAMETERS
4951
: DetectionResult.USE_LOCAL_VARS;
5052
} catch (Exception ex) {
51-
LOGGER.debug("isSpringUsingOnlyMethodParametersSpringVersion failed" , ex);
53+
LOGGER.debug("isSpringUsingOnlyMethodParametersSpringVersion failed", ex);
5254
return DetectionResult.UNKNOWN;
5355
}
5456
}
@@ -61,7 +63,8 @@ private static boolean isSpringUsingOnlyMethodParametersSpecificClass(Instrument
6163
continue;
6264
}
6365
if ("org.springframework.web.client.RestClient".equals(clazz.getName())) {
64-
// If this class (coming from Spring web since version 6.1) is found loaded it means Spring
66+
// If this class (coming from Spring web since version 6.1) is found loaded it means
67+
// Spring
6568
// supports only getting parameter names from the MethodParameter attribute
6669
return true;
6770
}

0 commit comments

Comments
 (0)