Bläddra i källkod

Apply consistent formatting to other files

Tyler Benson 7 år sedan
förälder
incheckning
e8dbc34bea
29 ändrade filer med 1238 tillägg och 1237 borttagningar
  1. 32 32
      dd-java-agent-ittests/dd-java-agent-ittests.gradle
  2. 5 7
      dd-java-agent-ittests/src/test/resources/log4j2.properties
  3. 11 11
      dd-java-agent-ittests/src/test/resources/logback.xml
  4. 80 80
      dd-java-agent/dd-java-agent.gradle
  5. 11 11
      dd-java-agent/src/test/resources/logback.xml
  6. 1 1
      dd-trace-annotations/dd-trace-annotations.gradle
  7. 1 1
      dd-trace-examples/async-tracing/async-tracing.gradle
  8. 10 10
      dd-trace-examples/async-tracing/src/main/resources/logback.xml
  9. 11 11
      dd-trace-examples/dropwizard-mongo-client/dropwizard-mongo-client.gradle
  10. 3 3
      dd-trace-examples/spring-boot-jdbc/spring-boot-jdbc.gradle
  11. 1 3
      dd-trace-examples/spring-boot-jdbc/src/main/resources/application.properties
  12. 10 10
      dd-trace-java.gradle
  13. 27 27
      dd-trace/dd-trace.gradle
  14. 16 16
      dd-trace/src/test/groovy/com/datadoghq/trace/SpanFactory.groovy
  15. 89 89
      dd-trace/src/test/groovy/com/datadoghq/trace/writer/DDApiTest.groovy
  16. 11 11
      dd-trace/src/test/resources/logback.xml
  17. 12 12
      gradle/checkstyle.gradle
  18. 2 2
      gradle/codenarc.gradle
  19. 17 17
      gradle/enforcement/checkstyle-api.xml
  20. 14 14
      gradle/enforcement/checkstyle-groovy.xml
  21. 11 6
      gradle/enforcement/checkstyle.xml
  22. 374 374
      gradle/enforcement/codenarc.groovy
  23. 370 370
      gradle/enforcement/codenarcTest.groovy
  24. 3 3
      gradle/enforcement/suppressions.xml
  25. 26 26
      gradle/jacoco.gradle
  26. 27 27
      gradle/java.gradle
  27. 24 24
      gradle/pom.gradle
  28. 35 35
      gradle/publish.gradle
  29. 4 4
      settings.gradle

+ 32 - 32
dd-java-agent-ittests/dd-java-agent-ittests.gradle

@@ -5,44 +5,44 @@ apply from: "${rootDir}/gradle/java.gradle"
 
 description = 'dd-java-agent-ittests'
 dependencies {
-    testCompile project(':dd-java-agent')
-    testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
-    testCompile group: 'junit', name: 'junit', version: '4.12'
-    testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
-    testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
-    testCompile group: 'ch.qos.logback', name: 'logback-classic' , version: '1.2.3'
-    testCompile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
-    testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.1.v20170120'
-    testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.1.v20170120'
-    testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '8.0.41'
-    testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.0.41'
-    testCompile(group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.119') {
-        exclude(module: 'httpclient')
-    }
-    testCompile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
-    testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
-    testCompile(group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.2.0') {
-        exclude(module: 'netty-handler')
-    }
-    testCompile(group: 'org.cassandraunit', name: 'cassandra-unit', version: '3.1.3.2') {
-        exclude(module: 'netty-handler')
-    }
-    testCompile group: 'org.elasticsearch.client', name: 'transport', version: '5.4.1'
-    testCompile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.2'
-    testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
-    testCompile group: 'javax.jms', name: 'javax.jms-api', version: '2.0.1'
-    testCompile group: 'org.apache.activemq.tooling', name: 'activemq-junit', version: '5.14.5'
-    testCompile group: 'org.apache.activemq', name: 'activemq-broker', version: '5.14.5'
+  testCompile project(':dd-java-agent')
+  testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
+  testCompile group: 'junit', name: 'junit', version: '4.12'
+  testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
+  testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
+  testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
+  testCompile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
+  testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.1.v20170120'
+  testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.1.v20170120'
+  testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '8.0.41'
+  testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.0.41'
+  testCompile(group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.119') {
+    exclude(module: 'httpclient')
+  }
+  testCompile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
+  testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
+  testCompile(group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.2.0') {
+    exclude(module: 'netty-handler')
+  }
+  testCompile(group: 'org.cassandraunit', name: 'cassandra-unit', version: '3.1.3.2') {
+    exclude(module: 'netty-handler')
+  }
+  testCompile group: 'org.elasticsearch.client', name: 'transport', version: '5.4.1'
+  testCompile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.2'
+  testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
+  testCompile group: 'javax.jms', name: 'javax.jms-api', version: '2.0.1'
+  testCompile group: 'org.apache.activemq.tooling', name: 'activemq-junit', version: '5.14.5'
+  testCompile group: 'org.apache.activemq', name: 'activemq-broker', version: '5.14.5'
 }
 
 test {
-    jvmArgs "-Ddd.trace.configurationFile=${project.buildDir}/resources/test/dd-trace.yaml"
-    jvmArgs "-javaagent:${project(':dd-java-agent').buildDir}/libs/dd-java-agent-${project.version}-shadow.jar"
-    jvmArgs "-Dorg.jboss.byteman.verbose=true"
+  jvmArgs "-Ddd.trace.configurationFile=${project.buildDir}/resources/test/dd-trace.yaml"
+  jvmArgs "-javaagent:${project(':dd-java-agent').buildDir}/libs/dd-java-agent-${project.version}-shadow.jar"
+  jvmArgs "-Dorg.jboss.byteman.verbose=true"
 }
 
 test.dependsOn project(':dd-java-agent').shadowJar
 
 parent.subprojects.collect { it.tasks.withType(Test) } each {
-    test.shouldRunAfter it
+  test.shouldRunAfter it
 }

+ 5 - 7
dd-java-agent-ittests/src/test/resources/log4j2.properties

@@ -1,7 +1,5 @@
-
-appender.console.type = Console
-appender.console.name = console
-appender.console.layout.type = PatternLayout
-
-rootLogger.level = debug
-rootLogger.appenderRef.console.ref = console
+appender.console.type=Console
+appender.console.name=console
+appender.console.layout.type=PatternLayout
+rootLogger.level=debug
+rootLogger.appenderRef.console.ref=console

+ 11 - 11
dd-java-agent-ittests/src/test/resources/logback.xml

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <layout class="ch.qos.logback.classic.PatternLayout">
-            <Pattern>
-                %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-            </Pattern>
-        </layout>
-    </appender>
+  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+    <layout class="ch.qos.logback.classic.PatternLayout">
+      <Pattern>
+        %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+      </Pattern>
+    </layout>
+  </appender>
 
-    <root level="INFO">
-        <appender-ref ref="console"/>
-    </root>
+  <root level="INFO">
+    <appender-ref ref="console"/>
+  </root>
 
-</configuration>
+</configuration>

+ 80 - 80
dd-java-agent/dd-java-agent.gradle

@@ -1,5 +1,5 @@
 plugins {
-    id "com.github.johnrengelman.shadow" version "2.0.1"
+  id "com.github.johnrengelman.shadow" version "2.0.1"
 }
 
 description = 'dd-java-agent'
@@ -10,105 +10,105 @@ apply from: "${rootDir}/gradle/jacoco.gradle"
 jacocoTestReport.dependsOn ':dd-java-agent-ittests:test'
 
 whitelistedInstructionClasses += whitelistedBranchClasses += [
-        "com.datadoghq.trace.agent.integration.*",
-        'com.datadoghq.trace.agent.AnnotationsTracingAgent',
-        'com.datadoghq.trace.agent.AgentTracerConfig',
-        'com.datadoghq.trace.agent.TraceAnnotationsManager',
-        'com.datadoghq.trace.agent.InstrumentationChecker'
+  "com.datadoghq.trace.agent.integration.*",
+  'com.datadoghq.trace.agent.AnnotationsTracingAgent',
+  'com.datadoghq.trace.agent.AgentTracerConfig',
+  'com.datadoghq.trace.agent.TraceAnnotationsManager',
+  'com.datadoghq.trace.agent.InstrumentationChecker'
 ]
 
 dependencies {
-    compile project(':dd-trace')
-    compile project(':dd-trace-annotations')
+  compile project(':dd-trace')
+  compile project(':dd-trace-annotations')
 
-    compile group: 'io.opentracing.contrib', name: 'opentracing-agent', version: '0.1.0'
-    compile group: 'org.reflections', name: 'reflections', version: '0.9.11'
-    compile group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc3'
+  compile group: 'io.opentracing.contrib', name: 'opentracing-agent', version: '0.1.0'
+  compile group: 'org.reflections', name: 'reflections', version: '0.9.11'
+  compile group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc3'
 
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-web-servlet-filter', version: '0.0.9') {
-        exclude(group: 'org.eclipse.jetty', module: 'jetty-servlet')
-    }
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-mongo-driver', version: '0.0.2') {
-        exclude(group: 'org.mongodb', module: 'mongodb-driver-async')
-        exclude(group: 'org.mongodb', module: 'mongo-java-driver')
-    }
-    compile group: 'io.opentracing.contrib', name: 'opentracing-jdbc', version: '0.0.2'
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-okhttp3', version: '0.0.5') {
-        exclude(group: 'com.squareup.okhttp3', module: 'okhttp')
-    }
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-jms-2', version: '0.0.3') {
-        exclude(group: 'javax.jms', module: 'javax.jms-api')
-    }
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-aws-sdk', version: '0.0.2') {
-        exclude(group: 'com.amazonaws', module: 'aws-java-sdk')
-    }
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-cassandra-driver', version: '0.0.2') {
-        exclude(group: 'com.datastax.cassandra', module: 'cassandra-driver-core')
-    }
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-elasticsearch-client', version: '0.0.2') {
-        exclude(group: 'org.elasticsearch.client', module: 'transport')
-    }
-    compile(group: 'io.opentracing.contrib', name: 'opentracing-apache-httpclient', version: '0.0.2') {
-        exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
-    }
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-web-servlet-filter', version: '0.0.9') {
+    exclude(group: 'org.eclipse.jetty', module: 'jetty-servlet')
+  }
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-mongo-driver', version: '0.0.2') {
+    exclude(group: 'org.mongodb', module: 'mongodb-driver-async')
+    exclude(group: 'org.mongodb', module: 'mongo-java-driver')
+  }
+  compile group: 'io.opentracing.contrib', name: 'opentracing-jdbc', version: '0.0.2'
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-okhttp3', version: '0.0.5') {
+    exclude(group: 'com.squareup.okhttp3', module: 'okhttp')
+  }
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-jms-2', version: '0.0.3') {
+    exclude(group: 'javax.jms', module: 'javax.jms-api')
+  }
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-aws-sdk', version: '0.0.2') {
+    exclude(group: 'com.amazonaws', module: 'aws-java-sdk')
+  }
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-cassandra-driver', version: '0.0.2') {
+    exclude(group: 'com.datastax.cassandra', module: 'cassandra-driver-core')
+  }
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-elasticsearch-client', version: '0.0.2') {
+    exclude(group: 'org.elasticsearch.client', module: 'transport')
+  }
+  compile(group: 'io.opentracing.contrib', name: 'opentracing-apache-httpclient', version: '0.0.2') {
+    exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
+  }
 
