api,protobuf-lite: solve code style issues

This commit is contained in:
Manuel Kollus 2019-05-31 21:49:30 +02:00 committed by Carl Mastrangelo
parent c6c2ee876a
commit e526891a2b
4 changed files with 10 additions and 10 deletions

View File

@ -252,7 +252,7 @@ public final class Attributes {
return this;
}
public <T> Builder setAll(Attributes other) {
public Builder setAll(Attributes other) {
data(other.data.size()).putAll(other.data);
return this;
}

View File

@ -30,11 +30,11 @@ public final class InternalMethodDescriptor {
this.transport = checkNotNull(transport, "transport");
}
public Object geRawMethodName(MethodDescriptor<?, ?> md) {
return md.getRawMethodName(transport.ordinal());
public Object geRawMethodName(MethodDescriptor<?, ?> descriptor) {
return descriptor.getRawMethodName(transport.ordinal());
}
public void setRawMethodName(MethodDescriptor<?, ?> md, Object o) {
md.setRawMethodName(transport.ordinal(), o);
public void setRawMethodName(MethodDescriptor<?, ?> descriptor, Object o) {
descriptor.setRawMethodName(transport.ordinal(), o);
}
}

View File

@ -86,8 +86,8 @@ public final class NameResolverRegistry {
// sort() must be stable, as we prefer first-registered providers
Collections.sort(providers, Collections.reverseOrder(new Comparator<NameResolverProvider>() {
@Override
public int compare(NameResolverProvider p1, NameResolverProvider p2) {
return p1.priority() - p2.priority();
public int compare(NameResolverProvider o1, NameResolverProvider o2) {
return o1.priority() - o2.priority();
}
}));
effectiveProviders = Collections.unmodifiableList(providers);

View File

@ -97,8 +97,8 @@ public final class ProtoLiteUtils {
/** Copies the data from input stream to output stream. */
static long copy(InputStream from, OutputStream to) throws IOException {
// Copied from guava com.google.common.io.ByteStreams because its API is unstable (beta)
checkNotNull(from);
checkNotNull(to);
checkNotNull(from, "inputStream cannot be null!");
checkNotNull(to, "outputStream cannot be null!");
byte[] buf = new byte[BUF_SIZE];
long total = 0;
while (true) {
@ -162,7 +162,7 @@ public final class ProtoLiteUtils {
@SuppressWarnings("unchecked")
T message = (T) ((ProtoInputStream) stream).message();
return message;
} catch (IllegalStateException ex) {
} catch (IllegalStateException ignored) {
// Stream must have been read from, which is a strange state. Since the point of this
// optimization is to be transparent, instead of throwing an error we'll continue,
// even though it seems likely there's a bug.