Skip to content

Commit eb48f5d

Browse files
authored
fix all warnings (#1138)
* fix warnings Signed-off-by: Gregor Zeitlinger <[email protected]> * fix warnings Signed-off-by: Gregor Zeitlinger <[email protected]> * fix warnings Signed-off-by: Gregor Zeitlinger <[email protected]> * fix warnings Signed-off-by: Gregor Zeitlinger <[email protected]> --------- Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 68849a8 commit eb48f5d

File tree

48 files changed

+220
-119
lines changed

Some content is hidden

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

48 files changed

+220
-119
lines changed

examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
<build>
4242
<finalName>${project.artifactId}</finalName>
4343
<plugins>
44+
<plugin>
45+
<artifactId>maven-compiler-plugin</artifactId>
46+
<configuration>
47+
<release>17</release>
48+
<source>17</source>
49+
<target>17</target>
50+
<showWarnings>true</showWarnings>
51+
<compilerArgs>
52+
<arg>-Xlint:all</arg>
53+
<arg>-Werror</arg>
54+
</compilerArgs>
55+
</configuration>
56+
</plugin>
4457
<plugin>
4558
<groupId>org.apache.maven.plugins</groupId>
4659
<artifactId>maven-shade-plugin</artifactId>

examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel_exemplars/greeting/GreetingServlet.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
/** Hello World REST servlet, with an example counter and an example histogram. */
1414
public class GreetingServlet extends HttpServlet {
1515

16+
private static final long serialVersionUID = 0L;
17+
1618
private final Random random = new Random(0);
1719

1820
private final Histogram histogram;

examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
<build>
4242
<finalName>${project.artifactId}</finalName>
4343
<plugins>
44+
<plugin>
45+
<artifactId>maven-compiler-plugin</artifactId>
46+
<configuration>
47+
<release>17</release>
48+
<source>17</source>
49+
<target>17</target>
50+
<showWarnings>true</showWarnings>
51+
<compilerArgs>
52+
<arg>-Xlint:all</arg>
53+
<arg>-Werror</arg>
54+
</compilerArgs>
55+
</configuration>
56+
</plugin>
4457
<plugin>
4558
<groupId>org.apache.maven.plugins</groupId>
4659
<artifactId>maven-shade-plugin</artifactId>

examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel_exemplars/app/HelloWorldServlet.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
/** Hello World REST servlet, with an example counter and an example histogram. */
2121
public class HelloWorldServlet extends HttpServlet {
2222

23+
private static final long serialVersionUID = 0L;
24+
2325
private final Random random = new Random(0);
2426

2527
private final Histogram histogram;

examples/example-exporter-multi-target/src/main/java/io/prometheus/metrics/examples/multitarget/SampleMultiCollector.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,10 @@ protected MetricSnapshots collectMetricSnapshots(PrometheusScrapeRequest scrapeR
7171
gaugeBuilder.dataPoint(gaugeDataPointBuilder.build());
7272
}
7373
}
74-
Collection<MetricSnapshot> snaps = new ArrayList<MetricSnapshot>();
74+
Collection<MetricSnapshot<?>> snaps = new ArrayList<>();
7575
snaps.add(counterBuilder.build());
7676
snaps.add(gaugeBuilder.build());
77-
MetricSnapshots msnaps = new MetricSnapshots(snaps);
78-
return msnaps;
77+
return new MetricSnapshots(snaps);
7978
}
8079

8180
public List<String> getPrometheusNames() {

examples/example-exporter-servlet-tomcat/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
<build>
4242
<finalName>${project.artifactId}</finalName>
4343
<plugins>
44+
<plugin>
45+
<artifactId>maven-compiler-plugin</artifactId>
46+
<configuration>
47+
<release>17</release>
48+
<source>17</source>
49+
<target>17</target>
50+
<showWarnings>true</showWarnings>
51+
<compilerArgs>
52+
<arg>-Xlint:all</arg>
53+
<arg>-Werror</arg>
54+
</compilerArgs>
55+
</configuration>
56+
</plugin>
4457
<plugin>
4558
<groupId>org.apache.maven.plugins</groupId>
4659
<artifactId>maven-shade-plugin</artifactId>

examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/HelloWorldServlet.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
/** Hello World REST servlet, with an example counter and an example histogram. */
1515
public class HelloWorldServlet extends HttpServlet {
1616

17+
private static final long serialVersionUID = 0L;
18+
1719
private final Random random = new Random(0);
1820

1921
// Note: The requests_total counter is not a great example, because the

integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@
3636
<build>
3737
<finalName>exporter-servlet-tomcat-sample</finalName>
3838
<plugins>
39+
<plugin>
40+
<artifactId>maven-compiler-plugin</artifactId>
41+
<configuration>
42+
<release>17</release>
43+
<source>17</source>
44+
<target>17</target>
45+
<showWarnings>true</showWarnings>
46+
<compilerArgs>
47+
<arg>-Xlint:all</arg>
48+
<arg>-Werror</arg>
49+
</compilerArgs>
50+
</configuration>
51+
</plugin>
3952
<plugin>
4053
<groupId>org.apache.maven.plugins</groupId>
4154
<artifactId>maven-shade-plugin</artifactId>

pom.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
</plugin>
126126
<plugin>
127127
<artifactId>maven-compiler-plugin</artifactId>
128-
<version>3.1</version>
128+
<version>3.13.0</version>
129129
</plugin>
130130
<plugin>
131131
<artifactId>maven-surefire-plugin</artifactId>
@@ -270,8 +270,14 @@
270270
<plugin>
271271
<artifactId>maven-compiler-plugin</artifactId>
272272
<configuration>
273-
<source>1.8</source>
274-
<target>1.8</target>
273+
<release>8</release>
274+
<source>8</source>
275+
<target>8</target>
276+
<showWarnings>true</showWarnings>
277+
<compilerArgs>
278+
<arg>-Xlint:all</arg>
279+
<arg>-Werror</arg>
280+
</compilerArgs>
275281
</configuration>
276282
</plugin>
277283
<plugin>

prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
public class PrometheusPropertiesException extends RuntimeException {
44

5+
private static final long serialVersionUID = 0L;
6+
57
public PrometheusPropertiesException(String msg) {
68
super(msg);
79
}

0 commit comments

Comments
 (0)