Skip to content
Snippets Groups Projects
Commit 411c68a0 authored by Guang Zhu's avatar Guang Zhu
Browse files

fix compiler warnings

Change-Id: Ifd2c923750dc6f2b5f8104aa3993277648fcf7b9
parent 88928864
Branches
No related tags found
No related merge requests found
......@@ -50,7 +50,9 @@ public class BugreportItem extends GenericItem {
TIME, COMMAND_LINE, MEM_INFO, PROCRANK, TOP, KERNEL_LOG, LAST_KMSG, SYSTEM_LOG,
SYSTEM_PROPS, DUMPSYS));
public static class CommandLineItem extends GenericMapItem<String> {}
public static class CommandLineItem extends GenericMapItem<String> {
private static final long serialVersionUID = 0L;
}
/**
* The constructor for {@link BugreportItem}.
......
......@@ -20,5 +20,6 @@ package com.android.loganalysis.item;
* used a helper item and not going to be marshalled to JSON
*/
public class DumpsysProcStatsItem extends GenericMapItem<String> {
private static final long serialVersionUID = 1L;
}
......@@ -48,6 +48,7 @@ public class MemoryHealthItem extends GenericItem {
* Returns breakdown of memory usage of foreground processes.
* @return Map that stores breakdown of memory usage
*/
@SuppressWarnings("unchecked")
public Map<String, Map<String, Long>> getForeground() {
return (Map<String, Map<String, Long>>) super.getAttribute(FOREGROUND);
}
......@@ -56,6 +57,7 @@ public class MemoryHealthItem extends GenericItem {
* Returns breakdown of memory usage of foreground processes.
* @return Map that stores breakdown of memory usage
*/
@SuppressWarnings("unchecked")
public Map<String, Map<String, Long>> getBackground() {
return (Map<String, Map<String, Long>>) super.getAttribute(BACKGROUND);
}
......
......@@ -63,6 +63,7 @@ public class ArrayUtil {
* @param inputAry an array, or a varargs list
* @return a {@link List} instance with the identical contents
*/
@SafeVarargs
public static <T> List<T> list(T... inputAry) {
List<T> retList = new ArrayList<T>(inputAry.length);
for (T item : inputAry) {
......@@ -111,4 +112,3 @@ public class ArrayUtil {
}
}
}
......@@ -105,7 +105,7 @@ public class RegexTrie<V> {
public void clear() {
mValue = null;
for (RegexTrie child : mChildren.values()) {
for (RegexTrie<V> child : mChildren.values()) {
child.clear();
}
mChildren.clear();
......
......@@ -55,6 +55,7 @@ import java.util.Map;
* @see {@link ArgsOptionParser}
*/
//TODO: Use libTF once this is copied over.
@SuppressWarnings("rawtypes")
public class OptionSetter {
static final String BOOL_FALSE_PREFIX = "no-";
......
......@@ -112,7 +112,7 @@ public enum OptionUpdateRule {
* Check if the objects are {@link Comparable}, and if so, compare them using
* {@see Comparable#compareTo}.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
private static int compare(String optionName, Object current, Object update)
throws ConfigurationException {
Comparable compCurrent;
......
......@@ -33,14 +33,13 @@ public class OptionSetterTest extends TestCase {
/** Option source with generic type. */
private static class GenericTypeOptionSource {
@SuppressWarnings("unused")
@Option(name = "my_option", shortName = 'o')
private Collection<?> mMyOption;
}
/** Option source with unparameterized type. */
@SuppressWarnings("rawtypes")
private static class CollectionTypeOptionSource {
@SuppressWarnings("unused")
@Option(name = "my_option", shortName = 'o')
private Collection mMyOption;
}
......@@ -50,18 +49,15 @@ public class OptionSetterTest extends TestCase {
/** Option source with unparameterized type. */
private static class NonCollectionGenericTypeOptionSource {
@SuppressWarnings("unused")
@Option(name = "my_option", shortName = 'o')
private MyGeneric<String> mMyOption;
}
/** Option source with options with same name. */
private static class DuplicateOptionSource {
@SuppressWarnings("unused")
@Option(name = "string", shortName = 's')
private String mMyOption;
@SuppressWarnings("unused")
@Option(name = "string", shortName = 's')
private String mMyDuplicateOption;
}
......@@ -72,11 +68,9 @@ public class OptionSetterTest extends TestCase {
@Option(name = "string", shortName = 's')
private String mMyOption;
@SuppressWarnings("unused")
@Option(name = "enum")
private DefaultEnumClass mEnum = null;
@SuppressWarnings("unused")
@Option(name = "string_collection")
private Collection<String> mStringCollection = new ArrayList<String>();
......@@ -93,7 +87,6 @@ public class OptionSetterTest extends TestCase {
* Option source with an option with same name as AllTypesOptionSource, but a different type.
*/
private static class SharedOptionWrongTypeSource {
@SuppressWarnings("unused")
@Option(name = "string", shortName = 's')
private int mMyOption;
}
......@@ -188,7 +181,6 @@ public class OptionSetterTest extends TestCase {
* Option source with invalid option name.
*/
private static class BadOptionNameSource {
@SuppressWarnings("unused")
@Option(name = "bad:string", shortName = 's')
private int mMyOption;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment