Skip to content

Commit 5e9a6ee

Browse files
committed
spotless
1 parent 8ad80fa commit 5e9a6ee

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

instrumentation/ratpack/ratpack-1.4/testing/src/main/java/io/opentelemetry/instrumentation/ratpack/client/AbstractRatpackHttpClientTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,17 @@ private static Throwable nettyClientSpanErrorMapper(URI uri, Throwable exception
178178
// to align with the span emitted by the Netty instrumentation ("connection timed out") on
179179
// Linux. Prefer the wrapped cause when available, otherwise synthesize the expected message.
180180
Throwable cause = exception.getCause();
181-
if (cause instanceof ConnectTimeoutException || cause instanceof PrematureChannelClosureException) {
181+
if (cause instanceof ConnectTimeoutException
182+
|| cause instanceof PrematureChannelClosureException) {
182183
return cause;
183184
}
184185
if (exception instanceof ConnectTimeoutException
185186
|| exception instanceof PrematureChannelClosureException) {
186187
return exception;
187188
}
188189
if ("https".equalsIgnoreCase(uri.getScheme())) {
189-
return new PrematureChannelClosureException("channel gone inactive with 1 missing response(s)");
190+
return new PrematureChannelClosureException(
191+
"channel gone inactive with 1 missing response(s)");
190192
}
191193
int port = uri.getPort();
192194
if (port == -1) {

instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ProcessResource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ private static Resource doBuildResource() {
9393
attributes.put(PROCESS_EXECUTABLE_PATH, executablePath.toString());
9494

9595
String[] args = ProcessArguments.getProcessArguments();
96-
// This will only work with Java 9+ and Linux but provides everything except the executablePath.
96+
// This will only work with Java 9+ and Linux but provides everything except the
97+
// executablePath.
9798
// Argument array may be empty on Java 9+ when the command line is too long, see
9899
// https://bugs.openjdk.org/browse/JDK-8345117
99100
if (args.length > 0) {

instrumentation/resources/library/src/test/java/io/opentelemetry/instrumentation/resources/internal/ResourceDeclarativeConfigTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ void endToEnd() {
7070
assertThat(attributeKeys).contains("os.type");
7171
// ProcessResourceComponentProvider
7272
assertThat(attributeKeys)
73-
.contains(java8 || OS.WINDOWS.isCurrentOs() ? "process.command_line" : "process.command_args");
73+
.contains(
74+
java8 || OS.WINDOWS.isCurrentOs()
75+
? "process.command_line"
76+
: "process.command_args");
7477
assertThat(attributeKeys).contains("process.executable.path");
7578
assertThat(attributeKeys).contains("process.pid");
7679
// ProcessRuntimeResourceComponentProvider

javaagent-bootstrap/src/test/java/io/opentelemetry/javaagent/bootstrap/AgentClassLoaderTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.net.URL;
1414
import java.util.concurrent.Phaser;
1515
import org.junit.jupiter.api.Test;
16+
import org.junit.jupiter.api.condition.DisabledOnOs;
1617
import org.junit.jupiter.api.condition.OS;
1718

1819
class AgentClassLoaderTest {
@@ -83,6 +84,9 @@ private static Object getClassLoadingLock(ClassLoader classLoader, String classN
8384
}
8485

8586
@Test
87+
@DisabledOnOs(
88+
value = OS.WINDOWS,
89+
disabledReason = "Windows reports empty process arguments even on Java 9+")
8690
void multiReleaseJar() throws Exception {
8791
boolean jdk8 = "1.8".equals(System.getProperty("java.specification.version"));
8892
Class<?> mrJarClass =
@@ -112,12 +116,8 @@ protected String getClassSuffix() {
112116
Method method = clazz.getDeclaredMethod("getProcessArguments");
113117
method.setAccessible(true);
114118
String[] result = (String[]) method.invoke(null);
115-
// jdk8 versions returns empty array, jdk9 version may return empty on Windows due to
116-
// ProcessHandle.current().info().arguments() not being available on all platforms
117-
if (!jdk8 && !OS.WINDOWS.isCurrentOs()) {
118-
// on non-jdk8 and non-Windows, we should get process arguments
119-
assertThat(result.length > 0).isTrue();
120-
}
119+
// jdk8 versions returns empty array, jdk9 version does not
120+
assertThat(result.length > 0).isNotEqualTo(jdk8);
121121
}
122122
}
123123
}

0 commit comments

Comments
 (0)