aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorsongy23 <songya@google.com>2017-03-03 15:52:40 -0800
committersongy23 <songya@google.com>2017-03-03 15:52:40 -0800
commit8ffe0666982d3f3e9d376cbc27762f487ea99114 (patch)
tree73548da3006ad3f543d1b67c9ebddc6977d28920 /core
parent5867516b83e01b1f0eb8a7e4e96a7a031ed86ab4 (diff)
downloadplatform_external_opencensus-java-8ffe0666982d3f3e9d376cbc27762f487ea99114.tar.gz
platform_external_opencensus-java-8ffe0666982d3f3e9d376cbc27762f487ea99114.tar.bz2
platform_external_opencensus-java-8ffe0666982d3f3e9d376cbc27762f487ea99114.zip
Modify some test methods to be static according to lint suggestions.
Diffstat (limited to 'core')
-rw-r--r--core/src/test/java/com/google/instrumentation/stats/StatsContextFactoryTest.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/test/java/com/google/instrumentation/stats/StatsContextFactoryTest.java b/core/src/test/java/com/google/instrumentation/stats/StatsContextFactoryTest.java
index 004d8030..f45000fc 100644
--- a/core/src/test/java/com/google/instrumentation/stats/StatsContextFactoryTest.java
+++ b/core/src/test/java/com/google/instrumentation/stats/StatsContextFactoryTest.java
@@ -63,7 +63,7 @@ public class StatsContextFactoryTest {
testDeserialize(new ByteArrayInputStream(new byte[1]));
}
- private StatsContext testDeserialize(InputStream inputStream) throws IOException {
+ private static StatsContext testDeserialize(InputStream inputStream) throws IOException {
return Stats.getStatsContextFactory().deserialize(inputStream);
}
@@ -93,20 +93,20 @@ public class StatsContextFactoryTest {
return new ByteArrayInputStream(buffer.array());
}
- private void encodeString(String input, ByteBuffer buffer) {
+ private static void encodeString(String input, ByteBuffer buffer) {
VarInt.putVarInt(input.length(), buffer);
for (int i = 0; i < input.length(); i++) {
buffer.put((byte) input.charAt(i));
}
}
- private void encodeInteger(int input, ByteBuffer buffer) {
- VarInt.putVarInt(Integer.valueOf(input).toString().length(), buffer);
+ private static void encodeInteger(int input, ByteBuffer buffer) {
+ VarInt.putVarInt(Integer.toString(input).length(), buffer);
buffer.put((byte) input);
}
- private void encodeBoolean(boolean input, ByteBuffer buffer) {
- VarInt.putVarInt(Boolean.valueOf(input).toString().length(), buffer);
+ private static void encodeBoolean(boolean input, ByteBuffer buffer) {
+ VarInt.putVarInt(Boolean.toString(input).length(), buffer);
buffer.put((byte) (input? 1 : 0));
}
}