Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 4ae7a89

Browse files
author
Michal Gajdos
committed
Replaced deprecated Objects.toStringHelper with MoreObjects.toStringHelper.
Change-Id: Ic554a5e5fed058727d6fbc6c90a4918c79a70818 Signed-off-by: Michal Gajdos <[email protected]>
1 parent 4634fbc commit 4ae7a89

File tree

17 files changed

+48
-47
lines changed

17 files changed

+48
-47
lines changed

core-client/src/main/java/org/glassfish/jersey/client/ClientResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2012-2014 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -68,7 +68,7 @@
6868
import org.glassfish.hk2.api.ServiceLocator;
6969

7070
import jersey.repackaged.com.google.common.base.Function;
71-
import jersey.repackaged.com.google.common.base.Objects;
71+
import jersey.repackaged.com.google.common.base.MoreObjects;
7272
import jersey.repackaged.com.google.common.collect.Collections2;
7373
import jersey.repackaged.com.google.common.collect.Sets;
7474

@@ -78,6 +78,7 @@
7878
* @author Marek Potociar (marek.potociar at oracle.com)
7979
*/
8080
public class ClientResponse extends InboundMessageContext implements ClientResponseContext, ServiceLocatorSupplier {
81+
8182
private Response.StatusType status;
8283
private final ClientRequest requestContext;
8384
private URI resolvedUri;
@@ -176,7 +177,6 @@ public Response.StatusType getStatusInfo() {
176177
return status;
177178
}
178179

179-
180180
/**
181181
* Get the absolute URI of the ultimate request made to receive this response.
182182
* <p>
@@ -255,7 +255,7 @@ public Link apply(Link link) {
255255

256256
@Override
257257
public String toString() {
258-
return Objects
258+
return MoreObjects
259259
.toStringHelper(this)
260260
.add("method", requestContext.getMethod())
261261
.add("uri", requestContext.getUri())

core-client/src/main/java/org/glassfish/jersey/client/InboundJaxrsResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2012-2014 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -58,7 +58,7 @@
5858
import org.glassfish.jersey.internal.util.Producer;
5959
import org.glassfish.jersey.process.internal.RequestScope;
6060

61-
import jersey.repackaged.com.google.common.base.Objects;
61+
import jersey.repackaged.com.google.common.base.MoreObjects;
6262

6363
/**
6464
* Implementation of an inbound client-side JAX-RS {@link Response} message.
@@ -250,9 +250,9 @@ public MultivaluedMap<String, Object> getMetadata() {
250250

251251
@Override
252252
public String toString() {
253-
return Objects
253+
return MoreObjects
254254
.toStringHelper(this)
255-
.addValue(context)
255+
.add("context", context)
256256
.toString();
257257
}
258258
}

core-common/src/main/java/org/glassfish/jersey/internal/util/collection/Refs.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2010-2014 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -39,7 +39,7 @@
3939
*/
4040
package org.glassfish.jersey.internal.util.collection;
4141

42-
import jersey.repackaged.com.google.common.base.Objects;
42+
import jersey.repackaged.com.google.common.base.MoreObjects;
4343

4444
/**
4545
* A collection of {@link Ref reference} factory & utility methods.
@@ -75,7 +75,7 @@ public void set(final T value) throws IllegalStateException {
7575

7676
@Override
7777
public String toString() {
78-
return Objects.toStringHelper(this).add("reference", reference).toString();
78+
return MoreObjects.toStringHelper(this).add("reference", reference).toString();
7979
}
8080

8181
@Override
@@ -126,7 +126,7 @@ public void set(final T value) throws IllegalStateException {
126126

127127
@Override
128128
public String toString() {
129-
return Objects.toStringHelper(this).add("reference", reference).toString();
129+
return MoreObjects.toStringHelper(this).add("reference", reference).toString();
130130
}
131131

132132
@Override
@@ -178,7 +178,7 @@ public void set(final T value) throws IllegalStateException {
178178

179179
@Override
180180
public String toString() {
181-
return Objects.toStringHelper(this).add("reference", reference).toString();
181+
return MoreObjects.toStringHelper(this).add("reference", reference).toString();
182182
}
183183

184184
@Override

core-common/src/main/java/org/glassfish/jersey/message/internal/OutboundJaxrsResponse.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2012-2014 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -66,7 +66,7 @@
6666

6767
import org.glassfish.jersey.internal.LocalizationMessages;
6868

69-
import jersey.repackaged.com.google.common.base.Objects;
69+
import jersey.repackaged.com.google.common.base.MoreObjects;
7070

7171
/**
7272
* An outbound JAX-RS response message.
@@ -304,7 +304,7 @@ public MultivaluedMap<String, Object> getMetadata() {
304304

305305
@Override
306306
public String toString() {
307-
return Objects
307+
return MoreObjects
308308
.toStringHelper(this)
309309
.add("status", status.getStatusCode())
310310
.add("reason", status.getReasonPhrase())
@@ -322,6 +322,7 @@ public String toString() {
322322
* a new instance of {@link OutboundJaxrsResponse} is produced.
323323
*/
324324
public static class Builder extends ResponseBuilder {
325+
325326
private StatusType status;
326327
private final OutboundMessageContext context;
327328

@@ -526,7 +527,7 @@ public javax.ws.rs.core.Response.ResponseBuilder language(Locale language) {
526527
@Override
527528
public javax.ws.rs.core.Response.ResponseBuilder location(URI location) {
528529
URI locationUri = location;
529-
if (location != null && !location.isAbsolute()) {
530+
if (location != null && !location.isAbsolute()) {
530531
URI baseUri = getBaseUri();
531532
if (baseUri != null) {
532533
locationUri = baseUri.resolve(location);

core-common/src/main/java/org/glassfish/jersey/process/internal/RequestScope.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
import org.glassfish.hk2.api.ServiceHandle;
6161
import org.glassfish.hk2.utilities.binding.AbstractBinder;
6262

63-
import jersey.repackaged.com.google.common.base.Objects;
63+
import jersey.repackaged.com.google.common.base.MoreObjects;
6464
import jersey.repackaged.com.google.common.collect.Sets;
6565

6666
import static jersey.repackaged.com.google.common.base.Preconditions.checkState;
@@ -556,7 +556,7 @@ public void release() {
556556

557557
@Override
558558
public String toString() {
559-
return Objects.toStringHelper(this).add("id", id.value()).add("referenceCounter", referenceCounter.get())
559+
return MoreObjects.toStringHelper(this).add("id", id.value()).add("referenceCounter", referenceCounter.get())
560560
.add("store size", store.size()).toString();
561561
}
562562
}

examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import javax.persistence.Temporal;
5555
import javax.persistence.TemporalType;
5656

57-
import jersey.repackaged.com.google.common.base.Objects;
57+
import jersey.repackaged.com.google.common.base.MoreObjects;
5858

5959
/**
6060
* Entity class BookmarkEntity.
@@ -285,7 +285,7 @@ public boolean equals(Object object) {
285285
*/
286286
@Override
287287
public String toString() {
288-
return Objects.toStringHelper(this).add("bookmarkEntityPK", bookmarkEntityPK).toString();
288+
return MoreObjects.toStringHelper(this).add("bookmarkEntityPK", bookmarkEntityPK).toString();
289289
}
290290

291291
}

examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/BookmarkEntityPK.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2012-2014 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -44,7 +44,7 @@
4444
import javax.persistence.Column;
4545
import javax.persistence.Embeddable;
4646

47-
import jersey.repackaged.com.google.common.base.Objects;
47+
import jersey.repackaged.com.google.common.base.MoreObjects;
4848

4949
/**
5050
* Primary Key class BookmarkEntityPK for entity class BookmarkEntity.
@@ -164,7 +164,7 @@ public boolean equals(Object object) {
164164
*/
165165
@Override
166166
public String toString() {
167-
return Objects.toStringHelper(this).add("bmid", bmid).add("userid", userid).toString();
167+
return MoreObjects.toStringHelper(this).add("bmid", bmid).add("userid", userid).toString();
168168
}
169169

170170
}

examples/bookmark-em/src/main/java/org/glassfish/jersey/examples/bookmark_em/entity/UserEntity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2012-2014 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -51,7 +51,7 @@
5151
import javax.persistence.OneToMany;
5252
import javax.persistence.Table;
5353

54-
import jersey.repackaged.com.google.common.base.Objects;
54+
import jersey.repackaged.com.google.common.base.MoreObjects;
5555

5656
/**
5757
* Entity class UserEntity.
@@ -242,7 +242,7 @@ public boolean equals(Object object) {
242242
*/
243243
@Override
244244
public String toString() {
245-
return Objects.toStringHelper(this).add("userid", userid).toString();
245+
return MoreObjects.toStringHelper(this).add("userid", userid).toString();
246246
}
247247

248248
}

examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
import javax.persistence.Temporal;
5454
import javax.persistence.TemporalType;
5555

56-
import jersey.repackaged.com.google.common.base.Objects;
56+
import jersey.repackaged.com.google.common.base.MoreObjects;
5757

5858
/**
5959
* Entity class BookmarkEntity.
@@ -283,7 +283,7 @@ public boolean equals(Object object) {
283283
*/
284284
@Override
285285
public String toString() {
286-
return Objects.toStringHelper(this).add("bookmarkEntityPK", bookmarkEntityPK).toString();
286+
return MoreObjects.toStringHelper(this).add("bookmarkEntityPK", bookmarkEntityPK).toString();
287287
}
288288

289289
}

examples/bookmark/src/main/java/org/glassfish/jersey/examples/bookmark/entity/BookmarkEntityPK.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2010-2014 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -44,7 +44,7 @@
4444
import javax.persistence.Column;
4545
import javax.persistence.Embeddable;
4646

47-
import jersey.repackaged.com.google.common.base.Objects;
47+
import jersey.repackaged.com.google.common.base.MoreObjects;
4848

4949
/**
5050
* Primary Key class BookmarkEntityPK for entity class BookmarkEntity.
@@ -164,7 +164,7 @@ public boolean equals(Object object) {
164164
*/
165165
@Override
166166
public String toString() {
167-
return Objects.toStringHelper(this).add("bmid", bmid).add("userid", userid).toString();
167+
return MoreObjects.toStringHelper(this).add("bmid", bmid).add("userid", userid).toString();
168168
}
169169

170170
}

0 commit comments

Comments
 (0)