Remove Java 7isms and fix Maven compilation

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=77353600
This commit is contained in:
ejona 2014-10-09 09:53:41 -07:00 committed by Eric Anderson
parent c1f4b7303f
commit 8c76c8a1d0
3 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,7 @@
package com.google.net.stubby;
import static java.nio.charset.StandardCharsets.UTF_8;
import static com.google.common.base.Charsets.US_ASCII;
import static com.google.common.base.Charsets.UTF_8;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
@ -10,7 +11,6 @@ import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Lists;
import java.nio.charset.StandardCharsets;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -132,7 +132,7 @@ public abstract class Metadata {
private Metadata(byte[]... binaryValues) {
store = LinkedListMultimap.create();
for (int i = 0; i < binaryValues.length; i++) {
String name = new String(binaryValues[i], StandardCharsets.US_ASCII);
String name = new String(binaryValues[i], US_ASCII);
store.put(name, new MetadataEntry(binaryValues[++i]));
}
this.serializable = false;
@ -449,7 +449,7 @@ public abstract class Metadata {
*/
private Key(String name, Marshaller<T> marshaller) {
this.name = Preconditions.checkNotNull(name, "name").toLowerCase().intern();
this.asciiName = name.getBytes(StandardCharsets.US_ASCII);
this.asciiName = name.getBytes(US_ASCII);
this.marshaller = Preconditions.checkNotNull(marshaller);
}

View File

@ -2,12 +2,12 @@ package com.google.net.stubby;
import static com.google.common.base.Charsets.US_ASCII;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import java.util.List;
import java.util.Objects;
import java.util.TreeMap;
import javax.annotation.Nullable;
@ -150,7 +150,7 @@ public final class Status {
// Create the canonical list of Status instances indexed by their code values.
private static List<Status> STATUS_LIST;
static {
TreeMap<Integer, Status> canonicalizer = new TreeMap<>();
TreeMap<Integer, Status> canonicalizer = new TreeMap<Integer, Status>();
for (Code code : Code.values()) {
Status replaced = canonicalizer.put(code.value(), new Status(code));
if (replaced != null) {
@ -239,7 +239,7 @@ public final class Status {
* Create a derived instance of {@link Status} with the given cause.
*/
public Status withCause(Throwable cause) {
if (Objects.equals(this.cause, cause)) {
if (Objects.equal(this.cause, cause)) {
return this;
}
return new Status(this.code, this.description, cause);
@ -249,7 +249,7 @@ public final class Status {
* Create a derived instance of {@link Status} with the given description.
*/
public Status withDescription(String description) {
if (Objects.equals(this.description, description)) {
if (Objects.equal(this.description, description)) {
return this;
}
return new Status(this.code, description, this.cause);

View File

@ -1,6 +1,6 @@
package com.google.net.stubby.newtransport;
import static java.nio.charset.StandardCharsets.UTF_8;
import static com.google.common.base.Charsets.UTF_8;
import com.google.common.base.Preconditions;