-    testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
-    testCompile group: 'junit', name: 'junit', version: '4.12'
-    testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
-    testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
-    testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
-    compileOnly group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.3.6.v20151106'
-    compileOnly group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.0.M1'
-    compileOnly group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
-    compileOnly group: 'org.mongodb', name: 'mongodb-driver-async', version: '3.4.2'
-    compileOnly group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
-    compileOnly group: 'javax.jms', name: 'javax.jms-api', version: '2.0.1'
-    compileOnly group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.119'
-    compileOnly group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.2.0'
-    compileOnly group: 'org.elasticsearch.client', name: 'transport', version: '5.4.1'
-    compileOnly group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
+  testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
+  testCompile group: 'junit', name: 'junit', version: '4.12'
+  testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
+  testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
+  testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
+  compileOnly group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.3.6.v20151106'
+  compileOnly group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.0.M1'
+  compileOnly group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
+  compileOnly group: 'org.mongodb', name: 'mongodb-driver-async', version: '3.4.2'
+  compileOnly group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
+  compileOnly group: 'javax.jms', name: 'javax.jms-api', version: '2.0.1'
+  compileOnly group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.119'
+  compileOnly group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.2.0'
+  compileOnly group: 'org.elasticsearch.client', name: 'transport', version: '5.4.1'
+  compileOnly group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
 }
 
 jar {
-    manifest {
-        attributes(
-                // I don't think we want to define this since we can't really load after startup:
-                //"Agent-Class": "com.datadoghq.trace.agent.AnnotationsTracingAgent",
-                "Premain-Class": "com.datadoghq.trace.agent.AnnotationsTracingAgent",
-                "Can-Redefine-Classes": true,
-                "Can-Retransform-Classes": true,
-                // It is dangerous putting everything on the bootstrap classpath,
-                // but kept for consistency with previous versions.
-                "Boot-Class-Path": "./${jar.archiveName}.jar"
-        )
-    }
+  manifest {
+    attributes(
+      // I don't think we want to define this since we can't really load after startup:
+      //"Agent-Class": "com.datadoghq.trace.agent.AnnotationsTracingAgent",
+      "Premain-Class": "com.datadoghq.trace.agent.AnnotationsTracingAgent",
+      "Can-Redefine-Classes": true,
+      "Can-Retransform-Classes": true,
+      // It is dangerous putting everything on the bootstrap classpath,
+      // but kept for consistency with previous versions.
+      "Boot-Class-Path": "./${jar.archiveName}.jar"
+    )
+  }
 }
 
 shadowJar {
-    append 'otarules.btm'
+  append 'otarules.btm'
 
-    classifier 'shadow'
+  classifier 'shadow'
 
 //    mergeServiceFiles()
 
-    // Various tests fail when these are uncommented:
+  // Various tests fail when these are uncommented:
 //    relocate 'ch.qos.logback', 'dd.deps.ch.qos.logback'
 //    relocate 'com.google', 'dd.deps.com.google'
 //    relocate 'org.jboss.byteman', 'dd.deps.org.jboss.byteman'
 //    relocate 'org.slf4j', 'dd.deps.org.slf4j'
 
-    relocate 'com.fasterxml', 'dd.deps.com.fasterxml'
-    relocate 'javassist', 'dd.deps.javassist'
-    relocate 'org.reflections', 'dd.deps.org.reflections'
-    relocate 'org.yaml', 'dd.deps.org.yaml'
+  relocate 'com.fasterxml', 'dd.deps.com.fasterxml'
+  relocate 'javassist', 'dd.deps.javassist'
+  relocate 'org.reflections', 'dd.deps.org.reflections'
+  relocate 'org.yaml', 'dd.deps.org.yaml'
 
-    //Exclude Java 9 compiled classes:
-    exclude 'org/jboss/byteman/agent/JigsawAccessEnablerGenerator.class'
-    exclude 'org/jboss/byteman/agent/JigsawAccessManager$1.class'
-    exclude 'org/jboss/byteman/agent/JigsawAccessManager.class'
-    exclude 'org/jboss/byteman/layer/LayerFactory.class'
-    exclude 'org/jboss/byteman/layer/LayerModuleFinder$1.class'
-    exclude 'org/jboss/byteman/layer/LayerModuleFinder.class'
-    exclude 'org/jboss/byteman/layer/LayerModuleReader.class'
-    exclude 'org/jboss/byteman/layer/LayerModuleReference.class'
+  //Exclude Java 9 compiled classes:
+  exclude 'org/jboss/byteman/agent/JigsawAccessEnablerGenerator.class'
+  exclude 'org/jboss/byteman/agent/JigsawAccessManager$1.class'
+  exclude 'org/jboss/byteman/agent/JigsawAccessManager.class'
+  exclude 'org/jboss/byteman/layer/LayerFactory.class'
+  exclude 'org/jboss/byteman/layer/LayerModuleFinder$1.class'
+  exclude 'org/jboss/byteman/layer/LayerModuleFinder.class'
+  exclude 'org/jboss/byteman/layer/LayerModuleReader.class'
+  exclude 'org/jboss/byteman/layer/LayerModuleReference.class'
 }

+ 11 - 11
dd-java-agent/src/test/resources/logback.xml

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <layout class="ch.qos.logback.classic.PatternLayout">
-            <Pattern>
-                %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-            </Pattern>
-        </layout>
-    </appender>
+  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+    <layout class="ch.qos.logback.classic.PatternLayout">
+      <Pattern>
+        %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+      </Pattern>
+    </layout>
+  </appender>
 
-    <root level="INFO">
-        <appender-ref ref="console"/>
-    </root>
+  <root level="INFO">
+    <appender-ref ref="console"/>
+  </root>
 
-</configuration>
+</configuration>

+ 1 - 1
dd-trace-annotations/dd-trace-annotations.gradle

@@ -4,5 +4,5 @@ apply from: "${rootDir}/gradle/jacoco.gradle"
 
 description = 'dd-trace-annotations'
 dependencies {
-    testCompile group: 'junit', name: 'junit', version: '3.8.1'
+  testCompile group: 'junit', name: 'junit', version: '3.8.1'
 }

+ 1 - 1
dd-trace-examples/async-tracing/async-tracing.gradle

@@ -9,5 +9,5 @@ dependencies {
   compile project(':dd-trace')
   compile group: 'io.opentracing.contrib', name: 'opentracing-spanmanager', version: '0.0.5'
   compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
-  compile group:'io.reactivex.rxjava2', name:'rxjava', version:'2.1.1'
+  compile group: 'io.reactivex.rxjava2', name: 'rxjava', version: '2.1.1'
 }

+ 10 - 10
dd-trace-examples/async-tracing/src/main/resources/logback.xml

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <layout class="ch.qos.logback.classic.PatternLayout">
-            <Pattern>
-                %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-            </Pattern>
-        </layout>
-    </appender>
+  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+    <layout class="ch.qos.logback.classic.PatternLayout">
+      <Pattern>
+        %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+      </Pattern>
+    </layout>
+  </appender>
 
-    <root level="debug">
-        <appender-ref ref="console"/>
-    </root>
+  <root level="debug">
+    <appender-ref ref="console"/>
+  </root>
 
 </configuration>

+ 11 - 11
dd-trace-examples/dropwizard-mongo-client/dropwizard-mongo-client.gradle

@@ -1,5 +1,5 @@
 plugins {
-    id "com.github.johnrengelman.shadow" version "2.0.1"
+  id "com.github.johnrengelman.shadow" version "2.0.1"
 }
 
 apply from: "${rootDir}/gradle/java.gradle"
@@ -9,22 +9,22 @@ version = 'demo'
 description = 'dropwizard-mongo-client'
 
 dependencies {
-    compile project(':dd-trace-annotations')
+  compile project(':dd-trace-annotations')
 
-    compile group: 'io.opentracing', name: 'opentracing-api', version: '0.+'
-    compile group: 'io.opentracing', name: 'opentracing-util', version: '0.+'
+  compile group: 'io.opentracing', name: 'opentracing-api', version: '0.+'
+  compile group: 'io.opentracing', name: 'opentracing-util', version: '0.+'
 
-    compile group: 'io.dropwizard', name: 'dropwizard-core', version: '0.9.2'
-    compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
-    compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.7.0'
+  compile group: 'io.dropwizard', name: 'dropwizard-core', version: '0.9.2'
+  compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
+  compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.7.0'
 }
 
 jar {
-    manifest {
-        attributes 'Main-Class': 'com.example.helloworld.HelloWorldApplication'
-    }
+  manifest {
+    attributes 'Main-Class': 'com.example.helloworld.HelloWorldApplication'
+  }
 }
 
 shadowJar {
-    mergeServiceFiles()
+  mergeServiceFiles()
 }

+ 3 - 3
dd-trace-examples/spring-boot-jdbc/spring-boot-jdbc.gradle

@@ -5,7 +5,7 @@ version = 'demo'
 description = 'spring-boot-jdbc'
 
 dependencies {
-    compile group: 'com.h2database', name: 'h2', version: '1.4.196'
-    compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.3.RELEASE'
-    compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '1.5.3.RELEASE'
+  compile group: 'com.h2database', name: 'h2', version: '1.4.196'
+  compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.3.RELEASE'
+  compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '1.5.3.RELEASE'
 }

+ 1 - 3
dd-trace-examples/spring-boot-jdbc/src/main/resources/application.properties

@@ -1,8 +1,6 @@
 spring.datasource.driver-class-name=io.opentracing.contrib.jdbc.TracingDriver
 spring.datasource.url=jdbc:tracing:h2:mem:spring-test
-
 #spring.datasource.driver-class-name=org.h2.Driver
 #spring.datasource.url=jdbc:h2:mem:spring-test
-
 logging.level.root=INFO
-logging.level.com.datadoghq.trace=DEBUG
+logging.level.com.datadoghq.trace=DEBUG

+ 10 - 10
dd-trace-java.gradle

@@ -1,21 +1,21 @@
 buildscript {
-    repositories {
-        jcenter()
-    }
-    dependencies {
-        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.18"
-    }
+  repositories {
+    jcenter()
+  }
+  dependencies {
+    classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.18"
+  }
 }
 
 plugins {
-    id 'com.github.sherter.google-java-format' version '0.6'
+  id 'com.github.sherter.google-java-format' version '0.6'
 }
 
 allprojects {
-    group = 'com.datadoghq'
-    version = '0.1.2-SNAPSHOT'
+  group = 'com.datadoghq'
+  version = '0.1.2-SNAPSHOT'
 }
 
 repositories {
-    jcenter()
+  jcenter()
 }

+ 27 - 27
dd-trace/dd-trace.gradle

@@ -1,6 +1,6 @@
 plugins {
-    id 'groovy'
-    id "com.github.johnrengelman.shadow" version "2.0.1"
+  id 'groovy'
+  id "com.github.johnrengelman.shadow" version "2.0.1"
 }
 
 description = 'dd-trace'
@@ -11,38 +11,38 @@ apply from: "${rootDir}/gradle/jacoco.gradle"
 minimumBranchCoverage = 0.3
 minimumInstructionCoverage = 0.5
 whitelistedInstructionClasses += whitelistedBranchClasses += [
-        "com.datadoghq.trace.integration.*",
-        'com.datadoghq.trace.writer.ListWriter',
-        'com.datadoghq.trace.DDTags'
+  "com.datadoghq.trace.integration.*",
+  'com.datadoghq.trace.writer.ListWriter',
+  'com.datadoghq.trace.DDTags'
 ]
 
 dependencies {
-    compile group: 'io.opentracing', name: 'opentracing-api', version: '0.30.0'
-    compile group: 'io.opentracing', name: 'opentracing-noop', version: '0.30.0'
-    compile group: 'io.opentracing', name: 'opentracing-util', version: '0.30.0'
-    compile group: 'io.opentracing.contrib', name: 'opentracing-tracerresolver', version: '0.1.0'
-    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8'
-    compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.8.8'
-    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
-    compile group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc3'
-    testCompile group: 'junit', name: 'junit', version: '4.12'
-    testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
-    testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
-    testCompile group: 'ch.qos.logback', name: 'logback-classic' , version: '1.2.3'
-    testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4'
-    testCompile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.4'
-    testCompile group: 'io.ratpack', name: 'ratpack-groovy-test', version: '1.4.6'
+  compile group: 'io.opentracing', name: 'opentracing-api', version: '0.30.0'
+  compile group: 'io.opentracing', name: 'opentracing-noop', version: '0.30.0'
+  compile group: 'io.opentracing', name: 'opentracing-util', version: '0.30.0'
+  compile group: 'io.opentracing.contrib', name: 'opentracing-tracerresolver', version: '0.1.0'
+  compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8'
+  compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.8.8'
+  compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
+  compile group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc3'
+  testCompile group: 'junit', name: 'junit', version: '4.12'
+  testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
+  testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
+  testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
+  testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4'
+  testCompile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.4'
+  testCompile group: 'io.ratpack', name: 'ratpack-groovy-test', version: '1.4.6'
 }
 
 shadowJar {
 //    mergeServiceFiles()
 
-    classifier 'shadow'
+  classifier 'shadow'
 
-    relocate 'com.fasterxml', 'dd.deps.com.fasterxml'
-    relocate 'com.google', 'dd.deps.com.google'
-    relocate 'javassist', 'dd.deps.javassist'
-    relocate 'org.jboss.byteman', 'dd.deps.org.jboss.byteman'
-    relocate 'org.reflections', 'dd.deps.org.reflections'
-    relocate 'org.yaml', 'dd.deps.org.yaml'
+  relocate 'com.fasterxml', 'dd.deps.com.fasterxml'
+  relocate 'com.google', 'dd.deps.com.google'
+  relocate 'javassist', 'dd.deps.javassist'
+  relocate 'org.jboss.byteman', 'dd.deps.org.jboss.byteman'
+  relocate 'org.reflections', 'dd.deps.org.reflections'
+  relocate 'org.yaml', 'dd.deps.org.yaml'
 }

+ 16 - 16
dd-trace/src/test/groovy/com/datadoghq/trace/SpanFactory.groovy

@@ -1,20 +1,20 @@
 package com.datadoghq.trace
 
 class SpanFactory {
-    static newSpanOf(long timestampMicro) {
-        def context = new DDSpanContext(
-                1L,
-                1L,
-                0L,
-                "fakeService",
-                "fakeOperation",
-                "fakeResource",
-                Collections.emptyMap(),
-                false,
-                "fakeType",
-                Collections.emptyMap(),
-                null,
-                null)
-        return new DDSpan(timestampMicro, context)
-    }
+  static newSpanOf(long timestampMicro) {
+    def context = new DDSpanContext(
+      1L,
+      1L,
+      0L,
+      "fakeService",
+      "fakeOperation",
+      "fakeResource",
+      Collections.emptyMap(),
+      false,
+      "fakeType",
+      Collections.emptyMap(),
+      null,
+      null)
+    return new DDSpan(timestampMicro, context)
+  }
 }

