Skip to content

Commit ac7fe5f

Browse files
Bump com.google.errorprone:error_prone_core from 2.36.0 to 2.37.0 (#1311)
Bumps [com.google.errorprone:error_prone_core](https://github.com/google/error-prone) from 2.36.0 to 2.37.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/google/error-prone/releases">com.google.errorprone:error_prone_core's releases</a>.</em></p> <blockquote> <h2>Error Prone 2.37.0</h2> <p>Changes:</p> <ul> <li>The annotations that were previously in <code>error_prone_type_annotations</code> have been been merged into <code>error_prone_annotations</code>. <code>error_prone_type_annotations</code> is now deprecated, and will be removed in a future release.</li> </ul> <p>New checks:</p> <ul> <li><a href="https://errorprone.info/bugpattern/AssignmentExpression"><code>AssignmentExpression</code></a> - The use of an assignment expression can be surprising and hard to read; consider factoring out the assignment to a separate statement.</li> <li><a href="https://errorprone.info/bugpattern/IntFloatConversion"><code>IntFloatConversion</code></a> - Detect calls to <code>scalb</code> that should be using the double overload instead</li> <li><a href="https://errorprone.info/bugpattern/InvalidSnippet"><code>InvalidSnippet</code></a> - Detects snippets which omit the <code>:</code> required for inline code.</li> <li><a href="https://errorprone.info/bugpattern/JUnit4EmptyMethods"><code>JUnit4EmptyMethods</code></a> - Detects empty JUnit4 <code>@before</code>, <code>@after</code>, <code>@BeforeClass</code>, and <code>@afterclass</code> methods.</li> <li><a href="https://errorprone.info/bugpattern/MockIllegalThrows"><code>MockIllegalThrows</code></a> - Detects cases where Mockito is configured to throw checked exception types which are impossible.</li> <li><a href="https://errorprone.info/bugpattern/NegativeBoolean"><code>NegativeBoolean</code></a> - Prefer positive boolean names.</li> <li><a href="https://errorprone.info/bugpattern/RuleNotRun"><code>RuleNotRun</code></a> - Detects <code>TestRule</code>s not annotated with <code>@rule</code>, that won't be run.</li> <li><a href="https://errorprone.info/bugpattern/StringConcatToTextBlock"><code>StringConcatToTextBlock</code></a> - Replaces concatenated multiline strings with text blocks.</li> <li><a href="https://errorprone.info/bugpattern/TimeInStaticInitializer"><code>TimeInStaticInitializer</code></a> - Detects accesses of the system time in static contexts.</li> </ul> <p>Closed issues:</p> <ul> <li>Propagate check flags in patch mode (<a href="https://redirect.github.com/google/error-prone/issues/4699">#4699</a>)</li> <li>Fixes a crash in ComputeIfAbsentAmbiguousReference (<a href="https://redirect.github.com/google/error-prone/issues/4736">#4736</a>)</li> <li>Show the field name in HidingField diagnostics (<a href="https://redirect.github.com/google/error-prone/issues/4775">#4775</a>)</li> <li>Add support for jakarta annotations to some checks (<a href="https://redirect.github.com/google/error-prone/issues/4782">#4782</a>)</li> <li>FloatingPointAssertionWithinEpsilonTest depends on default locale (<a href="https://redirect.github.com/google/error-prone/issues/4815">#4815</a>)</li> <li><code>@InlineMe</code> patching of <code>Strings.repeat</code> produces broken code (<a href="https://redirect.github.com/google/error-prone/issues/4819">#4819</a>)</li> <li>Fix a crash in IdentifierName on unnamed (<code>_</code>) variables (<a href="https://redirect.github.com/google/error-prone/issues/4847">#4847</a>)</li> <li>Fix a crash in ArgumentParameterSwap (<a href="https://redirect.github.com/google/error-prone/issues/490">#490</a>)</li> </ul> <p>Full changelog: <a href="https://github.com/google/error-prone/compare/v2.36.0...v2.37.0">https://github.com/google/error-prone/compare/v2.36.0...v2.37.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/google/error-prone/commit/a453935902c54691dc729607977a533bef0a4d2d"><code>a453935</code></a> Release Error Prone 2.37.0</li> <li><a href="https://github.com/google/error-prone/commit/81faa5aed9cc3ddb38ff97d2ef497e44cd289c0d"><code>81faa5a</code></a> Update JDK versions in release.yml</li> <li><a href="https://github.com/google/error-prone/commit/62086b7aebcda62d901434ff6a445b0ec68ac75a"><code>62086b7</code></a> Handle multiple arguments in <code>thenThrow</code>.</li> <li><a href="https://github.com/google/error-prone/commit/7440ff184cb9ba73cea6d1065604ba776233abcd"><code>7440ff1</code></a> In StringConcatToTextBlock, don't assume that string literals always have sou...</li> <li><a href="https://github.com/google/error-prone/commit/04fe8357e885ff17990b0558379bbe158397b23c"><code>04fe835</code></a> Adds type_annotations back but as a relocation to annotations</li> <li><a href="https://github.com/google/error-prone/commit/1ad73c255adec4a7c4bb2579f1cfdef2c02cc73b"><code>1ad73c2</code></a> Handle <code>yield</code> in Reachability</li> <li><a href="https://github.com/google/error-prone/commit/b1b521fb8ccac4443d40d4995b2840c48ef3350f"><code>b1b521f</code></a> Sniff out the canonical constructor using detective work rather than a flag w...</li> <li><a href="https://github.com/google/error-prone/commit/86e5c95f8bbf2ed00f43fe5f17ca3eaeb97c6f0f"><code>86e5c95</code></a> Optimization: Abort class scan in <code>JUnit4TestNotRun</code> if all suspicious method...</li> <li><a href="https://github.com/google/error-prone/commit/c139e7f6bcd655388d0976d28083f0153ba1036c"><code>c139e7f</code></a> [StatementSwitchToExpressionSwitch] for the return switch pattern, fix a bug ...</li> <li><a href="https://github.com/google/error-prone/commit/296fb4e0e4752c7c2e9752da612224d40ecdf2d1"><code>296fb4e</code></a> Hardcode <code>BoxedPrimitiveEquality:ExemptStaticConstants = false</code>.</li> <li>Additional commits viewable in <a href="https://github.com/google/error-prone/compare/v2.36.0...v2.37.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.google.errorprone:error_prone_core&package-manager=maven&previous-version=2.36.0&new-version=2.37.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Gregor Zeitlinger <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gregor Zeitlinger <[email protected]>
1 parent 8595e87 commit ac7fe5f

File tree

21 files changed

+799
-627
lines changed

21 files changed

+799
-627
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you're getting errors when running tests:
3030
- Use `-Dcheckstyle.skip=true` to skip the checkstyle check during development.
3131
- Use `-Dwarnings=-nowarn` to skip the warnings during development.
3232

33-
Combine all with `mvn test -DskipTests=true -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn`.
33+
Combine all with `./mvnw test -DskipTests=true -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn`.
3434

3535
## Updating the Protobuf Java Classes
3636

mise.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ run = [
1313
"./mvnw javadoc:javadoc -P javadoc"
1414
]
1515
env = { PROTO_GENERATION = "true", REQUIRE_PROTO_UP_TO_DATE = "true" }
16+
17+
[tasks.format]
18+
description = "format source code"
19+
run = "./mvnw spotless:apply"
20+
21+
[tasks.test]
22+
description = "run unit tests, ignoring formatting and linters"
23+
run = "./mvnw test -DskipTests=true -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
24+
25+
[tasks.test-all]
26+
description = "run all tests"
27+
run = "./mvnw verify"

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@
370370
<path>
371371
<groupId>com.google.errorprone</groupId>
372372
<artifactId>error_prone_core</artifactId>
373-
<version>2.36.0</version>
373+
<version>2.37.0</version>
374374
</path>
375375
<!-- Other annotation processors go here.
376376

prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterTest.java

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -216,34 +216,24 @@ public void testExemplarSampler() throws Exception {
216216

217217
@Override
218218
public String getCurrentTraceId() {
219-
switch (callNumber) {
220-
case 1:
221-
return "abc";
222-
case 3:
223-
return "def";
224-
case 4:
225-
return "123";
226-
case 5:
227-
return "bab";
228-
default:
229-
throw new RuntimeException("unexpected call");
230-
}
219+
return switch (callNumber) {
220+
case 1 -> "abc";
221+
case 3 -> "def";
222+
case 4 -> "123";
223+
case 5 -> "bab";
224+
default -> throw new RuntimeException("unexpected call");
225+
};
231226
}
232227

233228
@Override
234229
public String getCurrentSpanId() {
235-
switch (callNumber) {
236-
case 1:
237-
return "123";
238-
case 3:
239-
return "456";
240-
case 4:
241-
return "abc";
242-
case 5:
243-
return "cdc";
244-
default:
245-
throw new RuntimeException("unexpected call");
246-
}
230+
return switch (callNumber) {
231+
case 1 -> "123";
232+
case 3 -> "456";
233+
case 4 -> "abc";
234+
case 5 -> "cdc";
235+
default -> throw new RuntimeException("unexpected call");
236+
};
247237
}
248238

249239
@Override

prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeTest.java

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -120,34 +120,24 @@ public void testExemplarSampler() throws Exception {
120120

121121
@Override
122122
public String getCurrentTraceId() {
123-
switch (callNumber) {
124-
case 1:
125-
return "abc";
126-
case 3:
127-
return "def";
128-
case 4:
129-
return "123";
130-
case 5:
131-
return "bab";
132-
default:
133-
throw new RuntimeException("unexpected call");
134-
}
123+
return switch (callNumber) {
124+
case 1 -> "abc";
125+
case 3 -> "def";
126+
case 4 -> "123";
127+
case 5 -> "bab";
128+
default -> throw new RuntimeException("unexpected call");
129+
};
135130
}
136131

137132
@Override
138133
public String getCurrentSpanId() {
139-
switch (callNumber) {
140-
case 1:
141-
return "123";
142-
case 3:
143-
return "456";
144-
case 4:
145-
return "abc";
146-
case 5:
147-
return "cdc";
148-
default:
149-
throw new RuntimeException("unexpected call");
150-
}
134+
return switch (callNumber) {
135+
case 1 -> "123";
136+
case 3 -> "456";
137+
case 4 -> "abc";
138+
case 5 -> "cdc";
139+
default -> throw new RuntimeException("unexpected call");
140+
};
151141
}
152142

153143
@Override

prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/HistogramTest.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -922,22 +922,24 @@ public void testDefaults() throws IOException {
922922
+ "} }";
923923
String expectedTextFormat =
924924
// default classic buckets
925-
"# TYPE test histogram\n"
926-
+ "test_bucket{le=\"0.005\"} 0\n"
927-
+ "test_bucket{le=\"0.01\"} 0\n"
928-
+ "test_bucket{le=\"0.025\"} 0\n"
929-
+ "test_bucket{le=\"0.05\"} 0\n"
930-
+ "test_bucket{le=\"0.1\"} 0\n"
931-
+ "test_bucket{le=\"0.25\"} 0\n"
932-
+ "test_bucket{le=\"0.5\"} 1\n"
933-
+ "test_bucket{le=\"1.0\"} 1\n"
934-
+ "test_bucket{le=\"2.5\"} 1\n"
935-
+ "test_bucket{le=\"5.0\"} 1\n"
936-
+ "test_bucket{le=\"10.0\"} 1\n"
937-
+ "test_bucket{le=\"+Inf\"} 1\n"
938-
+ "test_count 1\n"
939-
+ "test_sum 0.5\n"
940-
+ "# EOF\n";
925+
"""
926+
# TYPE test histogram
927+
test_bucket{le="0.005"} 0
928+
test_bucket{le="0.01"} 0
929+
test_bucket{le="0.025"} 0
930+
test_bucket{le="0.05"} 0
931+
test_bucket{le="0.1"} 0
932+
test_bucket{le="0.25"} 0
933+
test_bucket{le="0.5"} 1
934+
test_bucket{le="1.0"} 1
935+
test_bucket{le="2.5"} 1
936+
test_bucket{le="5.0"} 1
937+
test_bucket{le="10.0"} 1
938+
test_bucket{le="+Inf"} 1
939+
test_count 1
940+
test_sum 0.5
941+
# EOF
942+
""";
941943

942944
// protobuf
943945
Metrics.MetricFamily protobufData = new PrometheusProtobufWriterImpl().convert(snapshot);

prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/DefaultHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ public class DefaultHandler implements HttpHandler {
1313

1414
public DefaultHandler() {
1515
String responseString =
16-
""
17-
+ "<html>\n"
16+
"<html>\n"
1817
+ "<head><title>Prometheus Java Client</title></head>\n"
1918
+ "<body>\n"
2019
+ "<h1>Prometheus Java Client</h1>\n"

0 commit comments

Comments
 (0)