Skip to content

Commit a32e63a

Browse files
authored
Merge branch 'open-telemetry:main' into nocode
2 parents caec176 + 9b97ac7 commit a32e63a

File tree

133 files changed

+2014
-822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+2014
-822
lines changed

.github/renovate.json5

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
'com.gradleup.shadow{/,}**',
7979
],
8080
},
81+
{
82+
groupName: 'guava packages',
83+
matchPackageNames: [
84+
'com.google.guava{/,}**',
85+
],
86+
},
8187
{
8288
groupName: 'jackson packages',
8389
matchPackageNames: [

conventions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555

5656
// When updating, update above in plugins too
5757
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
58-
implementation("com.google.guava:guava:33.4.5-jre")
58+
implementation("com.google.guava:guava:33.4.6-jre")
5959
implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18")
6060
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.6")
6161
implementation("org.apache.httpcomponents:httpclient:4.5.14")

conventions/src/main/kotlin/otel.errorprone-conventions.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies {
1010
}
1111

1212
val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean() ?: false
13+
val testLatestDeps = gradle.startParameter.projectProperties["testLatestDeps"] == "true"
1314

1415
tasks {
1516
withType<JavaCompile>().configureEach {
@@ -123,6 +124,16 @@ tasks {
123124

124125
disable("NonFinalStaticField")
125126

127+
// We get this warning in modules that compile for old java versions
128+
disable("StringConcatToTextBlock")
129+
130+
if (testLatestDeps) {
131+
// Some latest dep tests are compiled for java 17 although the base version uses an older
132+
// version. Disable rules that suggest using new language features.
133+
disable("StatementSwitchToExpressionSwitch")
134+
disable("PatternMatchingInstanceof")
135+
}
136+
126137
if (name.contains("Jmh") || name.contains("Test")) {
127138
// Allow underscore in test-type method names
128139
disable("MemberName")

custom-checks/src/test/java/io/opentelemetry/javaagent/customchecks/OtelInternalJavadocTest.java

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,47 @@ class OtelInternalJavadocTest {
1212

1313
@Test
1414
void test() {
15-
doTest("internal/InternalJavadocPositiveCases.java");
16-
doTest("internal/InternalJavadocNegativeCases.java");
15+
doTest(
16+
"internal/InternalJavadocPositiveCases.java",
17+
"""
18+
package io.opentelemetry.javaagent.customchecks.internal;
19+
20+
// BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers
21+
public class InternalJavadocPositiveCases {
22+
23+
// BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers
24+
public static class One {}
25+
26+
/** Doesn't have the disclaimer. */
27+
// BUG: Diagnostic contains: doesn't end with any of the applicable javadoc disclaimers
28+
public static class Two {}
29+
}
30+
""");
31+
doTest(
32+
"internal/InternalJavadocNegativeCases.java",
33+
"""
34+
package io.opentelemetry.javaagent.customchecks.internal;
35+
36+
/**
37+
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
38+
* any time.
39+
*/
40+
public class InternalJavadocNegativeCases {
41+
42+
/**
43+
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
44+
* any time.
45+
*/
46+
public static class One {}
47+
48+
static class Two {}
49+
}
50+
""");
1751
}
1852

19-
private static void doTest(String path) {
53+
private static void doTest(String path, String... lines) {
2054
CompilationTestHelper.newInstance(OtelInternalJavadoc.class, OtelInternalJavadocTest.class)
21-
.addSourceFile(path)
55+
.addSourceLines(path, lines)
2256
.doTest();
2357
}
2458
}

custom-checks/src/test/resources/io/opentelemetry/javaagent/customchecks/internal/InternalJavadocNegativeCases.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

custom-checks/src/test/resources/io/opentelemetry/javaagent/customchecks/internal/InternalJavadocPositiveCases.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

dependencyManagement/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ val DEPENDENCY_BOMS = listOf(
2929

3030
"com.fasterxml.jackson:jackson-bom:2.18.3",
3131
"com.squareup.okio:okio-bom:3.10.2", // see https://github.com/open-telemetry/opentelemetry-java/issues/5637
32-
"com.google.guava:guava-bom:33.4.0-jre",
32+
"com.google.guava:guava-bom:33.4.6-jre",
3333
"org.apache.groovy:groovy-bom:${groovyVersion}",
3434
"io.opentelemetry:opentelemetry-bom:${otelSdkVersion}",
3535
"io.opentelemetry:opentelemetry-bom-alpha:${otelSdkAlphaVersion}",
@@ -38,7 +38,7 @@ val DEPENDENCY_BOMS = listOf(
3838

3939
val autoServiceVersion = "1.1.1"
4040
val autoValueVersion = "1.11.0"
41-
val errorProneVersion = "2.36.0"
41+
val errorProneVersion = "2.37.0"
4242
val byteBuddyVersion = "1.17.4"
4343
val asmVersion = "9.7.1"
4444
val jmhVersion = "1.37"
@@ -90,7 +90,7 @@ val DEPENDENCIES = listOf(
9090
"com.github.stefanbirkner:system-lambda:1.2.1",
9191
"com.github.stefanbirkner:system-rules:1.19.0",
9292
"uk.org.webcompere:system-stubs-jupiter:2.0.3",
93-
"com.uber.nullaway:nullaway:0.12.4",
93+
"com.uber.nullaway:nullaway:0.12.5",
9494
"commons-beanutils:commons-beanutils:1.10.1",
9595
"commons-cli:commons-cli:1.9.0",
9696
"commons-codec:commons-codec:1.18.0",

docs/contributing/style-guideline.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,7 @@ All parameters and fields which can be `null` should be annotated with `@Nullabl
108108
(specifically `javax.annotation.Nullable`, which is included by the
109109
`otel.java-conventions` gradle plugin as a `compileOnly` dependency).
110110

111-
There is no need to use `@NonNull`, as this is the default, which should be declared in a
112-
`package-info.java` file on the root package of each module, e.g.
113-
114-
```java
115-
@DefaultQualifier(
116-
value = NonNull.class,
117-
locations = {TypeUseLocation.FIELD, TypeUseLocation.PARAMETER, TypeUseLocation.RETURN})
118-
package io.opentelemetry.instrumentation.api;
119-
120-
import org.checkerframework.checker.nullness.qual.NonNull;
121-
import org.checkerframework.framework.qual.DefaultQualifier;
122-
```
111+
There is no need to use `@NonNull`, as this is the default.
123112

124113
Public APIs should still defensively check for `null` parameters, even if the parameter is not
125114
annotated with `@Nullable`. Internal APIs do not need to defensively check for `null` parameters.

0 commit comments

Comments
 (0)