+ 89 - 89
dd-trace/src/test/groovy/com/datadoghq/trace/writer/DDApiTest.groovy

@@ -13,107 +13,107 @@ import static ratpack.groovy.test.embed.GroovyEmbeddedApp.ratpack
 import static ratpack.http.MediaType.APPLICATION_JSON
 
 class DDApiTest extends Specification {
-    static mapper = new ObjectMapper()
+  static mapper = new ObjectMapper()
 
-    def "sending an empty list of traces returns no errors"() {
-        setup:
-        def agent = ratpack {
-            handlers {
-                put("v0.3/traces") {
-                    response.status(200).send()
-                }
-            }
+  def "sending an empty list of traces returns no errors"() {
+    setup:
+    def agent = ratpack {
+      handlers {
+        put("v0.3/traces") {
+          response.status(200).send()
         }
-        def client = new DDApi("localhost", agent.address.port)
+      }
+    }
+    def client = new DDApi("localhost", agent.address.port)
 
-        expect:
-        client.sendTraces([])
+    expect:
+    client.sendTraces([])
 
-        cleanup:
-        agent.close()
-    }
+    cleanup:
+    agent.close()
+  }
 
-    def "non-200 response results in false returned"() {
-        setup:
-        def agent = ratpack {
-            handlers {
-                put("v0.3/traces") {
-                    response.status(404).send()
-                }
-            }
+  def "non-200 response results in false returned"() {
+    setup:
+    def agent = ratpack {
+      handlers {
+        put("v0.3/traces") {
+          response.status(404).send()
         }
-        def client = new DDApi("localhost", agent.address.port)
+      }
+    }
+    def client = new DDApi("localhost", agent.address.port)
 
-        expect:
-        !client.sendTraces([])
+    expect:
+    !client.sendTraces([])
 
-        cleanup:
-        agent.close()
-    }
+    cleanup:
+    agent.close()
+  }
 
-    def "content is sent as JSON"() {
-        setup:
-        def requestContentType = new AtomicReference<MediaType>()
-        def requestHeaders = new AtomicReference<Headers>()
-        def requestBody = new AtomicReference<String>()
-        def agent = ratpack {
-            handlers {
-                put("v0.3/traces") {
-                    requestContentType.set(request.contentType)
-                    requestHeaders.set(request.headers)
-                    request.body.then {
-                        requestBody.set(it.text)
-                        response.send()
-                    }
-                }
-            }
+  def "content is sent as JSON"() {
+    setup:
+    def requestContentType = new AtomicReference<MediaType>()
+    def requestHeaders = new AtomicReference<Headers>()
+    def requestBody = new AtomicReference<String>()
+    def agent = ratpack {
+      handlers {
+        put("v0.3/traces") {
+          requestContentType.set(request.contentType)
+          requestHeaders.set(request.headers)
+          request.body.then {
+            requestBody.set(it.text)
+            response.send()
+          }
         }
-        def client = new DDApi("localhost", agent.address.port)
+      }
+    }
+    def client = new DDApi("localhost", agent.address.port)
 
-        expect:
-        client.sendTraces(traces)
-        requestContentType.get().type == APPLICATION_JSON
-        requestHeaders.get().get("Datadog-Meta-Lang") == "java"
-        requestHeaders.get().get("Datadog-Meta-Lang-Version") == System.getProperty("java.version", "unknown")
-        requestHeaders.get().get("Datadog-Meta-Tracer-Version") == "unknown"
-        convert(requestBody.get()) == expectedRequestBody
+    expect:
+    client.sendTraces(traces)
+    requestContentType.get().type == APPLICATION_JSON
+    requestHeaders.get().get("Datadog-Meta-Lang") == "java"
+    requestHeaders.get().get("Datadog-Meta-Lang-Version") == System.getProperty("java.version", "unknown")
+    requestHeaders.get().get("Datadog-Meta-Tracer-Version") == "unknown"
+    convert(requestBody.get()) == expectedRequestBody
 
-        cleanup:
-        agent.close()
+    cleanup:
+    agent.close()
 
-        // Populate thread info dynamically as it is different when run via gradle vs idea.
-        where:
-        traces                        | expectedRequestBody
-        []                            | []
-        [SpanFactory.newSpanOf(1L)]   | [new TreeMap<>([
-            "duration":0,
-            "error":0,
-            "meta":["thread-name":Thread.currentThread().getName(),"thread-id":"${Thread.currentThread().id}"],
-            "name":"fakeOperation",
-            "parent_id":0,
-            "resource":"fakeResource",
-            "service":"fakeService",
-            "span_id":1,
-            "start":1000,
-            "trace_id":1,
-            "type":"fakeType"
-        ])]
-        [SpanFactory.newSpanOf(100L)] | [new TreeMap<>([
-            "duration":0,
-            "error":0,
-            "meta":["thread-name":Thread.currentThread().getName(),"thread-id":"${Thread.currentThread().id}"],
-            "name":"fakeOperation",
-            "parent_id":0,
-            "resource":"fakeResource",
-            "service":"fakeService",
-            "span_id":1,
-            "start":100000,
-            "trace_id":1,
-            "type":"fakeType"
-        ])]
-    }
+    // Populate thread info dynamically as it is different when run via gradle vs idea.
+    where:
+    traces                        | expectedRequestBody
+    []                            | []
+    [SpanFactory.newSpanOf(1L)]   | [new TreeMap<>([
+      "duration" : 0,
+      "error"    : 0,
+      "meta"     : ["thread-name": Thread.currentThread().getName(), "thread-id": "${Thread.currentThread().id}"],
+      "name"     : "fakeOperation",
+      "parent_id": 0,
+      "resource" : "fakeResource",
+      "service"  : "fakeService",
+      "span_id"  : 1,
+      "start"    : 1000,
+      "trace_id" : 1,
+      "type"     : "fakeType"
+    ])]
+    [SpanFactory.newSpanOf(100L)] | [new TreeMap<>([
+      "duration" : 0,
+      "error"    : 0,
+      "meta"     : ["thread-name": Thread.currentThread().getName(), "thread-id": "${Thread.currentThread().id}"],
+      "name"     : "fakeOperation",
+      "parent_id": 0,
+      "resource" : "fakeResource",
+      "service"  : "fakeService",
+      "span_id"  : 1,
+      "start"    : 100000,
+      "trace_id" : 1,
+      "type"     : "fakeType"
+    ])]
+  }
 
-    static List<TreeMap<String, Object>> convert(String json) {
-        return mapper.readValue(json, new TypeReference<List<TreeMap<String, Object>>>() {})
-    }
+  static List<TreeMap<String, Object>> convert(String json) {
+    return mapper.readValue(json, new TypeReference<List<TreeMap<String, Object>>>() {})
+  }
 }

+ 11 - 11
dd-trace/src/test/resources/logback.xml

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
 
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <layout class="ch.qos.logback.classic.PatternLayout">
-            <Pattern>
-                %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-            </Pattern>
-        </layout>
-    </appender>
+  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+    <layout class="ch.qos.logback.classic.PatternLayout">
+      <Pattern>
+        %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+      </Pattern>
+    </layout>
+  </appender>
 
-    <root level="info">
-        <appender-ref ref="console"/>
-    </root>
+  <root level="info">
+    <appender-ref ref="console"/>
+  </root>
 
-</configuration>
+</configuration>

+ 12 - 12
gradle/checkstyle.gradle

@@ -17,26 +17,26 @@
 apply plugin: 'checkstyle'
 
 dependencies {
-    checkstyle 'com.puppycrawl.tools:checkstyle:8.0'
+  checkstyle 'com.puppycrawl.tools:checkstyle:8.0'
 }
 
 def checkstyleConfigDir = new File(buildscript.sourceFile.parentFile, 'enforcement')
 
 checkstyle {
-    configFile = new File(checkstyleConfigDir, "checkstyle.xml")
-    configProperties.checkstyleConfigDir = checkstyleConfigDir
-    maxWarnings = 500
+  configFile = new File(checkstyleConfigDir, "checkstyle.xml")
+  configProperties.checkstyleConfigDir = checkstyleConfigDir
+  maxWarnings = 500
 }
 
 plugins.withType(GroovyBasePlugin) {
-    sourceSets.all { sourceSet ->
-        task "${sourceSet.getTaskName('checkstyle', 'groovy')}"(type: Checkstyle) {
-            configFile = new File(checkstyleConfigDir, "checkstyle-groovy.xml")
-            source sourceSet.allGroovy
-            classpath = sourceSet.compileClasspath
-            reports.xml.destination new File(checkstyle.reportsDir, "${sourceSet.name}-groovy.xml")
-        }
+  sourceSets.all { sourceSet ->
+    task "${sourceSet.getTaskName('checkstyle', 'groovy')}"(type: Checkstyle) {
+      configFile = new File(checkstyleConfigDir, "checkstyle-groovy.xml")
+      source sourceSet.allGroovy
+      classpath = sourceSet.compileClasspath
+      reports.xml.destination new File(checkstyle.reportsDir, "${sourceSet.name}-groovy.xml")
     }
+  }
 }
 
 def checkstyleTasks = tasks.withType(Checkstyle)
@@ -46,7 +46,7 @@ task checkstyle(dependsOn: checkstyleTasks)
 check.dependsOn checkstyleTasks
 
 tasks.withType(Test) {
-    mustRunAfter checkstyleTasks
+  mustRunAfter checkstyleTasks
 }
 
 apply plugin: 'com.github.sherter.google-java-format'

+ 2 - 2
gradle/codenarc.gradle

@@ -1,11 +1,11 @@
 apply plugin: "codenarc"
 
 dependencies {
-    codenarc "org.codenarc:CodeNarc:0.27.0"
+  codenarc "org.codenarc:CodeNarc:0.27.0"
 }
 
 codenarc {
-    configFile rootProject.file('gradle/enforcement/codenarc.groovy')
+  configFile rootProject.file('gradle/enforcement/codenarc.groovy')
 }
 
 //codenarcTest {

+ 17 - 17
gradle/enforcement/checkstyle-api.xml

@@ -14,26 +14,26 @@
   ~ limitations under the License.
   -->
 <!DOCTYPE module PUBLIC
-        "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
-        "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+  "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+  "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
 <module name="Checker">
-    <module name="SuppressionFilter">
-        <property name="file" value="${checkstyleConfigDir}/suppressions.xml"/>
-    </module>
-    <module name="JavadocPackage"/>
-
-    <module name="TreeWalker">
-        <module name="JavadocStyle">
-            <property name="checkEmptyJavadoc" value="true"/>
-        </module>
+  <module name="SuppressionFilter">
+    <property name="file" value="${checkstyleConfigDir}/suppressions.xml"/>
+  </module>
+  <module name="JavadocPackage"/>
 
-        <module name="JavadocType">
-            <property name="scope" value="package"/>
-        </module>
+  <module name="TreeWalker">
+    <module name="JavadocStyle">
+      <property name="checkEmptyJavadoc" value="true"/>
+    </module>
 
-        <module name="JavadocMethod">
-            <property name="scope" value="package"/>
-        </module>
+    <module name="JavadocType">
+      <property name="scope" value="package"/>
+    </module>
 
+    <module name="JavadocMethod">
+      <property name="scope" value="package"/>
     </module>
+
+  </module>
 </module>

+ 14 - 14
gradle/enforcement/checkstyle-groovy.xml

@@ -14,19 +14,19 @@
   ~ limitations under the License.
   -->
 <!DOCTYPE module PUBLIC
-        "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
-        "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+  "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+  "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
 <module name="Checker">
-    <module name="SuppressionFilter">
-        <property name="file" value="${checkstyleConfigDir}/suppressions.xml"/>
-    </module>
-    <!--<module name="RegexpHeader">-->
-        <!--<property name="headerFile" value="${checkstyleConfigDir}/required-header.txt"/>-->
-    <!--</module>-->
-    <module name="RegexpSingleline">
-        <property name="format" value="File \| Settings \| File Templates"/>
-    </module>
-    <module name="RegexpSingleline">
-        <property name="format" value="Created with IntelliJ IDEA"/>
-    </module>
+  <module name="SuppressionFilter">
+    <property name="file" value="${checkstyleConfigDir}/suppressions.xml"/>
+  </module>
+  <!--<module name="RegexpHeader">-->
+  <!--<property name="headerFile" value="${checkstyleConfigDir}/required-header.txt"/>-->
+  <!--</module>-->
+  <module name="RegexpSingleline">
+    <property name="format" value="File \| Settings \| File Templates"/>
+  </module>
+  <module name="RegexpSingleline">
+    <property name="format" value="Created with IntelliJ IDEA"/>
+  </module>
 </module>

+ 11 - 6
gradle/enforcement/checkstyle.xml

@@ -15,7 +15,7 @@
     Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
  -->
 
-<module name = "Checker">
+<module name="Checker">
   <property name="charset" value="UTF-8"/>
 
   <property name="severity" value="warning"/>
@@ -32,7 +32,8 @@
     <module name="IllegalTokenText">
       <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
       <property name="format" value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
-      <property name="message" value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
+      <property name="message"
+                value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
     </module>
     <module name="AvoidEscapedUnicodeCharacters">
       <property name="allowEscapesForControlCharacters" value="true"/>
@@ -56,12 +57,14 @@
     </module>
     <module name="RightCurly">
       <property name="id" value="RightCurlySame"/>
-      <property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
+      <property name="tokens"
+                value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
     </module>
     <module name="RightCurly">
       <property name="id" value="RightCurlyAlone"/>
       <property name="option" value="alone"/>
-      <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
+      <property name="tokens"
+                value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
     </module>
     <module name="WhitespaceAround">
       <property name="allowEmptyConstructors" value="true"/>
@@ -189,7 +192,8 @@
     <module name="ParenPad"/>
     <module name="OperatorWrap">
       <property name="option" value="NL"/>
-      <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
+      <property name="tokens"
+                value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
     </module>
     <module name="AnnotationLocation">
       <property name="id" value="AnnotationLocationMostCases"/>
@@ -203,7 +207,8 @@
     <module name="NonEmptyAtclauseDescription"/>
     <module name="JavadocTagContinuationIndentation"/>
     <module name="SummaryJavadoc">
-      <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
+      <property name="forbiddenSummaryFragments"
+                value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
     </module>
     <module name="JavadocParagraph"/>
     <module name="AtclauseOrder">

+ 374 - 374
gradle/enforcement/codenarc.groovy

@@ -15,413 +15,413 @@
  */
 
 ruleset {
-    // rulesets/basic.xml
-    /*
-    AssertWithinFinallyBlock
-    AssignmentInConditional
-    BigDecimalInstantiation
-    BitwiseOperatorInConditional
-    BooleanGetBoolean
-    BrokenNullCheck
-    BrokenOddnessCheck
-    ClassForName
-    ComparisonOfTwoConstants
-    ComparisonWithSelf
-    ConstantAssertExpression
-    ConstantIfExpression
-    ConstantTernaryExpression
-    DeadCode
-    DoubleNegative
-    DuplicateCaseStatement
-    DuplicateMapKey
-    DuplicateSetValue
-    EmptyCatchBlock
-    EmptyClass
-    EmptyElseBlock
-    EmptyFinallyBlock
-    EmptyForStatement
-    EmptyIfStatement
-    EmptyInstanceInitializer
-    EmptyMethod
-    EmptyStaticInitializer
-    EmptySwitchStatement
-    EmptySynchronizedStatement
-    EmptyTryBlock
-    EmptyWhileStatement
-    EqualsAndHashCode
-    EqualsOverloaded
-    ExplicitGarbageCollection
-    ForLoopShouldBeWhileLoop
-    HardCodedWindowsFileSeparator
-    HardCodedWindowsRootDirectory
-    IntegerGetInteger
-    RandomDoubleCoercedToZero
-    RemoveAllOnSelf
-    ReturnFromFinallyBlock
-    ThrowExceptionFromFinallyBlock
-    */
+  // rulesets/basic.xml
+  /*
+  AssertWithinFinallyBlock
+  AssignmentInConditional
+  BigDecimalInstantiation
+  BitwiseOperatorInConditional
+  BooleanGetBoolean
+  BrokenNullCheck
+  BrokenOddnessCheck
+  ClassForName
+  ComparisonOfTwoConstants
+  ComparisonWithSelf
+  ConstantAssertExpression
+  ConstantIfExpression
+  ConstantTernaryExpression
+  DeadCode
+  DoubleNegative
+  DuplicateCaseStatement
+  DuplicateMapKey
+  DuplicateSetValue
+  EmptyCatchBlock
+  EmptyClass
+  EmptyElseBlock
+  EmptyFinallyBlock
+  EmptyForStatement
+  EmptyIfStatement
+  EmptyInstanceInitializer
+  EmptyMethod
+  EmptyStaticInitializer
+  EmptySwitchStatement
+  EmptySynchronizedStatement
+  EmptyTryBlock
+  EmptyWhileStatement
+  EqualsAndHashCode
+  EqualsOverloaded
+  ExplicitGarbageCollection
+  ForLoopShouldBeWhileLoop
+  HardCodedWindowsFileSeparator
+  HardCodedWindowsRootDirectory
+  IntegerGetInteger
+  RandomDoubleCoercedToZero
+  RemoveAllOnSelf
+  ReturnFromFinallyBlock
+  ThrowExceptionFromFinallyBlock
+  */
 
-    // rulesets/braces.xml
-    ElseBlockBraces
-    ForStatementBraces
-    IfStatementBraces
-    WhileStatementBraces
+  // rulesets/braces.xml
+  ElseBlockBraces
+  ForStatementBraces
+  IfStatementBraces
+  WhileStatementBraces
 
-    // rulesets/concurrency.xml
-    /*
-    BusyWait
-    DoubleCheckedLocking
-    InconsistentPropertyLocking
-    InconsistentPropertySynchronization
-    NestedSynchronization
-    StaticCalendarField
-    StaticConnection
-    StaticDateFormatField
-    StaticMatcherField
-    StaticSimpleDateFormatField
-    SynchronizedMethod
-    SynchronizedOnBoxedPrimitive
-    SynchronizedOnGetClass
-    SynchronizedOnReentrantLock
-    SynchronizedOnString
-    SynchronizedOnThis
-    SynchronizedReadObjectMethod
-    SystemRunFinalizersOnExit
-    ThisReferenceEscapesConstructor
-    ThreadGroup
-    ThreadLocalNotStaticFinal
-    ThreadYield
-    UseOfNotifyMethod
-    VolatileArrayField
-    VolatileLongOrDoubleField
-    WaitOutsideOfWhileLoop
-    */
+  // rulesets/concurrency.xml
+  /*
+  BusyWait
+  DoubleCheckedLocking
+  InconsistentPropertyLocking
+  InconsistentPropertySynchronization
+  NestedSynchronization
+  StaticCalendarField
+  StaticConnection
+  StaticDateFormatField
+  StaticMatcherField
+  StaticSimpleDateFormatField
+  SynchronizedMethod
+  SynchronizedOnBoxedPrimitive
+  SynchronizedOnGetClass
+  SynchronizedOnReentrantLock
+  SynchronizedOnString
+  SynchronizedOnThis
+  SynchronizedReadObjectMethod
+  SystemRunFinalizersOnExit
+  ThisReferenceEscapesConstructor
+  ThreadGroup
+  ThreadLocalNotStaticFinal
+  ThreadYield
+  UseOfNotifyMethod
+  VolatileArrayField
+  VolatileLongOrDoubleField
+  WaitOutsideOfWhileLoop
+  */
 
-    // rulesets/convention.xml
-    /*
-    ConfusingTernary
-    CouldBeElvis
-    HashtableIsObsolete
-    IfStatementCouldBeTernary
-    InvertedIfElse
-    LongLiteralWithLowerCaseL
-    ParameterReassignment
-    TernaryCouldBeElvis
-    VectorIsObsolete
-    */
+  // rulesets/convention.xml
+  /*
+  ConfusingTernary
+  CouldBeElvis
+  HashtableIsObsolete
+  IfStatementCouldBeTernary
+  InvertedIfElse
+  LongLiteralWithLowerCaseL
+  ParameterReassignment
+  TernaryCouldBeElvis
+  VectorIsObsolete
+  */
 
-    // rulesets/design.xml
-    /*
-    AbstractClassWithPublicConstructor
-    AbstractClassWithoutAbstractMethod
-    BooleanMethodReturnsNull
-    BuilderMethodWithSideEffects
-    CloneableWithoutClone
-    CloseWithoutCloseable
-    CompareToWithoutComparable
-    ConstantsOnlyInterface
-    EmptyMethodInAbstractClass
-    FinalClassWithProtectedMember
-    ImplementationAsType
-    LocaleSetDefault
-    PrivateFieldCouldBeFinal
-    PublicInstanceField
-    ReturnsNullInsteadOfEmptyArray
-    ReturnsNullInsteadOfEmptyCollection
-    SimpleDateFormatMissingLocale
-    StatelessSingleton
-    */
+  // rulesets/design.xml
+  /*
+  AbstractClassWithPublicConstructor
+  AbstractClassWithoutAbstractMethod
+  BooleanMethodReturnsNull
+  BuilderMethodWithSideEffects
+  CloneableWithoutClone
+  CloseWithoutCloseable
+  CompareToWithoutComparable
+  ConstantsOnlyInterface
+  EmptyMethodInAbstractClass
+  FinalClassWithProtectedMember
+  ImplementationAsType
+  LocaleSetDefault
+  PrivateFieldCouldBeFinal
+  PublicInstanceField
+  ReturnsNullInsteadOfEmptyArray
+  ReturnsNullInsteadOfEmptyCollection
+  SimpleDateFormatMissingLocale
+  StatelessSingleton
+  */
 
-    // rulesets/dry.xml
-    /*
-    DuplicateListLiteral
-    DuplicateMapLiteral
-    DuplicateNumberLiteral
-    DuplicateStringLiteral
-    */
+  // rulesets/dry.xml
+  /*
+  DuplicateListLiteral
+  DuplicateMapLiteral
+  DuplicateNumberLiteral
+  DuplicateStringLiteral
+  */
 
-    // rulesets/enhanced.xml
-    /*
-    CloneWithoutCloneable
-    JUnitAssertEqualsConstantActualValue
-    UnsafeImplementationAsMap
-    */
+  // rulesets/enhanced.xml
+  /*
+  CloneWithoutCloneable
+  JUnitAssertEqualsConstantActualValue
+  UnsafeImplementationAsMap
+  */
 
-    // rulesets/exceptions.xml
-    /*
-    CatchArrayIndexOutOfBoundsException
-    CatchError
-    CatchException
-    CatchIllegalMonitorStateException
-    CatchIndexOutOfBoundsException
-    CatchNullPointerException
-    CatchRuntimeException
-    CatchThrowable
-    ConfusingClassNamedException
-    ExceptionExtendsError
-    ExceptionNotThrown
-    MissingNewInThrowStatement
-    ReturnNullFromCatchBlock
-    SwallowThreadDeath
-    ThrowError
-    ThrowException
-    ThrowNullPointerException
-    ThrowRuntimeException
-    ThrowThrowable
-    */
+  // rulesets/exceptions.xml
+  /*
+  CatchArrayIndexOutOfBoundsException
+  CatchError
+  CatchException
+  CatchIllegalMonitorStateException
+  CatchIndexOutOfBoundsException
+  CatchNullPointerException
+  CatchRuntimeException
+  CatchThrowable
+  ConfusingClassNamedException
+  ExceptionExtendsError
+  ExceptionNotThrown
+  MissingNewInThrowStatement
+  ReturnNullFromCatchBlock
+  SwallowThreadDeath
+  ThrowError
+  ThrowException
+  ThrowNullPointerException
+  ThrowRuntimeException
+  ThrowThrowable
+  */
 
-    // rulesets/formatting.xml
-    /*
-    BracesForClass
-    BracesForForLoop
-    BracesForIfElse
-    BracesForMethod
-    BracesForTryCatchFinally
-    ClassJavadoc
-    ClosureStatementOnOpeningLineOfMultipleLineClosure
-    LineLength
-    SpaceAfterCatch
-    SpaceAfterClosingBrace
-    SpaceAfterComma
-    SpaceAfterFor
-    SpaceAfterIf
-    SpaceAfterOpeningBrace
-    SpaceAfterSemicolon
-    SpaceAfterSwitch
-    SpaceAfterWhile
-    SpaceAroundClosureArrow
-    SpaceAroundMapEntryColon
-    SpaceAroundOperator
-    SpaceBeforeClosingBrace
-    SpaceBeforeOpeningBrace
-    */
+  // rulesets/formatting.xml
+  /*
+  BracesForClass
+  BracesForForLoop
+  BracesForIfElse
+  BracesForMethod
+  BracesForTryCatchFinally
+  ClassJavadoc
+  ClosureStatementOnOpeningLineOfMultipleLineClosure
+  LineLength
+  SpaceAfterCatch
+  SpaceAfterClosingBrace
+  SpaceAfterComma
+  SpaceAfterFor
+  SpaceAfterIf
+  SpaceAfterOpeningBrace
+  SpaceAfterSemicolon
+  SpaceAfterSwitch
+  SpaceAfterWhile
+  SpaceAroundClosureArrow
+  SpaceAroundMapEntryColon
+  SpaceAroundOperator
+  SpaceBeforeClosingBrace
+  SpaceBeforeOpeningBrace
+  */
 
-    // rulesets/generic.xml
-    /*
-    IllegalClassMember
-    IllegalClassReference
-    IllegalPackageReference
-    IllegalRegex
-    IllegalString
-    RequiredRegex
-    RequiredString
-    StatelessClass
-    */
+  // rulesets/generic.xml
+  /*
+  IllegalClassMember
+  IllegalClassReference
+  IllegalPackageReference
+  IllegalRegex
+  IllegalString
+  RequiredRegex
+  RequiredString
+  StatelessClass
+  */
 
-    // rulesets/grails.xml
-    /*
-    GrailsDomainHasEquals
-    GrailsDomainHasToString
-    GrailsDomainReservedSqlKeywordName
-    GrailsDomainWithServiceReference
-    GrailsDuplicateConstraint
-    GrailsDuplicateMapping
-    GrailsPublicControllerMethod
-    GrailsServletContextReference
-    GrailsSessionReference   // DEPRECATED
-    GrailsStatelessService
-    */
+  // rulesets/grails.xml
+  /*
+  GrailsDomainHasEquals
+  GrailsDomainHasToString
+  GrailsDomainReservedSqlKeywordName
+  GrailsDomainWithServiceReference
+  GrailsDuplicateConstraint
+  GrailsDuplicateMapping
+  GrailsPublicControllerMethod
+  GrailsServletContextReference
+  GrailsSessionReference   // DEPRECATED
+  GrailsStatelessService
+  */
 
-    // rulesets/groovyism.xml
-    /*
-    AssignCollectionSort
-    AssignCollectionUnique
-    ClosureAsLastMethodParameter
-    CollectAllIsDeprecated
-    ConfusingMultipleReturns
-    ExplicitArrayListInstantiation
-    ExplicitCallToAndMethod
-    ExplicitCallToCompareToMethod
-    ExplicitCallToDivMethod
-    ExplicitCallToEqualsMethod
-    ExplicitCallToGetAtMethod
-    ExplicitCallToLeftShiftMethod
-    ExplicitCallToMinusMethod
-    ExplicitCallToModMethod
-    ExplicitCallToMultiplyMethod
-    ExplicitCallToOrMethod
-    ExplicitCallToPlusMethod
-    ExplicitCallToPowerMethod
-    ExplicitCallToRightShiftMethod
-    ExplicitCallToXorMethod
-    ExplicitHashMapInstantiation
-    ExplicitHashSetInstantiation
-    ExplicitLinkedHashMapInstantiation
-    ExplicitLinkedListInstantiation
-    ExplicitStackInstantiation
-    ExplicitTreeSetInstantiation
-    GStringAsMapKey
-    GStringExpressionWithinString
-    GetterMethodCouldBeProperty
-    GroovyLangImmutable
-    UseCollectMany
-    UseCollectNested
-    */
+  // rulesets/groovyism.xml
+  /*
+  AssignCollectionSort
+  AssignCollectionUnique
+  ClosureAsLastMethodParameter
+  CollectAllIsDeprecated
+  ConfusingMultipleReturns
+  ExplicitArrayListInstantiation
+  ExplicitCallToAndMethod
+  ExplicitCallToCompareToMethod
+  ExplicitCallToDivMethod
+  ExplicitCallToEqualsMethod
+  ExplicitCallToGetAtMethod
+  ExplicitCallToLeftShiftMethod
+  ExplicitCallToMinusMethod
+  ExplicitCallToModMethod
+  ExplicitCallToMultiplyMethod
+  ExplicitCallToOrMethod
+  ExplicitCallToPlusMethod
+  ExplicitCallToPowerMethod
+  ExplicitCallToRightShiftMethod
+  ExplicitCallToXorMethod
+  ExplicitHashMapInstantiation
+  ExplicitHashSetInstantiation
+  ExplicitLinkedHashMapInstantiation
+  ExplicitLinkedListInstantiation
+  ExplicitStackInstantiation
+  ExplicitTreeSetInstantiation
+  GStringAsMapKey
+  GStringExpressionWithinString
+  GetterMethodCouldBeProperty
+  GroovyLangImmutable
+  UseCollectMany
+  UseCollectNested
+  */
 
-    // rulesets/imports.xml
-    DuplicateImport
-    ImportFromSamePackage
+  // rulesets/imports.xml
+  DuplicateImport
+  ImportFromSamePackage
 //  ImportFromSunPackages
 //  MisorderedStaticImports
-    UnnecessaryGroovyImport
-    UnusedImport
+  UnnecessaryGroovyImport
+  UnusedImport
 
-    // rulesets/jdbc.xml
-    /*
-    DirectConnectionManagement
-    JdbcConnectionReference
-    JdbcResultSetReference
-    JdbcStatementReference
-    */
+  // rulesets/jdbc.xml
+  /*
+  DirectConnectionManagement
+  JdbcConnectionReference
+  JdbcResultSetReference
+  JdbcStatementReference
+  */
 
-    // rulesets/junit.xml
-    /*
-    ChainedTest
-    CoupledTestCase
-    JUnitAssertAlwaysFails
-    JUnitAssertAlwaysSucceeds
-    JUnitFailWithoutMessage
-    JUnitLostTest
-    JUnitPublicField
-    JUnitPublicNonTestMethod
-    JUnitSetUpCallsSuper
-    JUnitStyleAssertions
-    JUnitTearDownCallsSuper
-    JUnitTestMethodWithoutAssert
-    JUnitUnnecessarySetUp
-    JUnitUnnecessaryTearDown
-    JUnitUnnecessaryThrowsException
-    SpockIgnoreRestUsed
-    UnnecessaryFail
-    UseAssertEqualsInsteadOfAssertTrue
-    UseAssertFalseInsteadOfNegation
-    UseAssertNullInsteadOfAssertEquals
-    UseAssertSameInsteadOfAssertTrue
-    UseAssertTrueInsteadOfAssertEquals
-    UseAssertTrueInsteadOfNegation
-    */
+  // rulesets/junit.xml
+  /*
+  ChainedTest
+  CoupledTestCase
+  JUnitAssertAlwaysFails
+  JUnitAssertAlwaysSucceeds
+  JUnitFailWithoutMessage
+  JUnitLostTest
+  JUnitPublicField
+  JUnitPublicNonTestMethod
+  JUnitSetUpCallsSuper
+  JUnitStyleAssertions
+  JUnitTearDownCallsSuper
+  JUnitTestMethodWithoutAssert
+  JUnitUnnecessarySetUp
+  JUnitUnnecessaryTearDown
+  JUnitUnnecessaryThrowsException
+  SpockIgnoreRestUsed
+  UnnecessaryFail
+  UseAssertEqualsInsteadOfAssertTrue
+  UseAssertFalseInsteadOfNegation
+  UseAssertNullInsteadOfAssertEquals
+  UseAssertSameInsteadOfAssertTrue
+  UseAssertTrueInsteadOfAssertEquals
+  UseAssertTrueInsteadOfNegation
+  */
 
-    // rulesets/logging.xml
-    /*
-    LoggerForDifferentClass
-    LoggerWithWrongModifiers
-    LoggingSwallowsStacktrace
-    MultipleLoggers
-    PrintStackTrace
-    Println
-    SystemErrPrint
-    SystemOutPrint
-    */
+  // rulesets/logging.xml
+  /*
+  LoggerForDifferentClass
+  LoggerWithWrongModifiers
+  LoggingSwallowsStacktrace
+  MultipleLoggers
+  PrintStackTrace
+  Println
+  SystemErrPrint
+  SystemOutPrint
+  */
 
-    // rulesets/naming.xml
-    AbstractClassName
-    ClassName {
-        regex = '^[A-Z][\\$a-zA-Z0-9]*$'
-    }
-    ClassNameSameAsFilename
+  // rulesets/naming.xml
+  AbstractClassName
+  ClassName {
+    regex = '^[A-Z][\\$a-zA-Z0-9]*$'
+  }
+  ClassNameSameAsFilename
 //  ConfusingMethodName
 //  FactoryMethodName
-    FieldName {
-        regex = '^_?[a-z][a-zA-Z0-9]*$'
-        finalRegex = '^_?[a-z][a-zA-Z0-9]*$'
-        staticFinalRegex = '^logger$|^[A-Z][A-Z_0-9]*$|^serialVersionUID$'
-    }
-    InterfaceName
-    MethodName {
-        regex = '^[a-z][\\$_a-zA-Z0-9]*$|^.*\\s.*$'
-    }
-    ObjectOverrideMisspelledMethodName
-    PackageName
-    ParameterName
-    PropertyName
-    VariableName {
-        finalRegex = '^[a-z][a-zA-Z0-9]*$'
-    }
+  FieldName {
+    regex = '^_?[a-z][a-zA-Z0-9]*$'
+    finalRegex = '^_?[a-z][a-zA-Z0-9]*$'
+    staticFinalRegex = '^logger$|^[A-Z][A-Z_0-9]*$|^serialVersionUID$'
+  }
+  InterfaceName
+  MethodName {
+    regex = '^[a-z][\\$_a-zA-Z0-9]*$|^.*\\s.*$'
+  }
+  ObjectOverrideMisspelledMethodName
+  PackageName
+  ParameterName
+  PropertyName
+  VariableName {
+    finalRegex = '^[a-z][a-zA-Z0-9]*$'
+  }
 
-    // rulesets/security.xml
-    /*
-    FileCreateTempFile
-    InsecureRandom
-    JavaIoPackageAccess
-    NonFinalPublicField
-    NonFinalSubclassOfSensitiveInterface
-    ObjectFinalize
-    PublicFinalizeMethod
-    SystemExit
-    UnsafeArrayDeclaration
-    */
+  // rulesets/security.xml
+  /*
+  FileCreateTempFile
+  InsecureRandom
+  JavaIoPackageAccess
+  NonFinalPublicField
+  NonFinalSubclassOfSensitiveInterface
+  ObjectFinalize
+  PublicFinalizeMethod
+  SystemExit
+  UnsafeArrayDeclaration
+  */
 
-    // rulesets/serialization.xml
-    /*
-    EnumCustomSerializationIgnored
-    SerialPersistentFields
-    SerialVersionUID
-    SerializableClassMustDefineSerialVersionUID
-    */
+  // rulesets/serialization.xml
+  /*
+  EnumCustomSerializationIgnored
+  SerialPersistentFields
+  SerialVersionUID
+  SerializableClassMustDefineSerialVersionUID
+  */
 
-    // rulesets/size.xml
-    /*
-    AbcComplexity   // DEPRECATED: Use the AbcMetric rule instead. Requires the GMetrics jar
-    AbcMetric   // Requires the GMetrics jar
-    ClassSize
-    CrapMetric   // Requires the GMetrics jar and a Cobertura coverage file
-    CyclomaticComplexity   // Requires the GMetrics jar
-    MethodCount
-    MethodSize
-    NestedBlockDepth
-    */
+  // rulesets/size.xml
+  /*
+  AbcComplexity   // DEPRECATED: Use the AbcMetric rule instead. Requires the GMetrics jar
+  AbcMetric   // Requires the GMetrics jar
+  ClassSize
+  CrapMetric   // Requires the GMetrics jar and a Cobertura coverage file
+  CyclomaticComplexity   // Requires the GMetrics jar
+  MethodCount
+  MethodSize
+  NestedBlockDepth
+  */
 
-    // rulesets/unnecessary.xml
-    AddEmptyString
-    ConsecutiveLiteralAppends
-    ConsecutiveStringConcatenation
-    UnnecessaryBigDecimalInstantiation
-    UnnecessaryBigIntegerInstantiation
-    UnnecessaryBooleanExpression
-    UnnecessaryBooleanInstantiation
+  // rulesets/unnecessary.xml
+  AddEmptyString
+  ConsecutiveLiteralAppends
+  ConsecutiveStringConcatenation
+  UnnecessaryBigDecimalInstantiation
+  UnnecessaryBigIntegerInstantiation
+  UnnecessaryBooleanExpression
+  UnnecessaryBooleanInstantiation
 //  UnnecessaryCallForLastElement
-    UnnecessaryCallToSubstring
-    UnnecessaryCatchBlock
+  UnnecessaryCallToSubstring
+  UnnecessaryCatchBlock
 //  UnnecessaryCollectCall
-    UnnecessaryCollectionCall
-    UnnecessaryConstructor
-    UnnecessaryDefInFieldDeclaration
-    UnnecessaryDefInMethodDeclaration
-    UnnecessaryDefInVariableDeclaration
-    UnnecessaryDotClass
-    UnnecessaryDoubleInstantiation
-    UnnecessaryElseStatement
-    UnnecessaryFinalOnPrivateMethod
-    UnnecessaryFloatInstantiation
+  UnnecessaryCollectionCall
+  UnnecessaryConstructor
+  UnnecessaryDefInFieldDeclaration
+  UnnecessaryDefInMethodDeclaration
+  UnnecessaryDefInVariableDeclaration
+  UnnecessaryDotClass
+  UnnecessaryDoubleInstantiation
+  UnnecessaryElseStatement
+  UnnecessaryFinalOnPrivateMethod
+  UnnecessaryFloatInstantiation
 //  UnnecessaryGString
 //  UnnecessaryGetter
-    UnnecessaryIfStatement
-    UnnecessaryInstanceOfCheck
-    UnnecessaryInstantiationToGetClass
-    UnnecessaryIntegerInstantiation
-    UnnecessaryLongInstantiation
-    UnnecessaryModOne
-    UnnecessaryNullCheck
-    UnnecessaryNullCheckBeforeInstanceOf
+  UnnecessaryIfStatement
+  UnnecessaryInstanceOfCheck
+  UnnecessaryInstantiationToGetClass
+  UnnecessaryIntegerInstantiation
+  UnnecessaryLongInstantiation
+  UnnecessaryModOne
+  UnnecessaryNullCheck
+  UnnecessaryNullCheckBeforeInstanceOf
 //  UnnecessaryObjectReferences
-    UnnecessaryOverridingMethod
+  UnnecessaryOverridingMethod
 //  UnnecessaryPackageReference
-    UnnecessaryParenthesesForMethodCallWithClosure
-    UnnecessaryPublicModifier
+  UnnecessaryParenthesesForMethodCallWithClosure
+  UnnecessaryPublicModifier
 //  UnnecessaryReturnKeyword
 //  UnnecessarySelfAssignment
-    UnnecessarySemicolon
-    UnnecessaryStringInstantiation
+  UnnecessarySemicolon
+  UnnecessaryStringInstantiation
 //  UnnecessarySubstring
-    UnnecessaryTernaryExpression
-    UnnecessaryTransientModifier
+  UnnecessaryTernaryExpression
+  UnnecessaryTransientModifier
 
-    // rulesets/unused.xml
-    UnusedArray
+  // rulesets/unused.xml
+  UnusedArray
 //  UnusedMethodParameter
-    UnusedObject
-    UnusedPrivateField
-    UnusedPrivateMethod
-    UnusedPrivateMethodParameter
-    UnusedVariable
+  UnusedObject
+  UnusedPrivateField
+  UnusedPrivateMethod
+  UnusedPrivateMethodParameter
+  UnusedVariable
 }

+ 370 - 370
gradle/enforcement/codenarcTest.groovy

@@ -15,413 +15,413 @@
  */
 
 ruleset {
-    // rulesets/basic.xml
-    /*
-    AssertWithinFinallyBlock
-    AssignmentInConditional
-    BigDecimalInstantiation
-    BitwiseOperatorInConditional
-    BooleanGetBoolean
-    BrokenNullCheck
-    BrokenOddnessCheck
-    ClassForName
-    ComparisonOfTwoConstants
-    ComparisonWithSelf
-    ConstantAssertExpression
-    ConstantIfExpression
-    ConstantTernaryExpression
-    DeadCode
-    DoubleNegative
-    DuplicateCaseStatement
-    DuplicateMapKey
-    DuplicateSetValue
-    EmptyCatchBlock
-    EmptyClass
-    EmptyElseBlock
-    EmptyFinallyBlock
-    EmptyForStatement
-    EmptyIfStatement
-    EmptyInstanceInitializer
-    EmptyMethod
-    EmptyStaticInitializer
-    EmptySwitchStatement
-    EmptySynchronizedStatement
-    EmptyTryBlock
-    EmptyWhileStatement
-    EqualsAndHashCode
-    EqualsOverloaded
-    ExplicitGarbageCollection
-    ForLoopShouldBeWhileLoop
-    HardCodedWindowsFileSeparator
-    HardCodedWindowsRootDirectory
-    IntegerGetInteger
-    RandomDoubleCoercedToZero
-    RemoveAllOnSelf
-    ReturnFromFinallyBlock
-    ThrowExceptionFromFinallyBlock
-    */
+  // rulesets/basic.xml
+  /*
+  AssertWithinFinallyBlock
+  AssignmentInConditional
+  BigDecimalInstantiation
+  BitwiseOperatorInConditional
+  BooleanGetBoolean
+  BrokenNullCheck
+  BrokenOddnessCheck
+  ClassForName
+  ComparisonOfTwoConstants
+  ComparisonWithSelf
+  ConstantAssertExpression
+  ConstantIfExpression
+  ConstantTernaryExpression
+  DeadCode
+  DoubleNegative
+  DuplicateCaseStatement
+  DuplicateMapKey
+  DuplicateSetValue
+  EmptyCatchBlock
+  EmptyClass
+  EmptyElseBlock
+  EmptyFinallyBlock
+  EmptyForStatement
+  EmptyIfStatement
+  EmptyInstanceInitializer
+  EmptyMethod
+  EmptyStaticInitializer
+  EmptySwitchStatement
+  EmptySynchronizedStatement
+  EmptyTryBlock
+  EmptyWhileStatement
+  EqualsAndHashCode
+  EqualsOverloaded
+  ExplicitGarbageCollection
+  ForLoopShouldBeWhileLoop
+  HardCodedWindowsFileSeparator
+  HardCodedWindowsRootDirectory
+  IntegerGetInteger
+  RandomDoubleCoercedToZero
+  RemoveAllOnSelf
+  ReturnFromFinallyBlock
+  ThrowExceptionFromFinallyBlock
+  */
 
-    // rulesets/braces.xml
-    ElseBlockBraces
-    ForStatementBraces
-    IfStatementBraces
-    WhileStatementBraces
+  // rulesets/braces.xml
+  ElseBlockBraces
+  ForStatementBraces
+  IfStatementBraces
+  WhileStatementBraces
 
-    // rulesets/concurrency.xml
-    /*
-    BusyWait
-    DoubleCheckedLocking
-    InconsistentPropertyLocking
-    InconsistentPropertySynchronization
-    NestedSynchronization
-    StaticCalendarField
-    StaticConnection
-    StaticDateFormatField
-    StaticMatcherField
-    StaticSimpleDateFormatField
-    SynchronizedMethod
-    SynchronizedOnBoxedPrimitive
-    SynchronizedOnGetClass
-    SynchronizedOnReentrantLock
-    SynchronizedOnString
-    SynchronizedOnThis
-    SynchronizedReadObjectMethod
-    SystemRunFinalizersOnExit
-    ThisReferenceEscapesConstructor
-    ThreadGroup
-    ThreadLocalNotStaticFinal
-    ThreadYield
-    UseOfNotifyMethod
-    VolatileArrayField
-    VolatileLongOrDoubleField
-    WaitOutsideOfWhileLoop
-    */
+  // rulesets/concurrency.xml
+  /*
+  BusyWait
+  DoubleCheckedLocking
+  InconsistentPropertyLocking
+  InconsistentPropertySynchronization
+  NestedSynchronization
+  StaticCalendarField
+  StaticConnection
+  StaticDateFormatField
+  StaticMatcherField
+  StaticSimpleDateFormatField
+  SynchronizedMethod
+  SynchronizedOnBoxedPrimitive
+  SynchronizedOnGetClass
+  SynchronizedOnReentrantLock
+  SynchronizedOnString
+  SynchronizedOnThis
+  SynchronizedReadObjectMethod
+  SystemRunFinalizersOnExit
+  ThisReferenceEscapesConstructor
+  ThreadGroup
+  ThreadLocalNotStaticFinal
+  ThreadYield
+  UseOfNotifyMethod
+  VolatileArrayField
+  VolatileLongOrDoubleField
+  WaitOutsideOfWhileLoop
+  */
 
-    // rulesets/convention.xml
-    /*
-    ConfusingTernary
-    CouldBeElvis
-    HashtableIsObsolete
-    IfStatementCouldBeTernary
-    InvertedIfElse
-    LongLiteralWithLowerCaseL
-    ParameterReassignment
-    TernaryCouldBeElvis
-    VectorIsObsolete
-    */
+  // rulesets/convention.xml
+  /*
+  ConfusingTernary
+  CouldBeElvis
+  HashtableIsObsolete
+  IfStatementCouldBeTernary
+  InvertedIfElse
+  LongLiteralWithLowerCaseL
+  ParameterReassignment
+  TernaryCouldBeElvis
+  VectorIsObsolete
+  */
 
-    // rulesets/design.xml
-    /*
-    AbstractClassWithPublicConstructor
-    AbstractClassWithoutAbstractMethod
-    BooleanMethodReturnsNull
-    BuilderMethodWithSideEffects
-    CloneableWithoutClone
-    CloseWithoutCloseable
-    CompareToWithoutComparable
-    ConstantsOnlyInterface
-    EmptyMethodInAbstractClass
-    FinalClassWithProtectedMember
-    ImplementationAsType
-    LocaleSetDefault
-    PrivateFieldCouldBeFinal
-    PublicInstanceField
-    ReturnsNullInsteadOfEmptyArray
-    ReturnsNullInsteadOfEmptyCollection
-    SimpleDateFormatMissingLocale
-    StatelessSingleton
-    */
+  // rulesets/design.xml
+  /*
+  AbstractClassWithPublicConstructor
+  AbstractClassWithoutAbstractMethod
+  BooleanMethodReturnsNull
+  BuilderMethodWithSideEffects
+  CloneableWithoutClone
+  CloseWithoutCloseable
+  CompareToWithoutComparable
+  ConstantsOnlyInterface
+  EmptyMethodInAbstractClass
+  FinalClassWithProtectedMember
+  ImplementationAsType
+  LocaleSetDefault
+  PrivateFieldCouldBeFinal
+  PublicInstanceField
+  ReturnsNullInsteadOfEmptyArray
+  ReturnsNullInsteadOfEmptyCollection
+  SimpleDateFormatMissingLocale
+  StatelessSingleton
+  */
 
-    // rulesets/dry.xml
-    /*
-    DuplicateListLiteral
-    DuplicateMapLiteral
-    DuplicateNumberLiteral
-    DuplicateStringLiteral
-    */
+  // rulesets/dry.xml
+  /*
+  DuplicateListLiteral
+  DuplicateMapLiteral
+  DuplicateNumberLiteral
+  DuplicateStringLiteral
+  */
 
-    // rulesets/enhanced.xml
-    /*
-    CloneWithoutCloneable
-    JUnitAssertEqualsConstantActualValue
-    UnsafeImplementationAsMap
-    */
+  // rulesets/enhanced.xml
+  /*
+  CloneWithoutCloneable
+  JUnitAssertEqualsConstantActualValue
+  UnsafeImplementationAsMap
+  */
 
-    // rulesets/exceptions.xml
-    /*
-    CatchArrayIndexOutOfBoundsException
-    CatchError
-    CatchException
-    CatchIllegalMonitorStateException
-    CatchIndexOutOfBoundsException
-    CatchNullPointerException
-    CatchRuntimeException
-    CatchThrowable
-    ConfusingClassNamedException
-    ExceptionExtendsError
-    ExceptionNotThrown
-    MissingNewInThrowStatement
-    ReturnNullFromCatchBlock
-    SwallowThreadDeath
-    ThrowError
-    ThrowException
-    ThrowNullPointerException
-    ThrowRuntimeException
-    ThrowThrowable
-    */
+  // rulesets/exceptions.xml
+  /*
+  CatchArrayIndexOutOfBoundsException
+  CatchError
+  CatchException
+  CatchIllegalMonitorStateException
+  CatchIndexOutOfBoundsException
+  CatchNullPointerException
+  CatchRuntimeException
+  CatchThrowable
+  ConfusingClassNamedException
+  ExceptionExtendsError
+  ExceptionNotThrown
+  MissingNewInThrowStatement
+  ReturnNullFromCatchBlock
+  SwallowThreadDeath
+  ThrowError
+  ThrowException
+  ThrowNullPointerException
+  ThrowRuntimeException
+  ThrowThrowable
+  */
 
-    // rulesets/formatting.xml
-    /*
-    BracesForClass
-    BracesForForLoop
-    BracesForIfElse
-    BracesForMethod
-    BracesForTryCatchFinally
-    ClassJavadoc
-    ClosureStatementOnOpeningLineOfMultipleLineClosure
-    LineLength
-    SpaceAfterCatch
-    SpaceAfterClosingBrace
-    SpaceAfterComma
-    SpaceAfterFor
-    SpaceAfterIf
-    SpaceAfterOpeningBrace
-    SpaceAfterSemicolon
-    SpaceAfterSwitch
-    SpaceAfterWhile
-    SpaceAroundClosureArrow
-    SpaceAroundMapEntryColon
-    SpaceAroundOperator
-    SpaceBeforeClosingBrace
-    SpaceBeforeOpeningBrace
-    */
+  // rulesets/formatting.xml
+  /*
+  BracesForClass
+  BracesForForLoop
+  BracesForIfElse
+  BracesForMethod
+  BracesForTryCatchFinally
+  ClassJavadoc
+  ClosureStatementOnOpeningLineOfMultipleLineClosure
+  LineLength
+  SpaceAfterCatch
+  SpaceAfterClosingBrace
+  SpaceAfterComma
+  SpaceAfterFor
+  SpaceAfterIf
+  SpaceAfterOpeningBrace
+  SpaceAfterSemicolon
+  SpaceAfterSwitch
+  SpaceAfterWhile
+  SpaceAroundClosureArrow
+  SpaceAroundMapEntryColon
+  SpaceAroundOperator
+  SpaceBeforeClosingBrace
+  SpaceBeforeOpeningBrace
+  */
 
-    // rulesets/generic.xml
-    /*
-    IllegalClassMember
-    IllegalClassReference
-    IllegalPackageReference
-    IllegalRegex
-    IllegalString
-    RequiredRegex
-    RequiredString
-    StatelessClass
-    */
+  // rulesets/generic.xml
+  /*
+  IllegalClassMember
+  IllegalClassReference
+  IllegalPackageReference
+  IllegalRegex
+  IllegalString
+  RequiredRegex
+  RequiredString
+  StatelessClass
+  */
 
-    // rulesets/grails.xml
-    /*
-    GrailsDomainHasEquals
-    GrailsDomainHasToString
-    GrailsDomainReservedSqlKeywordName
-    GrailsDomainWithServiceReference
-    GrailsDuplicateConstraint
-    GrailsDuplicateMapping
-    GrailsPublicControllerMethod
-    GrailsServletContextReference
-    GrailsSessionReference   // DEPRECATED
-    GrailsStatelessService
-    */
+  // rulesets/grails.xml
+  /*
+  GrailsDomainHasEquals
+  GrailsDomainHasToString
+  GrailsDomainReservedSqlKeywordName
+  GrailsDomainWithServiceReference
+  GrailsDuplicateConstraint
+  GrailsDuplicateMapping
+  GrailsPublicControllerMethod
+  GrailsServletContextReference
+  GrailsSessionReference   // DEPRECATED
+  GrailsStatelessService
+  */
 
-    // rulesets/groovyism.xml
-    /*
-    AssignCollectionSort
-    AssignCollectionUnique
-    ClosureAsLastMethodParameter
-    CollectAllIsDeprecated
-    ConfusingMultipleReturns
-    ExplicitArrayListInstantiation
-    ExplicitCallToAndMethod
-    ExplicitCallToCompareToMethod
-    ExplicitCallToDivMethod
-    ExplicitCallToEqualsMethod
-    ExplicitCallToGetAtMethod
-    ExplicitCallToLeftShiftMethod
-    ExplicitCallToMinusMethod
-    ExplicitCallToModMethod
-    ExplicitCallToMultiplyMethod
-    ExplicitCallToOrMethod
-    ExplicitCallToPlusMethod
-    ExplicitCallToPowerMethod
-    ExplicitCallToRightShiftMethod
-    ExplicitCallToXorMethod
-    ExplicitHashMapInstantiation
-    ExplicitHashSetInstantiation
-    ExplicitLinkedHashMapInstantiation
-    ExplicitLinkedListInstantiation
-    ExplicitStackInstantiation
-    ExplicitTreeSetInstantiation
-    GStringAsMapKey
-    GStringExpressionWithinString
-    GetterMethodCouldBeProperty
-    GroovyLangImmutable
-    UseCollectMany
-    UseCollectNested
-    */
+  // rulesets/groovyism.xml
+  /*
+  AssignCollectionSort
+  AssignCollectionUnique
+  ClosureAsLastMethodParameter
+  CollectAllIsDeprecated
+  ConfusingMultipleReturns
+  ExplicitArrayListInstantiation
+  ExplicitCallToAndMethod
+  ExplicitCallToCompareToMethod
+  ExplicitCallToDivMethod
+  ExplicitCallToEqualsMethod
+  ExplicitCallToGetAtMethod
+  ExplicitCallToLeftShiftMethod
+  ExplicitCallToMinusMethod
+  ExplicitCallToModMethod
+  ExplicitCallToMultiplyMethod
+  ExplicitCallToOrMethod
+  ExplicitCallToPlusMethod
+  ExplicitCallToPowerMethod
+  ExplicitCallToRightShiftMethod
+  ExplicitCallToXorMethod
+  ExplicitHashMapInstantiation
+  ExplicitHashSetInstantiation
+  ExplicitLinkedHashMapInstantiation
+  ExplicitLinkedListInstantiation
+  ExplicitStackInstantiation
+  ExplicitTreeSetInstantiation
+  GStringAsMapKey
+  GStringExpressionWithinString
+  GetterMethodCouldBeProperty
+  GroovyLangImmutable
+  UseCollectMany
+  UseCollectNested
+  */
 
-    // rulesets/imports.xml
-    DuplicateImport
-    ImportFromSamePackage
+  // rulesets/imports.xml
+  DuplicateImport
+  ImportFromSamePackage
 //  ImportFromSunPackages
 //  MisorderedStaticImports
-    UnnecessaryGroovyImport
-    UnusedImport
+  UnnecessaryGroovyImport
+  UnusedImport
 
-    // rulesets/jdbc.xml
-    /*
-    DirectConnectionManagement
-    JdbcConnectionReference
-    JdbcResultSetReference
-    JdbcStatementReference
-    */
+  // rulesets/jdbc.xml
+  /*
+  DirectConnectionManagement
+  JdbcConnectionReference
+  JdbcResultSetReference
+  JdbcStatementReference
+  */
 
-    // rulesets/junit.xml
-    /*
-    ChainedTest
-    CoupledTestCase
-    JUnitAssertAlwaysFails
-    JUnitAssertAlwaysSucceeds
-    JUnitFailWithoutMessage
-    JUnitLostTest
-    JUnitPublicField
-    JUnitPublicNonTestMethod
-    JUnitSetUpCallsSuper
-    JUnitStyleAssertions
-    JUnitTearDownCallsSuper
-    JUnitTestMethodWithoutAssert
-    JUnitUnnecessarySetUp
-    JUnitUnnecessaryTearDown
-    JUnitUnnecessaryThrowsException
-    SpockIgnoreRestUsed
-    UnnecessaryFail
-    UseAssertEqualsInsteadOfAssertTrue
-    UseAssertFalseInsteadOfNegation
-    UseAssertNullInsteadOfAssertEquals
-    UseAssertSameInsteadOfAssertTrue
-    UseAssertTrueInsteadOfAssertEquals
-    UseAssertTrueInsteadOfNegation
-    */
+  // rulesets/junit.xml
+  /*
+  ChainedTest
+  CoupledTestCase
+  JUnitAssertAlwaysFails
+  JUnitAssertAlwaysSucceeds
+  JUnitFailWithoutMessage
+  JUnitLostTest
+  JUnitPublicField
+  JUnitPublicNonTestMethod
+  JUnitSetUpCallsSuper
+  JUnitStyleAssertions
+  JUnitTearDownCallsSuper
+  JUnitTestMethodWithoutAssert
+  JUnitUnnecessarySetUp
+  JUnitUnnecessaryTearDown
+  JUnitUnnecessaryThrowsException
+  SpockIgnoreRestUsed
+  UnnecessaryFail
+  UseAssertEqualsInsteadOfAssertTrue
+  UseAssertFalseInsteadOfNegation
+  UseAssertNullInsteadOfAssertEquals
+  UseAssertSameInsteadOfAssertTrue
+  UseAssertTrueInsteadOfAssertEquals
+  UseAssertTrueInsteadOfNegation
+  */
 
-    // rulesets/logging.xml
-    /*
-    LoggerForDifferentClass
-    LoggerWithWrongModifiers
-    LoggingSwallowsStacktrace
-    MultipleLoggers
-    PrintStackTrace
-    Println
-    SystemErrPrint
-    SystemOutPrint
-    */
+  // rulesets/logging.xml
+  /*
+  LoggerForDifferentClass
+  LoggerWithWrongModifiers
+  LoggingSwallowsStacktrace
+  MultipleLoggers
+  PrintStackTrace
+  Println
+  SystemErrPrint
+  SystemOutPrint
+  */
 
-    // rulesets/naming.xml
-    AbstractClassName
-    ClassName {
-        regex = '^[A-Z][\\$a-zA-Z0-9]*(?<!Test)'
-    }
-    ClassNameSameAsFilename
+  // rulesets/naming.xml
+  AbstractClassName
+  ClassName {
+    regex = '^[A-Z][\\$a-zA-Z0-9]*(?<!Test)'
+  }
+  ClassNameSameAsFilename
 //  ConfusingMethodName
 //  FactoryMethodName
-    FieldName {
-        regex = '^_?[a-z][a-zA-Z0-9]*$'
-        finalRegex = '^_?[a-z][a-zA-Z0-9]*$'
-        staticFinalRegex = '^logger$|^[A-Z][A-Z_0-9]*$|^serialVersionUID$'
-    }
-    InterfaceName
-    MethodName {
-        regex = '^[a-z][\\$_a-zA-Z0-9]*$|^.*\\s.*$'
-    }
-    ObjectOverrideMisspelledMethodName
-    PackageName
-    ParameterName
-    PropertyName
-    VariableName {
-        finalRegex = '^[a-z][a-zA-Z0-9]*$'
-    }
+  FieldName {
+    regex = '^_?[a-z][a-zA-Z0-9]*$'
+    finalRegex = '^_?[a-z][a-zA-Z0-9]*$'
+    staticFinalRegex = '^logger$|^[A-Z][A-Z_0-9]*$|^serialVersionUID$'
+  }
+  InterfaceName
+  MethodName {
+    regex = '^[a-z][\\$_a-zA-Z0-9]*$|^.*\\s.*$'
+  }
+  ObjectOverrideMisspelledMethodName
+  PackageName
+  ParameterName
+  PropertyName
+  VariableName {
+    finalRegex = '^[a-z][a-zA-Z0-9]*$'
+  }
 
-    // rulesets/security.xml
-    /*
-    FileCreateTempFile
-    InsecureRandom
-    JavaIoPackageAccess
-    NonFinalPublicField
-    NonFinalSubclassOfSensitiveInterface
-    ObjectFinalize
-    PublicFinalizeMethod
-    SystemExit
-    UnsafeArrayDeclaration
-    */
+  // rulesets/security.xml
+  /*
+  FileCreateTempFile
+  InsecureRandom
+  JavaIoPackageAccess
+  NonFinalPublicField
+  NonFinalSubclassOfSensitiveInterface
+  ObjectFinalize
+  PublicFinalizeMethod
+  SystemExit
+  UnsafeArrayDeclaration
+  */
 
-    // rulesets/serialization.xml
-    /*
-    EnumCustomSerializationIgnored
-    SerialPersistentFields
-    SerialVersionUID
-    SerializableClassMustDefineSerialVersionUID
-    */
+  // rulesets/serialization.xml
+  /*
+  EnumCustomSerializationIgnored
+  SerialPersistentFields
+  SerialVersionUID
+  SerializableClassMustDefineSerialVersionUID
+  */
 
-    // rulesets/size.xml
-    /*
-    AbcComplexity   // DEPRECATED: Use the AbcMetric rule instead. Requires the GMetrics jar
-    AbcMetric   // Requires the GMetrics jar
-    ClassSize
-    CrapMetric   // Requires the GMetrics jar and a Cobertura coverage file
-    CyclomaticComplexity   // Requires the GMetrics jar
-    MethodCount
-    MethodSize
-    NestedBlockDepth
-    */
+  // rulesets/size.xml
+  /*
+  AbcComplexity   // DEPRECATED: Use the AbcMetric rule instead. Requires the GMetrics jar
+  AbcMetric   // Requires the GMetrics jar
+  ClassSize
+  CrapMetric   // Requires the GMetrics jar and a Cobertura coverage file
+  CyclomaticComplexity   // Requires the GMetrics jar
+  MethodCount
+  MethodSize
+  NestedBlockDepth
+  */
 
-    // rulesets/unnecessary.xml
-    AddEmptyString
-    ConsecutiveLiteralAppends
-    ConsecutiveStringConcatenation
-    UnnecessaryBigDecimalInstantiation
-    UnnecessaryBigIntegerInstantiation
+  // rulesets/unnecessary.xml
+  AddEmptyString
+  ConsecutiveLiteralAppends
+  ConsecutiveStringConcatenation
+  UnnecessaryBigDecimalInstantiation
+  UnnecessaryBigIntegerInstantiation
 //  UnnecessaryBooleanExpression
-    UnnecessaryBooleanInstantiation
+  UnnecessaryBooleanInstantiation
 //  UnnecessaryCallForLastElement
-    UnnecessaryCallToSubstring
-    UnnecessaryCatchBlock
+  UnnecessaryCallToSubstring
+  UnnecessaryCatchBlock
 //  UnnecessaryCollectCall
-    UnnecessaryCollectionCall
-    UnnecessaryConstructor
-    UnnecessaryDefInFieldDeclaration
+  UnnecessaryCollectionCall
+  UnnecessaryConstructor
+  UnnecessaryDefInFieldDeclaration
 //  UnnecessaryDefInMethodDeclaration
-    UnnecessaryDefInVariableDeclaration
-    UnnecessaryDotClass
-    UnnecessaryDoubleInstantiation
-    UnnecessaryElseStatement
-    UnnecessaryFinalOnPrivateMethod
-    UnnecessaryFloatInstantiation
+  UnnecessaryDefInVariableDeclaration
+  UnnecessaryDotClass
+  UnnecessaryDoubleInstantiation
+  UnnecessaryElseStatement
+  UnnecessaryFinalOnPrivateMethod
+  UnnecessaryFloatInstantiation
 //  UnnecessaryGString
 //  UnnecessaryGetter
-    UnnecessaryIfStatement
-    UnnecessaryInstanceOfCheck
-    UnnecessaryInstantiationToGetClass
-    UnnecessaryIntegerInstantiation
-    UnnecessaryLongInstantiation
-    UnnecessaryModOne
-    UnnecessaryNullCheck
-    UnnecessaryNullCheckBeforeInstanceOf
+  UnnecessaryIfStatement
+  UnnecessaryInstanceOfCheck
+  UnnecessaryInstantiationToGetClass
+  UnnecessaryIntegerInstantiation
+  UnnecessaryLongInstantiation
+  UnnecessaryModOne
+  UnnecessaryNullCheck
+  UnnecessaryNullCheckBeforeInstanceOf
 //  UnnecessaryObjectReferences
-    UnnecessaryOverridingMethod
+  UnnecessaryOverridingMethod
 //  UnnecessaryPackageReference
-    UnnecessaryParenthesesForMethodCallWithClosure
+  UnnecessaryParenthesesForMethodCallWithClosure
 //  UnnecessaryPublicModifier
 //  UnnecessaryReturnKeyword
 //  UnnecessarySelfAssignment
-    UnnecessarySemicolon
-    UnnecessaryStringInstantiation
+  UnnecessarySemicolon
+  UnnecessaryStringInstantiation
 //  UnnecessarySubstring
-    UnnecessaryTernaryExpression
-    UnnecessaryTransientModifier
+  UnnecessaryTernaryExpression
+  UnnecessaryTransientModifier
 
-    // rulesets/unused.xml
-    UnusedArray
+  // rulesets/unused.xml
+  UnusedArray
 //  UnusedMethodParameter
 //  UnusedObject
-    UnusedPrivateField
-    UnusedPrivateMethod
-    UnusedPrivateMethodParameter
-    UnusedVariable
+  UnusedPrivateField
+  UnusedPrivateMethod
+  UnusedPrivateMethodParameter
+  UnusedVariable
 }

+ 3 - 3
gradle/enforcement/suppressions.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 
 <!DOCTYPE suppressions PUBLIC
-        "-//Puppy Crawl//DTD Suppressions 1.1//EN"
-        "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+  "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+  "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
 
 <suppressions>
 
-    <suppress checks="RegexpHeader" files=".*MimeParse.java"/>
+  <suppress checks="RegexpHeader" files=".*MimeParse.java"/>
 
 </suppressions>

+ 26 - 26
gradle/jacoco.gradle

@@ -1,12 +1,12 @@
 apply plugin: "jacoco"
 
 jacocoTestReport {
-    dependsOn test
-    reports {
-        xml.enabled true
-        csv.enabled false
-        html.destination file("${buildDir}/reports/jacoco/")
-    }
+  dependsOn test
+  reports {
+    xml.enabled true
+    csv.enabled false
+    html.destination file("${buildDir}/reports/jacoco/")
+  }
 }
 
 project.ext.whitelistedBranchClasses = []
@@ -16,28 +16,28 @@ project.ext.minimumBranchCoverage = 0.6
 project.ext.minimumInstructionCoverage = 0.6
 
 afterEvaluate {
-    jacocoTestCoverageVerification {
-        violationRules {
-            rule {
-                element = 'CLASS'
-                excludes = project.whitelistedBranchClasses
-                limit {
-                    counter = 'BRANCH'
-                    minimum = project.minimumBranchCoverage
-                }
-            }
+  jacocoTestCoverageVerification {
+    violationRules {
+      rule {
+        element = 'CLASS'
+        excludes = project.whitelistedBranchClasses
+        limit {
+          counter = 'BRANCH'
+          minimum = project.minimumBranchCoverage
+        }
+      }
 
-            rule {
-                element = 'CLASS'
-                excludes = project.whitelistedInstructionClasses
-                limit {
-                    counter = 'INSTRUCTION'
-                    minimum = project.minimumInstructionCoverage
-                }
-            }
+      rule {
+        element = 'CLASS'
+        excludes = project.whitelistedInstructionClasses
+        limit {
+          counter = 'INSTRUCTION'
+          minimum = project.minimumInstructionCoverage
         }
+      }
     }
+  }
 
-    jacocoTestCoverageVerification.dependsOn jacocoTestReport
-    check.dependsOn jacocoTestCoverageVerification
+  jacocoTestCoverageVerification.dependsOn jacocoTestReport
+  check.dependsOn jacocoTestCoverageVerification
 }

+ 27 - 27
gradle/java.gradle

@@ -3,57 +3,57 @@ sourceCompatibility = 1.7
 targetCompatibility = 1.7
 
 task packageSources(type: Jar) {
-    classifier = 'sources'
-    from sourceSets.main.allSource
+  classifier = 'sources'
+  from sourceSets.main.allSource
 }
 artifacts.archives packageSources
 repositories {
-    mavenLocal()
+  mavenLocal()
 
-    maven { url "http://repo.maven.apache.org/maven2" }
+  maven { url "http://repo.maven.apache.org/maven2" }
 }
 
 tasks.withType(Javadoc) {
-    options.encoding = "utf-8"
-    options.docEncoding = "utf-8"
-    options.charSet = "utf-8"
-    exclude "**/internal/**"
+  options.encoding = "utf-8"
+  options.docEncoding = "utf-8"
+  options.charSet = "utf-8"
+  exclude "**/internal/**"
 
-    options.addStringOption('Xdoclint:none', '-quiet')
+  options.addStringOption('Xdoclint:none', '-quiet')
 
-    doFirst {
-        if (project.ext.has("apiLinks")) {
-            options.links(*project.apiLinks)
-        }
+  doFirst {
+    if (project.ext.has("apiLinks")) {
+      options.links(*project.apiLinks)
     }
+  }
 }
 
 javadoc {
-    source = sourceSets.main.allJava
-    classpath = configurations.compileClasspath
+  source = sourceSets.main.allJava
+  classpath = configurations.compileClasspath
 
-    options {
-        setMemberLevel JavadocMemberLevel.PUBLIC
-        setAuthor true
+  options {
+    setMemberLevel JavadocMemberLevel.PUBLIC
+    setAuthor true
 
-        links "https://docs.oracle.com/javase/8/docs/api/"
-    }
+    links "https://docs.oracle.com/javase/8/docs/api/"
+  }
 }
 
 task sourceJar(type: Jar) {
-    from sourceSets.main.allJava
-    classifier = 'sources'
+  from sourceSets.main.allJava
+  classifier = 'sources'
 }
 
 task javaDocJar(type: Jar, dependsOn: javadoc) {
-    from javadoc.destinationDir
-    classifier = 'javadoc'
+  from javadoc.destinationDir
+  classifier = 'javadoc'
 }
 
 artifacts {
-    archives jar
-    archives sourceJar
-    archives javaDocJar
+  archives jar
+  archives sourceJar
+  archives javaDocJar
 }
 
 apply from: "$rootDir/gradle/checkstyle.gradle"

+ 24 - 24
gradle/pom.gradle

@@ -17,29 +17,29 @@
 // Source: https://github.com/ratpack/ratpack/blob/master/gradle/pom.gradle
 
 ext {
-    pomModifications = []
-    modifyPom = { pomModifications << it }
+  pomModifications = []
+  modifyPom = { pomModifications << it }
 }
 
 tasks.withType(Upload) {
-    repositories.withType(org.gradle.api.artifacts.maven.MavenResolver) {
-        it.pom.whenConfigured { pom ->
-            pomModifications.each {
-                configure(pom, it)
-            }
-        }
+  repositories.withType(org.gradle.api.artifacts.maven.MavenResolver) {
+    it.pom.whenConfigured { pom ->
+      pomModifications.each {
+        configure(pom, it)
+      }
     }
+  }
 }
 
 modifyPom {
-    dependencies.removeAll { it.scope == "test" }
+  dependencies.removeAll { it.scope == "test" }
 }
 
 modifyPom {
-    project {
-        name project.name
-        description project.description
-        url "https://github.com/datadog/dd-trace-java"
+  project {
+    name project.name
+    description project.description
+    url "https://github.com/datadog/dd-trace-java"
 //        licenses {
 //            license {
 //                name "The Apache Software License, Version 2.0"
@@ -47,16 +47,16 @@ modifyPom {
 //                distribution "repo"
 //            }
 //        }
-        scm {
-            connection "scm:https://datadog@github.com/datadog/dd-trace-java"
-            developerConnection "scm:git@github.com:datadog/dd-trace-java.git"
-            url "https://github.com/datadog/dd-trace-java"
-        }
-        developers {
-            developer {
-                id "datadog"
-                name "Datadog"
-            }
-        }
+    scm {
+      connection "scm:https://datadog@github.com/datadog/dd-trace-java"
+      developerConnection "scm:git@github.com:datadog/dd-trace-java.git"
+      url "https://github.com/datadog/dd-trace-java"
     }
+    developers {
+      developer {
+        id "datadog"
+        name "Datadog"
+      }
+    }
+  }
 }

+ 35 - 35
gradle/publish.gradle

@@ -22,13 +22,13 @@ apply plugin: "signing"
 apply from: "${rootDir}/gradle/pom.gradle"
 
 afterEvaluate {
-    assert description: "Project $project.path is published, must have a description"
+  assert description: "Project $project.path is published, must have a description"
 }
 
 tasks.withType(Upload).matching { it.name != "install" }.all {
-    rootProject.subprojects {
-        mustRunAfter tasks.matching { it instanceof VerificationTask }
-    }
+  rootProject.subprojects {
+    mustRunAfter tasks.matching { it instanceof VerificationTask }
+  }
 }
 
 def isCI = Boolean.parseBoolean("$System.env.CI")
@@ -39,21 +39,21 @@ signing {
 }
 
 configurations {
-    configurations {
-        all {
-            incoming.afterResolve {
-                dependencies.withType(ModuleDependency) { dep ->
-                    excludeRules.each {
-                        if ([it.group, it.module].any { it == null }) {
-                            throw new InvalidUserDataException(
-                                    "Partial exclude for dependency '$dep.group:$dep.name:$dep.version' of $project: [group: $it.group, module: $it.module]\n\nExcludes must specify both group and module and neither can be '*'."
-                            )
-                        }
-                    }
-                }
+  configurations {
+    all {
+      incoming.afterResolve {
+        dependencies.withType(ModuleDependency) { dep ->
+          excludeRules.each {
+            if ([it.group, it.module].any { it == null }) {
+              throw new InvalidUserDataException(
+                "Partial exclude for dependency '$dep.group:$dep.name:$dep.version' of $project: [group: $it.group, module: $it.module]\n\nExcludes must specify both group and module and neither can be '*'."
+              )
             }
+          }
         }
+      }
     }
+  }
 }
 
 def isSnapshot = version.endsWith("-SNAPSHOT")
@@ -61,25 +61,25 @@ def isSnapshot = version.endsWith("-SNAPSHOT")
 def forceLocal = project.hasProperty('forceLocal') && forceLocal
 
 artifactoryPublish { task ->
-    artifactory {
-        publish {
-            contextUrl = forceLocal ? 'http://localhost:8080/artifactory' : 'https://oss.jfrog.org'
-            repository {
-                if(forceLocal)
-                    repoKey = isSnapshot ? 'libs-snapshot-local' : 'libs-release-local'
-                else
-                    repoKey = isSnapshot ? 'oss-snapshot-local' : 'oss-release-local'
-                gradle.taskGraph.whenReady { taskGraph ->
-                    if (taskGraph.hasTask(task)) {
-                        username = bintrayUser
-                        password = bintrayApiKey
-                    }
-                }
-            }
-            defaults {
-                publishConfigs('archives')
-                publishIvy = false
-            }
+  artifactory {
+    publish {
+      contextUrl = forceLocal ? 'http://localhost:8080/artifactory' : 'https://oss.jfrog.org'
+      repository {
+        if (forceLocal)
+          repoKey = isSnapshot ? 'libs-snapshot-local' : 'libs-release-local'
+        else
+          repoKey = isSnapshot ? 'oss-snapshot-local' : 'oss-release-local'
+        gradle.taskGraph.whenReady { taskGraph ->
+          if (taskGraph.hasTask(task)) {
+            username = bintrayUser
+            password = bintrayApiKey
+          }
         }
+      }
+      defaults {
+        publishConfigs('archives')
+        publishIvy = false
+      }
     }
+  }
 }

+ 4 - 4
settings.gradle

@@ -10,10 +10,10 @@ include ':dd-trace-examples'
 include ':dd-trace-annotations'
 
 def setBuildFile(project) {
-    project.buildFileName = "${project.name}.gradle"
-    project.children.each {
-        setBuildFile(it)
-    }
+  project.buildFileName = "${project.name}.gradle"
+  project.children.each {
+    setBuildFile(it)
+  }
 }
 
 setBuildFile(rootProject)