Fixes for some minor checkstyle complaints
This commit is contained in:
parent
ce7866d018
commit
c844501bc5
|
@ -58,8 +58,7 @@ public class CassandraClientInstrumentation extends Instrumenter.Default {
|
||||||
* com.datastax.driver.core.Cluster$Manager.newSession() method is called. The opentracing
|
* com.datastax.driver.core.Cluster$Manager.newSession() method is called. The opentracing
|
||||||
* contribution is a simple wrapper, so we just have to wrap the new session.
|
* contribution is a simple wrapper, so we just have to wrap the new session.
|
||||||
*
|
*
|
||||||
* @param session The fresh session to patch
|
* @param session The fresh session to patch. This session is replaced with new session
|
||||||
* @return A new tracing session
|
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Advice.OnMethodExit(suppress = Throwable.class)
|
@Advice.OnMethodExit(suppress = Throwable.class)
|
||||||
|
|
|
@ -155,12 +155,19 @@ public class TracingAgent {
|
||||||
|
|
||||||
private static ClassLoader getPlatformClassLoader()
|
private static ClassLoader getPlatformClassLoader()
|
||||||
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
||||||
// must invoke ClassLoader.getPlatformClassLoader by reflection to remain compatible with java 7
|
/*
|
||||||
// + 8.
|
Must invoke ClassLoader.getPlatformClassLoader by reflection to remain
|
||||||
|
compatible with java 7 + 8.
|
||||||
|
*/
|
||||||
final Method method = ClassLoader.class.getDeclaredMethod("getPlatformClassLoader");
|
final Method method = ClassLoader.class.getDeclaredMethod("getPlatformClassLoader");
|
||||||
return (ClassLoader) method.invoke(null);
|
return (ClassLoader) method.invoke(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main entry point.
|
||||||
|
*
|
||||||
|
* @param args command line agruments
|
||||||
|
*/
|
||||||
public static void main(final String... args) {
|
public static void main(final String... args) {
|
||||||
try {
|
try {
|
||||||
System.out.println(getAgentVersion());
|
System.out.println(getAgentVersion());
|
||||||
|
@ -184,7 +191,9 @@ public class TracingAgent {
|
||||||
new InputStreamReader(
|
new InputStreamReader(
|
||||||
TracingAgent.class.getResourceAsStream("/dd-java-agent.version"), "UTF-8");
|
TracingAgent.class.getResourceAsStream("/dd-java-agent.version"), "UTF-8");
|
||||||
output = new BufferedReader(input);
|
output = new BufferedReader(input);
|
||||||
for (int c = output.read(); c != -1; c = output.read()) sb.append((char) c);
|
for (int c = output.read(); c != -1; c = output.read()) {
|
||||||
|
sb.append((char) c);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (null != input) {
|
if (null != input) {
|
||||||
input.close();
|
input.close();
|
||||||
|
|
Loading…
Reference in New Issue