Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .baseline/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VariableDeclarationUsageDistance" />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="VisibilityModifier" />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" checks="AvoidStaticImport" />

<!-- Copied Guava classes. -->
<suppress files="[/\\]src[/\\].*(WrappingExecutorService.java)" checks="." />
<suppress files="[/\\]src[/\\].*(WrappingScheduledExecutorService.java)" checks="." />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemOut" />
<suppress files="[/\\]src[/\\].*[Tt]est[/\\](java|groovy)[/\\]" id="BanSystemErr" />

<!-- JavadocStyle enforces existence of package-info.java package-level Javadoc; we consider this a bug. -->
<suppress files="package-info.java" checks="JavadocStyle" />
Expand Down
57 changes: 43 additions & 14 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
<property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
</module>
<module name="SuppressWarningsFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="TreeWalker">
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="AbbreviationAsWordInName"> <!-- Java Style Guide: Camel case : defined -->
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
Expand Down Expand Up @@ -105,7 +105,6 @@
<module name="EmptyStatement"/> <!-- Java Style Guide: One statement per line -->
<module name="EqualsHashCode"/>
<module name="FallThrough"/> <!-- Java Style Guide: Fall-through: commented -->
<module name="FileContentsHolder"/> <!-- Required for SuppressionCommentFilter -->
<module name="FinalClass"/> <!-- Java Coding Guidelines: Private constructors -->
<module name="GenericWhitespace"> <!-- Java Style Guide: Horizontal whitespace -->
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
Expand All @@ -124,11 +123,17 @@
<message key="import.illegal" value="Use JUnit 4-style (org.junit.*) test classes and assertions instead of JUnit 3 (junit.framework.*)."/>
</module>
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
<property name="illegalPkgs" value="org.elasticsearch.common.base, jersey.repackaged.com.google.common, com.google.api.client.repackaged, org.apache.hadoop.thirdparty.guava, com.clearspring.analytics.util, org.spark_project.guava"/>
<property name="illegalPkgs" value="org.elasticsearch.common.base, com.clearspring.analytics.util, org.spark_project.guava"/>
<message key="import.illegal" value="Must not import repackaged classes."/>
</module>
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
<property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/>
<property name="regexp" value="true" />
<message key="import.illegal" value="Must not import repackaged classes."/>
</module>
<module name="IllegalImport">
<property name="illegalPkgs" value="^org\.gradle\..*internal"/>
<property name="illegalPkgs" value="^org\.gradle\.(internal|.*\.internal)"/>
<property name="regexp" value="true" />
<message key="import.illegal" value="Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead."/>
</module>
<module name="IllegalImport">
Expand All @@ -144,6 +149,7 @@
<message key="import.illegal" value="math is deprecated, use math3 instead."/>
</module>
<module name="IllegalImport">
<property name="id" value="BanLoggingImplementations"/>
<property name="illegalPkgs" value="org.apache.log4j, org.apache.logging.log4j, java.util.logging, ch.qos.logback"/>
<message key="import.illegal" value="Use SLF4J instead of a logging framework directly."/>
</module>
Expand All @@ -165,19 +171,23 @@
<module name="IllegalType"> <!-- Java Coding Guide: Limit coupling on concrete classes -->
<property name="illegalClassNames" value="java.util.ArrayList, java.util.HashSet, java.util.HashMap, java.util.LinkedList, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeSet, java.util.TreeMap, com.google.common.collect.ArrayListMultimap, com.google.common.collect.ForwardingListMultimap, com.google.common.collect.ForwardingMultimap, com.google.common.collect.ForwardingSetMultimap, com.google.common.collect.ForwardingSortedSetMultimap, com.google.common.collect.HashMultimap, com.google.common.collect.LinkedHashMultimap, com.google.common.collect.LinkedListMultimap, com.google.common.collect.TreeMultimap"/>
</module>
<module name="IllegalType">
<property name="id" value="BanGuavaCaches"/>
<property name="illegalClassNames" value="com.google.common.cache.CacheBuilder, com.google.common.cache.Cache, com.google.common.cache.LoadingCache"/>
<message key="illegal.type" value="Do not use Guava caches, they are outperformed by and harder to use than Caffeine caches"/>
</module>
<module name="ImportOrder"> <!-- Java Style Guide: Ordering and spacing -->
<property name="groups" value="/.*/"/>
<property name="option" value="top"/>
<property name="separated" value="true"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>
<module name="Indentation"> <!-- Java Style Guide: Block indentation: +4 spaces -->
<property name="arrayInitIndent" value="8"/>
<property name="lineWrappingIndentation" value="8"/>
</module>
<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
<module name="LeftCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<property name="maxLineLength" value="120"/>
</module>
<module name="LeftCurly"/> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
Expand Down Expand Up @@ -265,6 +275,11 @@
<property name="format" value="CoreMatchers\.equalTo"/>
<property name="message" value="Use Assert.assertEquals()."/>
</module>
<module name="RegexpSinglelineJava">
<property name="id" value="BanJacksonFindAndRegisterModulesMethod"/>
<property name="format" value="findAndRegisterModules"/>
<property name="message" value="Use ObjectMapper#registerModule(&lt;yourModule&gt;) explicitly. ObjectMapper#findAndRegisterModules() is dangerous because it will change behaviour depending on which modules are on your classpath (including transitive dependencies)."/>
</module>
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
<property name="format" value="CoreMatchers\.notNull"/>
<property name="message" value="Use better assertion method(s): Assert.assertEquals(), assertNull(), assertSame(), etc."/>
Expand Down Expand Up @@ -315,6 +330,18 @@
<property name="message" value="printStackTrace is not generally allowed."/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="id" value="BanSystemOut"/>
<property name="format" value="System\.out\."/>
<property name="message" value="Logging with System.out is not allowed because it has no metadata and can't be configured at runtime. Please use an SLF4J logger instead, e.g. log.info(&quot;Message&quot;)."/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="id" value="BanSystemErr"/>
<property name="format" value="System\.err\."/>
<property name="message" value="Logging with System.err is not allowed because it has no metadata and can't be configured at runtime. Please use an SLF4J logger instead, e.g. log.info(&quot;Message&quot;)."/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="\bCharsets\."/>
<property name="message" value="Use JDK StandardCharsets instead of alternatives."/>
Expand All @@ -333,7 +360,7 @@
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
<property name="message" value="TODO format: // TODO(flastname): explanation"/>
<property name="message" value="TODO format: // TODO(#issue): explanation"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
Expand Down Expand Up @@ -392,7 +419,9 @@
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="CyclomaticComplexity"/> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity -->
<module name="DesignForExtension"/> <!-- Java Coding Guidelines: Design for extension -->
<module name="DesignForExtension"> <!-- Java Coding Guidelines: Design for extension -->
<property name="ignoredAnnotations" value="Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
</module>
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
Expand Down
44 changes: 7 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,56 +17,36 @@
buildscript {
repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://palantir.bintray.com/releases" }
}

