Skip to content

Commit

Permalink
Solving conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos committed Nov 16, 2022
2 parents 8557364 + f3b808e commit 21c2ed9
Show file tree
Hide file tree
Showing 33 changed files with 263 additions and 245 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -218,7 +218,8 @@ private boolean parseHttpChunkLength(final ByteBuffer input) throws ParseExcepti

while (offset < limit) {
final byte b = input.get(offset);
if (isSpaceOrTab(b) || /*trailing spaces are not allowed by the spec, but some server put it there*/
if (isSpaceOrTab(b)
|| /*trailing spaces are not allowed by the spec, but some server put it there*/
b == HttpParserUtils.CR || b == HttpParserUtils.SEMI_COLON) {
headerParsingState.checkpoint = offset;
} else if (b == HttpParserUtils.LF) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void testNotFoundReadEntityViaClass() throws Throwable {

@Test
public void testNotFoundReadEntityViaGenericType() throws Throwable {
Assertions.assertThrows(NotFoundException.class, () ->{
Assertions.assertThrows(NotFoundException.class, () -> {
try {
client.target("http://jersey.java.net")
.request()
Expand Down
13 changes: 13 additions & 0 deletions docs/src/main/docbook/migration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
xml:id="migration">
<title>Migration Guide</title>

<section xml:id="mig-2.38">
<title>Migrating from Jersey 2.37 to 2.38</title>
<section xml:id="mig-2.38-breaking-changes">
<title>Breaking Changes</title>
<para>
Versions 2.38 introduces non-compatible change for dependency of Open Tracing. As soon as Open Tracing
breaks compatibility between the 0.30.0 and the 0.33.0 versions in its API, and Jersey updates Open Tracing
to the 0.33.0 version in the 2.38, for everyone who uses Open Tracing framework it is required to upgrade
their dependencies to the 0.33.0 version of the Open Tracing respectively.
</para>
</section>
</section>

<section xml:id="mig-2.30">
<title>Migrating from Jersey 2.29 to 2.29.1 and 2.30+</title>
<section xml:id="mig-2.30-breaking-changes">
Expand Down
2 changes: 1 addition & 1 deletion examples/extended-wadl-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${surefire.version}</version>
<version>${surefire.mvn.plugin.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion examples/groovy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-all</artifactId>
<type>pom</type>
<version>4.0.4</version>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -113,7 +113,7 @@ static class ReqFilterA implements ContainerRequestFilter {
public void filter(ContainerRequestContext requestContext) throws IOException {
Span span = OpenTracingUtils
.getRequestSpan(requestContext)
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-reqA").startManual());
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-reqA").start());
span.log("ReqFilterA.filter() invoked");
}
}
Expand All @@ -128,7 +128,7 @@ static class ReqFilterB implements ContainerRequestFilter {
public void filter(ContainerRequestContext requestContext) throws IOException {
Span span = OpenTracingUtils
.getRequestSpan(requestContext)
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-reqB").startManual());
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-reqB").start());
span.log("ReqFilterB.filter() invoked");
}
}
Expand All @@ -141,7 +141,7 @@ static class RespFilterA implements ContainerResponseFilter {
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
Span span = OpenTracingUtils
.getRequestSpan(requestContext)
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-respA").startManual());
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-respA").start());
span.log("RespFilterA.filter() invoked");
}
}
Expand All @@ -154,7 +154,7 @@ static class RespFilterB implements ContainerResponseFilter {
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
Span span = OpenTracingUtils
.getRequestSpan(requestContext)
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-respB").startManual());
.orElse(GlobalTracer.get().buildSpan("ad-hoc-span-respB").start());
span.log("RespFilterB.filter() invoked");
}
}
Expand Down
9 changes: 0 additions & 9 deletions examples/osgi-helloworld-webapp/functional-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@
<artifactId>javassist</artifactId>
<scope>test</scope>
</dependency>

<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
<scope>test</scope>
</dependency>

<!-- JUnit and Pax-Exam dependencies -->
<dependency>
<groupId>org.osgi</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/osgi-helloworld-webapp/war-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version><!-- the current project's ${servlet2.version} is 2.4 and that's not enough -->
<version>${servlet2.version}</version>
<scope>provided</scope>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions ext/microprofile/mp-rest-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<dependency>
<groupId>org.eclipse.microprofile.rest.client</groupId>
<artifactId>microprofile-rest-client-api</artifactId>
<version>2.0</version>
<version>${microprofile.rest.client.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>1.4</version>
<version>${microprofile.config.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
Expand Down Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
<version>1.0.3</version>
<version>${reactive.streams.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
Expand Down
8 changes: 7 additions & 1 deletion ext/rx/rx-client-rxjava2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>${rxjava2.version}</version>
<exclusions>
<exclusion>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
<version>1.0.0</version>
<version>${reactive.streams.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -25,6 +25,7 @@
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.ContainerResponseFilter;

import io.opentracing.propagation.TextMapAdapter;
import org.glassfish.jersey.server.ContainerRequest;
import org.glassfish.jersey.server.ContainerResponse;
import org.glassfish.jersey.server.monitoring.ApplicationEvent;
Expand All @@ -36,7 +37,6 @@
import io.opentracing.SpanContext;
import io.opentracing.Tracer;
import io.opentracing.propagation.Format;
import io.opentracing.propagation.TextMapExtractAdapter;
import io.opentracing.tag.Tags;
import io.opentracing.util.GlobalTracer;

Expand Down Expand Up @@ -84,7 +84,7 @@ private Span handleRequestStart(ContainerRequest request) {
(entry) -> OpenTracingUtils.formatList(entry.getValue())));

final SpanContext extractedContext =
globalTracer.extract(Format.Builtin.HTTP_HEADERS, new TextMapExtractAdapter(mappedHeaders));
globalTracer.extract(Format.Builtin.HTTP_HEADERS, new TextMapAdapter(mappedHeaders));

Tracer.SpanBuilder spanBuilder = globalTracer
.buildSpan(OpenTracingFeature.DEFAULT_REQUEST_SPAN_NAME)
Expand All @@ -99,7 +99,7 @@ private Span handleRequestStart(ContainerRequest request) {
spanBuilder = spanBuilder.asChildOf(extractedContext);
}

final Span span = spanBuilder.startManual();
final Span span = spanBuilder.start();
request.setProperty(OpenTracingFeature.SPAN_CONTEXT_PROPERTY, span);
span.log(LocalizationMessages.OPENTRACING_LOG_REQUEST_STARTED());
return span;
Expand Down Expand Up @@ -157,7 +157,7 @@ public void onEvent(RequestEvent event) {

resourceSpan = globalTracer.buildSpan(OpenTracingFeature.DEFAULT_RESOURCE_SPAN_NAME)
.asChildOf(requestSpan)
.startManual();
.start();

event.getContainerRequest().setProperty(OpenTracingFeature.SPAN_CONTEXT_PROPERTY, resourceSpan);
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -29,7 +29,7 @@
import io.opentracing.SpanContext;
import io.opentracing.Tracer;
import io.opentracing.propagation.Format;
import io.opentracing.propagation.TextMapInjectAdapter;
import io.opentracing.propagation.TextMapAdapter;
import io.opentracing.tag.Tags;
import io.opentracing.util.GlobalTracer;

Expand Down Expand Up @@ -65,11 +65,11 @@ public void filter(ClientRequestContext requestContext) throws IOException {
if (property != null && property instanceof SpanContext) {
spanBuilder = spanBuilder.asChildOf((SpanContext) property);
}
Span span = spanBuilder.startManual();
Span span = spanBuilder.start();

requestContext.setProperty(OpenTracingFeature.SPAN_CONTEXT_PROPERTY, span);
Map<String, String> addedHeaders = new HashMap<>();
GlobalTracer.get().inject(span.context(), Format.Builtin.HTTP_HEADERS, new TextMapInjectAdapter(addedHeaders));
GlobalTracer.get().inject(span.context(), Format.Builtin.HTTP_HEADERS, new TextMapAdapter(addedHeaders));
addedHeaders.forEach((key, value) -> requestContext.getHeaders().add(key, value));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -89,7 +89,7 @@ public static Span getRequestChildSpan(final ContainerRequestContext context, fi
spanBuilder = spanBuilder.asChildOf((Span) spanProperty);
}
}
return spanBuilder.startManual();
return spanBuilder.start();
}

/**
Expand Down
Loading

0 comments on commit 21c2ed9

Please sign in to comment.