Skip to content

Commit f58fa79

Browse files
authored
Review fixes for jsp-2.3:javaagent (open-telemetry#17482)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
1 parent 3b2944f commit f58fa79

6 files changed

Lines changed: 8 additions & 10 deletions

File tree

instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/HttpJspPageInstrumentationSingletons.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import javax.servlet.http.HttpServletRequest;
2424
import javax.servlet.jsp.HttpJspPage;
2525

26-
public class HttpJspPageInstrumentationSingletons {
26+
class HttpJspPageInstrumentationSingletons {
2727
private static final boolean CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES =
2828
DeclarativeConfigUtil.getInstrumentationConfig(GlobalOpenTelemetry.get(), "jsp")
2929
.getBoolean("experimental_span_attributes/development", false);
@@ -51,7 +51,7 @@ private static String spanNameOnRender(HttpServletRequest req) {
5151
return "Render " + spanName;
5252
}
5353

54-
public static Instrumenter<HttpServletRequest, Void> instrumenter() {
54+
static Instrumenter<HttpServletRequest, Void> instrumenter() {
5555
return instrumenter;
5656
}
5757

instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/JspCompilationContextInstrumentationSingletons.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.apache.jasper.JspCompilationContext;
1818
import org.apache.jasper.compiler.Compiler;
1919

20-
public class JspCompilationContextInstrumentationSingletons {
20+
class JspCompilationContextInstrumentationSingletons {
2121
private static final boolean CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES =
2222
DeclarativeConfigUtil.getInstrumentationConfig(GlobalOpenTelemetry.get(), "jsp")
2323
.getBoolean("experimental_span_attributes/development", false);
@@ -35,11 +35,11 @@ public class JspCompilationContextInstrumentationSingletons {
3535
.buildInstrumenter(SpanKindExtractor.alwaysInternal());
3636
}
3737

38-
public static String spanNameOnCompile(JspCompilationContext jspCompilationContext) {
38+
private static String spanNameOnCompile(JspCompilationContext jspCompilationContext) {
3939
return "Compile " + jspCompilationContext.getJspFile();
4040
}
4141

42-
public static Instrumenter<JspCompilationContext, Void> instrumenter() {
42+
static Instrumenter<JspCompilationContext, Void> instrumenter() {
4343
return instrumenter;
4444
}
4545

instrumentation/jsp-2.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jsp/JspInstrumentationBasicTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ protected Tomcat setupServer() throws Exception {
6868
tomcatServer.setPort(port);
6969
tomcatServer.getConnector();
7070

71-
// comment to debug
7271
tomcatServer.setSilent(true);
7372

7473
// this is needed in tomcat 9, this triggers the creation of a connector, will not

instrumentation/jsp-2.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jsp/JspInstrumentationForwardTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ protected Tomcat setupServer() throws Exception {
5858
tomcatServer.setPort(port);
5959
tomcatServer.getConnector();
6060

61-
// comment to debug
6261
tomcatServer.setSilent(true);
6362

6463
// this is needed in tomcat 9, this triggers the creation of a connector, will not

instrumentation/jsp-2.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jsp/JspSpan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void setExceptionClass(Class<?> exceptionClass) {
8282
this.exceptionClass = exceptionClass;
8383
}
8484

85-
public boolean getErrorMessageOptional() {
85+
public boolean isErrorMessageOptional() {
8686
return errorMessageOptional;
8787
}
8888

instrumentation/jsp-2.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jsp/JspSpanAssertions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void assertServerSpan(SpanDataAssert span, JspSpan spanData) {
6969
EXCEPTION_MESSAGE,
7070
val ->
7171
val.satisfiesAnyOf(
72-
v -> assertThat(spanData.getErrorMessageOptional()).isTrue(),
72+
v -> assertThat(spanData.isErrorMessageOptional()).isTrue(),
7373
v -> val.isInstanceOf(String.class))),
7474
satisfies(EXCEPTION_STACKTRACE, val -> val.isInstanceOf(String.class))));
7575
}
@@ -146,7 +146,7 @@ void assertRenderSpan(SpanDataAssert span, JspSpan spanData) {
146146
EXCEPTION_MESSAGE,
147147
val ->
148148
val.satisfiesAnyOf(
149-
v -> assertThat(spanData.getErrorMessageOptional()).isTrue(),
149+
v -> assertThat(spanData.isErrorMessageOptional()).isTrue(),
150150
v -> val.isInstanceOf(String.class))),
151151
satisfies(EXCEPTION_STACKTRACE, val -> val.isInstanceOf(String.class))));
152152
}

0 commit comments

Comments
 (0)