dependencies {
classpath 'gradle.plugin.com.palantir:gradle-circle-style:1.1.2'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.3'
classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:4.9.5'
classpath 'com.netflix.nebula:nebula-dependency-recommender:6.0.0'
classpath 'com.netflix.nebula:nebula-publishing-plugin:5.1.5'
classpath 'com.palantir.baseline:gradle-baseline-java:0.24.0'
classpath 'com.palantir.configurationresolver:gradle-configuration-resolver-plugin:0.3.0'
classpath 'com.palantir.baseline:gradle-baseline-java:0.37.4'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.11.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:2.0.0'
}
}

plugins {
id 'com.palantir.git-version' version '0.11.0'
id 'org.inferred.processors' version '1.2.15'
}

apply plugin: 'com.palantir.baseline-config' // provides baselineUpdateConfig task
apply plugin: 'com.palantir.baseline-idea'
apply plugin: 'com.palantir.circle.style'
apply plugin: 'com.palantir.git-version'
apply plugin: 'com.palantir.baseline'

repositories {
maven { url "http://palantir.bintray.com/releases" }
}

dependencies {
baseline "com.palantir.baseline:gradle-baseline-java-config:0.24.0@zip"
}

allprojects {
version gitVersion()
group 'com.palantir.tracing'

apply plugin: 'com.palantir.configuration-resolver'
apply plugin: 'nebula.dependency-recommender'
dependencyRecommendations {
strategy OverrideTransitives
propertiesFile file: project.rootProject.file('versions.props')
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'com.palantir.baseline-checkstyle'
apply plugin: 'com.palantir.baseline-eclipse'
apply plugin: 'com.palantir.baseline-idea'
apply plugin: 'com.palantir.baseline-error-prone'
apply plugin: "org.inferred.processors"

repositories {
jcenter()
Expand Down Expand Up @@ -105,14 +85,4 @@ subprojects {
}
}
tasks.check.dependsOn(javadoc)

configurations.errorprone {
resolutionStrategy {
force 'com.google.guava:guava:21.0'
}
}

tasks.withType(JavaCompile) {
options.compilerArgs += ['-XepDisableWarningsInGeneratedCode']
}
}
5 changes: 2 additions & 3 deletions tracing-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
apply plugin: "org.inferred.processors"

apply from: "$rootDir/gradle/publish-jar.gradle"

dependencies {
Expand All @@ -10,5 +8,6 @@ dependencies {
testCompile "org.mockito:mockito-core"
testCompile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml"

processor "org.immutables:value"
annotationProcessor "org.immutables:value"
compileOnly "org.immutables:value::annotations"
}
3 changes: 3 additions & 0 deletions tracing-api/versions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
"com.fasterxml.jackson.core:jackson-databind": {
"locked": "2.9.5"
},
"org.immutables:value": {
"locked": "2.3.10"
}
},
"runtime": {
Expand Down
3 changes: 2 additions & 1 deletion tracing-jaxrs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ dependencies {
testCompile "org.jmock:jmock"
testCompile "org.mockito:mockito-core"

processor "org.immutables:value"
annotationProcessor "org.immutables:value"
compileOnly "org.immutables:value::annotations"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class JaxRsTracersTest {
@Test
public void testWrappingStreamingOutput_streamingOutputTraceIsIsolated() throws Exception {
Tracer.startSpan("outside");
StreamingOutput streamingOutput = JaxRsTracers.wrap((os) -> {
StreamingOutput streamingOutput = JaxRsTracers.wrap(os -> {
Tracer.startSpan("inside"); // never completed
});
streamingOutput.write(new ByteArrayOutputStream());
Expand All @@ -38,7 +38,7 @@ public void testWrappingStreamingOutput_streamingOutputTraceIsIsolated() throws
@Test
public void testWrappingStreamingOutput_traceStateIsCapturedAtConstructionTime() throws Exception {
Tracer.startSpan("before-construction");
StreamingOutput streamingOutput = JaxRsTracers.wrap((os) -> {
StreamingOutput streamingOutput = JaxRsTracers.wrap(os -> {
assertThat(Tracer.completeSpan().get().getOperation()).isEqualTo("before-construction");
});
Tracer.startSpan("after-construction");
Expand Down
67 changes: 65 additions & 2 deletions tracing-jaxrs/versions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,31 @@
"com.palantir.tracing:tracing"
]
},
"com.google.code.findbugs:jsr305": {
"locked": "1.3.9",
"transitive": [
"com.google.guava:guava"
]
},
"com.google.errorprone:error_prone_annotations": {
"locked": "2.1.3",
"transitive": [
"com.google.guava:guava"
]
},
"com.google.guava:guava": {
"locked": "20.0",
"locked": "23.6.1-jre",
"transitive": [
"com.fasterxml.jackson.datatype:jackson-datatype-guava",
"com.palantir.tracing:tracing"
]
},
"com.google.j2objc:j2objc-annotations": {
"locked": "1.1",
"transitive": [
"com.google.guava:guava"
]
},
"com.palantir.safe-logging:safe-logging": {
"locked": "1.3.0",
"transitive": [
Expand All @@ -68,6 +86,21 @@
"javax.ws.rs:javax.ws.rs-api": {
"locked": "2.0.1"
},
"org.checkerframework:checker-compat-qual": {
"locked": "2.0.0",
"transitive": [
"com.google.guava:guava"
]
},
"org.codehaus.mojo:animal-sniffer-annotations": {
"locked": "1.14",
"transitive": [
"com.google.guava:guava"
]
},
"org.immutables:value": {
"locked": "2.3.10"
},
"org.slf4j:slf4j-api": {
"locked": "1.7.12",
"transitive": [
Expand Down Expand Up @@ -119,13 +152,31 @@
"com.palantir.tracing:tracing"
]
},
"com.google.code.findbugs:jsr305": {
"locked": "1.3.9",
"transitive": [
"com.google.guava:guava"
]
},
"com.google.errorprone:error_prone_annotations": {
"locked": "2.1.3",
"transitive": [
"com.google.guava:guava"
]
},
"com.google.guava:guava": {
"locked": "20.0",
"locked": "23.6.1-jre",
"transitive": [
"com.fasterxml.jackson.datatype:jackson-datatype-guava",
"com.palantir.tracing:tracing"
]
},
"com.google.j2objc:j2objc-annotations": {
"locked": "1.1",
"transitive": [
"com.google.guava:guava"
]
},
"com.palantir.safe-logging:safe-logging": {
"locked": "1.3.0",
"transitive": [
Expand All @@ -144,6 +195,18 @@
"javax.ws.rs:javax.ws.rs-api": {
"locked": "2.0.1"
},
"org.checkerframework:checker-compat-qual": {
"locked": "2.0.0",
"transitive": [
"com.google.guava:guava"
]
},
"org.codehaus.mojo:animal-sniffer-annotations": {
"locked": "1.14",
"transitive": [
"com.google.guava:guava"
]
},
"org.slf4j:slf4j-api": {
"locked": "1.7.12",
"transitive": [
Expand Down
3 changes: 0 additions & 3 deletions tracing-jersey/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* limitations under the License.
*/


apply plugin: 'org.inferred.processors'

apply from: "${rootDir}/gradle/publish-jar.gradle"

dependencies {
Expand Down
Loading