Fix of various whitespace&warning issues Change-Id: Icdf9b4bac12264f99e2ef1859256f2abbcafe6e3
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/JjsUtils.java b/dev/core/src/com/google/gwt/dev/jjs/impl/JjsUtils.java index 7b2f3f7..8287e27 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/JjsUtils.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/JjsUtils.java
@@ -684,4 +684,4 @@ private JjsUtils() { } -} \ No newline at end of file +}
diff --git a/user/BUILD b/user/BUILD index befd9b0..33dd652 100644 --- a/user/BUILD +++ b/user/BUILD
@@ -476,6 +476,7 @@ "**/package.html", "**/RunStyleSelenium.java", ], + deps = ["//third_party/java/junit:not-testonly"], ) # The gwt-testing classes for GWT internal use only. @@ -547,6 +548,7 @@ ], javacopts = [ "-Xep:CheckReturnValue:OFF", + "-Xep:DeadThread:OFF", "-Xep:ReturnValueIgnored:OFF", "-Xep:SelfComparison:OFF", # go/self-comparison-lsc "-Xep:SelfEquals:OFF", # go/self-equals-lsc
diff --git a/user/src/com/google/gwt/core/client/JavaScriptObject.java b/user/src/com/google/gwt/core/client/JavaScriptObject.java index a084c20..c5d23bc 100644 --- a/user/src/com/google/gwt/core/client/JavaScriptObject.java +++ b/user/src/com/google/gwt/core/client/JavaScriptObject.java
@@ -191,4 +191,4 @@ private static native int callHashCode(Object object) /*-{ return object.hashCode(); }-*/; -} \ No newline at end of file +}
diff --git a/user/super/com/google/gwt/emul/javaemul/internal/InternalPreconditions.java b/user/super/com/google/gwt/emul/javaemul/internal/InternalPreconditions.java index d344435..a427e59 100644 --- a/user/super/com/google/gwt/emul/javaemul/internal/InternalPreconditions.java +++ b/user/super/com/google/gwt/emul/javaemul/internal/InternalPreconditions.java
@@ -96,7 +96,7 @@ throw new IllegalStateException("Incorrect level: " + getProperty("jre.checks.checkLevel")); } } - + private static final boolean IS_TYPE_CHECKED = CHECK_TYPE == "AUTO" && LEVEL_OPT_OR_HIGHER || CHECK_TYPE == "ENABLED"; private static final boolean IS_BOUNDS_CHECKED =
diff --git a/user/test/com/google/gwt/dev/shell/rewrite/client/EmmaClassLoadingTest.java b/user/test/com/google/gwt/dev/shell/rewrite/client/EmmaClassLoadingTest.java index afee926..990b9a0 100644 --- a/user/test/com/google/gwt/dev/shell/rewrite/client/EmmaClassLoadingTest.java +++ b/user/test/com/google/gwt/dev/shell/rewrite/client/EmmaClassLoadingTest.java
@@ -148,12 +148,12 @@ assertEquals(messages[logCount++], msg); } - void test() { + public void test() { test1(); test2(); }; - private void test1() { + public void test1() { if (false) { class Foo { @SuppressWarnings("jsni") @@ -165,7 +165,7 @@ } } - private void test2() { + public void test2() { class Foo { @SuppressWarnings("jsni") public native void foo() /*-{ @@ -180,7 +180,7 @@ * Instead of timing out, the AssertEquals fails */ @SuppressWarnings("unused") - private void test3() { + public void test3() { class Foo { @SuppressWarnings("jsni") public native void foo() /*-{ @@ -296,7 +296,7 @@ assertEquals(messages[logCount++], msg); } - void test() { + public void test() { EmmaClassLoadingTest.TestInterface a = new EmmaClassLoadingTest.TestInterface() { @Override @SuppressWarnings("jsni")
diff --git a/user/test/com/google/gwt/emultest/java/util/HashMapTest.java b/user/test/com/google/gwt/emultest/java/util/HashMapTest.java index 206f52d..466aea8 100644 --- a/user/test/com/google/gwt/emultest/java/util/HashMapTest.java +++ b/user/test/com/google/gwt/emultest/java/util/HashMapTest.java
@@ -15,7 +15,6 @@ */ package com.google.gwt.emultest.java.util; - import org.apache.commons.collections.TestMap; import java.util.ArrayList; @@ -211,6 +210,7 @@ /* * Test method for 'java.util.HashMap.containsValue(Object)' */ + @SuppressWarnings("CollectionIncompatibleType") public void testContainsValue() { HashMap<String, Integer> hashMap = new HashMap<String, Integer>(); checkEmptyHashMapAssumptions(hashMap); @@ -220,8 +220,10 @@ hashMap.put(KEY_TEST_CONTAINS_VALUE, VALUE_TEST_CONTAINS_KEY); assertTrue("check contains of map with element", hashMap.containsValue(VALUE_TEST_CONTAINS_KEY)); - assertFalse("check contains of map other element", - hashMap.containsValue(VALUE_TEST_CONTAINS_DOES_NOT_EXIST)); + assertFalse( + "check contains of map other element", + hashMap.containsValue( + /* expected: Integer, actual: String */ VALUE_TEST_CONTAINS_DOES_NOT_EXIST)); assertFalse(hashMap.containsValue(null)); hashMap.put(KEY_TEST_CONTAINS_VALUE, null);
diff --git a/user/test/com/google/gwt/emultest/java/util/LinkedHashMapTest.java b/user/test/com/google/gwt/emultest/java/util/LinkedHashMapTest.java index 85c0b4b..972ea8b 100644 --- a/user/test/com/google/gwt/emultest/java/util/LinkedHashMapTest.java +++ b/user/test/com/google/gwt/emultest/java/util/LinkedHashMapTest.java
@@ -227,6 +227,7 @@ /* * Test method for 'java.util.LinkedHashMap.containsValue(Object)' */ + @SuppressWarnings("CollectionIncompatibleType") public void testContainsValue() { LinkedHashMap<String, Integer> hashMap = new LinkedHashMap<String, Integer>(); checkEmptyLinkedHashMapAssumptions(hashMap); @@ -236,8 +237,10 @@ hashMap.put(KEY_TEST_CONTAINS_VALUE, VALUE_TEST_CONTAINS_KEY); assertTrue("check contains of map with element", hashMap.containsValue(VALUE_TEST_CONTAINS_KEY)); - assertFalse("check contains of map other element", - hashMap.containsValue(VALUE_TEST_CONTAINS_DOES_NOT_EXIST)); + assertFalse( + "check contains of map other element", + hashMap.containsValue( + /* expected: Integer, actual: String */ VALUE_TEST_CONTAINS_DOES_NOT_EXIST)); assertFalse(hashMap.containsValue(null)); hashMap.put(KEY_TEST_CONTAINS_VALUE, null);
diff --git a/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java b/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java index 69843a2..b1a7434 100644 --- a/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java +++ b/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java
@@ -487,12 +487,13 @@ assertFalse(map.containsKey(keys[3])); } + @SuppressWarnings("CollectionIncompatibleType") public void testContainsKey_ComparableKey() { TreeMap<String, Object> map = new TreeMap<String, Object>(); ConflictingKey conflictingKey = new ConflictingKey("conflictingKey"); - assertFalse(map.containsKey(conflictingKey)); + assertFalse(map.containsKey(/* expected: String, actual: ConflictingKey */ conflictingKey)); map.put("something", "value"); - assertFalse(map.containsKey(conflictingKey)); + assertFalse(map.containsKey(/* expected: String, actual: ConflictingKey */ conflictingKey)); } /** @@ -1141,12 +1142,13 @@ assertSame(values[1], map.put(keys[1], values[2])); } + @SuppressWarnings("CollectionIncompatibleType") public void testGet_ComparableKey() { TreeMap<String, Object> map = new TreeMap<String, Object>(); ConflictingKey conflictingKey = new ConflictingKey("conflictingKey"); - assertNull(map.get(conflictingKey)); + assertNull(map.get(/* expected: String, actual: ConflictingKey */ conflictingKey)); map.put("something", "value"); - assertNull(map.get(conflictingKey)); + assertNull(map.get(/* expected: String, actual: ConflictingKey */ conflictingKey)); } /** @@ -2671,12 +2673,13 @@ assertTrue(!map.containsKey(keys[2])); } + @SuppressWarnings("CollectionIncompatibleType") public void testRemove_ComparableKey() { TreeMap<String, Object> map = new TreeMap<String, Object>(); ConflictingKey conflictingKey = new ConflictingKey("conflictingKey"); - assertNull(map.remove(conflictingKey)); + assertNull(map.remove(/* expected: String, actual: ConflictingKey */ conflictingKey)); map.put("something", "value"); - assertNull(map.remove(conflictingKey)); + assertNull(map.remove(/* expected: String, actual: ConflictingKey */ conflictingKey)); } /**
diff --git a/user/test/com/google/gwt/storage/client/MapInterfaceTest.java b/user/test/com/google/gwt/storage/client/MapInterfaceTest.java index c4a7309..eae4622 100644 --- a/user/test/com/google/gwt/storage/client/MapInterfaceTest.java +++ b/user/test/com/google/gwt/storage/client/MapInterfaceTest.java
@@ -150,13 +150,13 @@ } /** - * Checks all the properties that should always hold of a map. Also calls - * {@link #assertMoreInvariants} to check invariants that are peculiar to - * specific implementations. + * Checks all the properties that should always hold of a map. Also calls {@link + * #assertMoreInvariants} to check invariants that are peculiar to specific implementations. * * @see #assertMoreInvariants * @param map the map to check. */ + @SuppressWarnings("CollectionIncompatibleType") protected final void assertInvariants(Map<K, V> map) { Set<K> keySet = map.keySet(); Collection<V> valueCollection = map.values(); @@ -1541,4 +1541,4 @@ private static <K, V> Entry<K, V> mapEntry(K key, V value) { return Collections.singletonMap(key, value).entrySet().iterator().next(); } -} \ No newline at end of file +}