Skip to content

Commit

Permalink
Remove deprecated methods moved to Internal.
Browse files Browse the repository at this point in the history
  • Loading branch information
squarejesse committed Jan 18, 2016
1 parent 6b7778c commit 85ed9e4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 75 deletions.
61 changes: 0 additions & 61 deletions wire-runtime/src/main/java/com/squareup/wire/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
*/
package com.squareup.wire;

import com.squareup.wire.internal.Internal;
import java.io.IOException;
import java.io.ObjectStreamException;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.List;
import okio.Buffer;
import okio.BufferedSink;
import okio.ByteString;
Expand Down Expand Up @@ -48,14 +46,6 @@ protected Message(ProtoAdapter<M> adapter, ByteString unknownFields) {
this.unknownFields = unknownFields;
}

@Deprecated // TODO remove for 2.1.
protected Message(ByteString unknownFields) {
if (unknownFields == null) throw new NullPointerException("unknownFields == null");
//noinspection unchecked
this.adapter = (ProtoAdapter<M>) ProtoAdapter.get(this);
this.unknownFields = unknownFields;
}

/**
* Returns a byte string containing the proto encoding of this message's unknown fields. Returns
* an empty byte string if this message has no unknown fields.
Expand Down Expand Up @@ -170,55 +160,4 @@ public ByteString buildUnknownFields() {
/** Returns an immutable {@link Message} based on the fields that set in this builder. */
public abstract T build();
}

/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static <T> List<T> newMutableList() {
return Internal.newMutableList();
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static <T> List<T> copyOf(String name, List<T> list) {
return Internal.copyOf(name, list);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static <T> List<T> immutableCopyOf(String name, List<T> list) {
return Internal.immutableCopyOf(name, list);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static <T> void redactElements(List<T> list, ProtoAdapter<T> adapter) {
Internal.redactElements(list, adapter);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static boolean equals(Object a, Object b) {
return Internal.equals(a, b);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static IllegalStateException missingRequiredFields(Object... args) {
return Internal.missingRequiredFields(args);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static void checkElementsNotNull(List<?> list) {
Internal.checkElementsNotNull(list);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static int countNotNull(Object a, Object b) {
return Internal.countNonNull(a, b);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static int countNotNull(Object a, Object b, Object c) {
return Internal.countNonNull(a, b, c);
}
/** For generated code only. */
@Deprecated // TODO remove for 2.1.
public static int countNotNull(Object a, Object b, Object c, Object d, Object... rest) {
return Internal.countNonNull(a, b, c, d, rest);
}
}
14 changes: 0 additions & 14 deletions wire-runtime/src/test/java/com/squareup/wire/ProtoAdapterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

public final class ProtoAdapterTest {
@Test public void getFromClass() throws Exception {
Expand All @@ -51,19 +50,6 @@ public final class ProtoAdapterTest {
assertThat(instanceAdapter).isSameAs(classAdapter);
}

@Test public void getFromClassWrongType() throws Exception {
try {
new Message(ByteString.EMPTY) {
@Override public Builder newBuilder() {
throw new AssertionError();
}
};
fail();
} catch (IllegalArgumentException expected) {
assertThat(expected).hasMessageStartingWith("failed to access ");
}
}

@Test public void repeatedHelpersCacheInstances() {
ProtoAdapter<?> adapter = ProtoAdapter.UINT64;
assertThat(adapter.asRepeated()).isSameAs(adapter.asRepeated());
Expand Down

0 comments on commit 85ed9e4

Please sign in to comment.