The following issues were found
guava-tests/test/com/google/common/cache/CacheLoadingTest.java
1793 issues
Line: 1788
ref = new WeakReference<>(cache.getUnchecked(1));
oldValue = null;
Thread.sleep(i);
System.gc();
}
assertEquals(expectedComputations, countingLoader.getCount());
for (int i = 0; i < iterations; i++) {
// The entry should get garbage collected and recomputed.
Reported by PMD.
Line: 1803
ref = new WeakReference<>(map.get(1));
oldValue = null;
Thread.sleep(i);
System.gc();
}
assertEquals(expectedComputations, countingLoader.getCount());
}
public void testReloadAfterSimulatedValueReclamation() throws ExecutionException {
Reported by PMD.
Line: 15
* the License.
*/
package com.google.common.cache;
import static com.google.common.cache.TestingCacheLoaders.bulkLoader;
import static com.google.common.cache.TestingCacheLoaders.constantLoader;
import static com.google.common.cache.TestingCacheLoaders.errorLoader;
import static com.google.common.cache.TestingCacheLoaders.exceptionLoader;
Reported by PMD.
Line: 15
* the License.
*/
package com.google.common.cache;
import static com.google.common.cache.TestingCacheLoaders.bulkLoader;
import static com.google.common.cache.TestingCacheLoaders.constantLoader;
import static com.google.common.cache.TestingCacheLoaders.errorLoader;
import static com.google.common.cache.TestingCacheLoaders.exceptionLoader;
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java
1793 issues
Line: 1788
ref = new WeakReference<>(cache.getUnchecked(1));
oldValue = null;
Thread.sleep(i);
System.gc();
}
assertEquals(expectedComputations, countingLoader.getCount());
for (int i = 0; i < iterations; i++) {
// The entry should get garbage collected and recomputed.
Reported by PMD.
Line: 1803
ref = new WeakReference<>(map.get(1));
oldValue = null;
Thread.sleep(i);
System.gc();
}
assertEquals(expectedComputations, countingLoader.getCount());
}
public void testReloadAfterSimulatedValueReclamation() throws ExecutionException {
Reported by PMD.
Line: 15
* the License.
*/
package com.google.common.cache;
import static com.google.common.cache.TestingCacheLoaders.bulkLoader;
import static com.google.common.cache.TestingCacheLoaders.constantLoader;
import static com.google.common.cache.TestingCacheLoaders.errorLoader;
import static com.google.common.cache.TestingCacheLoaders.exceptionLoader;
Reported by PMD.
Line: 15
* the License.
*/
package com.google.common.cache;
import static com.google.common.cache.TestingCacheLoaders.bulkLoader;
import static com.google.common.cache.TestingCacheLoaders.constantLoader;
import static com.google.common.cache.TestingCacheLoaders.errorLoader;
import static com.google.common.cache.TestingCacheLoaders.exceptionLoader;
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
Line: 63
*
* @author mike nonemacher
*/
public class CacheLoadingTest extends TestCase {
TestLogHandler logHandler;
@Override
public void setUp() throws Exception {
super.setUp();
Reported by PMD.
guava-tests/test/com/google/common/cache/LocalCacheTest.java
1491 issues
Line: 752
try {
map.get(one, loader);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
doneSignal.countDown();
}
}.start();
Reported by PMD.
Line: 761
try {
computingSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
new Thread() {
@Override
public void run() {
Reported by PMD.
Line: 770
try {
map.get(one, loader);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
doneSignal.countDown();
}
}.start();
Reported by PMD.
Line: 789
try {
doneSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.cleanUp(); // force notifications
assertTrue(listener.isEmpty());
assertTrue(map.containsKey(one));
Reported by PMD.
Line: 850
try {
map.get(one, loader);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
doneSignal.countDown();
}
}.start();
Reported by PMD.
Line: 859
try {
computingSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.put(one, two);
assertSame(two, map.get(one));
startSignal.countDown();
Reported by PMD.
Line: 869
try {
doneSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.cleanUp(); // force notifications
assertNotified(listener, one, computedObject, RemovalCause.REPLACED);
assertTrue(listener.isEmpty());
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.cache;
import static com.google.common.cache.CacheBuilder.NULL_TICKER;
import static com.google.common.cache.LocalCache.DISCARDING_QUEUE;
import static com.google.common.cache.LocalCache.DRAIN_THRESHOLD;
import static com.google.common.cache.LocalCache.nullEntry;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.cache;
import static com.google.common.cache.CacheBuilder.NULL_TICKER;
import static com.google.common.cache.LocalCache.DISCARDING_QUEUE;
import static com.google.common.cache.LocalCache.DRAIN_THRESHOLD;
import static com.google.common.cache.LocalCache.nullEntry;
Reported by PMD.
Line: 82
import junit.framework.TestSuite;
/** @author Charles Fry */
@SuppressWarnings("GuardedBy") // TODO(b/35466881): Fix or suppress.
public class LocalCacheTest extends TestCase {
private static class TestStringCacheGenerator extends TestStringMapGenerator {
private final CacheBuilder<? super String, ? super String> builder;
TestStringCacheGenerator(CacheBuilder<? super String, ? super String> builder) {
Reported by PMD.
android/guava-tests/test/com/google/common/cache/LocalCacheTest.java
1467 issues
Line: 739
try {
map.get(one, loader);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
doneSignal.countDown();
}
}.start();
Reported by PMD.
Line: 748
try {
computingSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
new Thread() {
@Override
public void run() {
Reported by PMD.
Line: 757
try {
map.get(one, loader);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
doneSignal.countDown();
}
}.start();
Reported by PMD.
Line: 776
try {
doneSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.cleanUp(); // force notifications
assertTrue(listener.isEmpty());
assertTrue(map.containsKey(one));
Reported by PMD.
Line: 837
try {
map.get(one, loader);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
doneSignal.countDown();
}
}.start();
Reported by PMD.
Line: 846
try {
computingSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.put(one, two);
assertSame(two, map.get(one));
startSignal.countDown();
Reported by PMD.
Line: 856
try {
doneSignal.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
map.cleanUp(); // force notifications
assertNotified(listener, one, computedObject, RemovalCause.REPLACED);
assertTrue(listener.isEmpty());
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.cache;
import static com.google.common.cache.CacheBuilder.NULL_TICKER;
import static com.google.common.cache.LocalCache.DISCARDING_QUEUE;
import static com.google.common.cache.LocalCache.DRAIN_THRESHOLD;
import static com.google.common.cache.LocalCache.nullEntry;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.cache;
import static com.google.common.cache.CacheBuilder.NULL_TICKER;
import static com.google.common.cache.LocalCache.DISCARDING_QUEUE;
import static com.google.common.cache.LocalCache.DRAIN_THRESHOLD;
import static com.google.common.cache.LocalCache.nullEntry;
Reported by PMD.
Line: 81
import junit.framework.TestSuite;
/** @author Charles Fry */
@SuppressWarnings("GuardedBy") // TODO(b/35466881): Fix or suppress.
public class LocalCacheTest extends TestCase {
private static class TestStringCacheGenerator extends TestStringMapGenerator {
private final CacheBuilder<? super String, ? super String> builder;
TestStringCacheGenerator(CacheBuilder<? super String, ? super String> builder) {
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/FuturesTest.java
1288 issues
Line: 2837
} catch (InterruptedException e) {
// Ensure the thread's interrupt status is preserved.
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
};
ListenableFuture<?> futureResult =
Reported by PMD.
Line: 3055
@Override
public String get() {
throw new RuntimeException();
}
@Override
public String get(long timeout, TimeUnit unit) {
throw new RuntimeException();
Reported by PMD.
Line: 3060
@Override
public String get(long timeout, TimeUnit unit) {
throw new RuntimeException();
}
};
final SettableFuture<String> delayedSuccess = SettableFuture.create();
final SettableFuture<String> delayedFailed = SettableFuture.create();
Reported by PMD.
Line: 3079
@Override
public String get() throws ExecutionException, InterruptedException {
delegateForDelayedRuntimeException.get();
throw new RuntimeException();
}
@Override
public String get(long timeout, TimeUnit unit)
throws ExecutionException, InterruptedException, TimeoutException {
Reported by PMD.
Line: 3086
public String get(long timeout, TimeUnit unit)
throws ExecutionException, InterruptedException, TimeoutException {
delegateForDelayedRuntimeException.get(timeout, unit);
throw new RuntimeException();
}
};
final Runnable doNothing =
new Runnable() {
Reported by PMD.
Line: 100
* @author Nishant Thakkar
*/
@GwtCompatible(emulated = true)
public class FuturesTest extends TestCase {
private static final Logger aggregateFutureLogger =
Logger.getLogger(AggregateFuture.class.getName());
private final TestLogHandler aggregateFutureLogHandler = new TestLogHandler();
private static final String DATA1 = "data";
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.Functions.identity;
import static com.google.common.base.Throwables.propagateIfInstanceOf;
import static com.google.common.collect.Iterables.getOnlyElement;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.Functions.identity;
import static com.google.common.base.Throwables.propagateIfInstanceOf;
import static com.google.common.collect.Iterables.getOnlyElement;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.Functions.identity;
import static com.google.common.base.Throwables.propagateIfInstanceOf;
import static com.google.common.collect.Iterables.getOnlyElement;
Reported by PMD.
Line: 99
*
* @author Nishant Thakkar
*/
@GwtCompatible(emulated = true)
public class FuturesTest extends TestCase {
private static final Logger aggregateFutureLogger =
Logger.getLogger(AggregateFuture.class.getName());
private final TestLogHandler aggregateFutureLogHandler = new TestLogHandler();
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java
1288 issues
Line: 2837
} catch (InterruptedException e) {
// Ensure the thread's interrupt status is preserved.
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
};
ListenableFuture<?> futureResult =
Reported by PMD.
Line: 3055
@Override
public String get() {
throw new RuntimeException();
}
@Override
public String get(long timeout, TimeUnit unit) {
throw new RuntimeException();
Reported by PMD.
Line: 3060
@Override
public String get(long timeout, TimeUnit unit) {
throw new RuntimeException();
}
};
final SettableFuture<String> delayedSuccess = SettableFuture.create();
final SettableFuture<String> delayedFailed = SettableFuture.create();
Reported by PMD.
Line: 3079
@Override
public String get() throws ExecutionException, InterruptedException {
delegateForDelayedRuntimeException.get();
throw new RuntimeException();
}
@Override
public String get(long timeout, TimeUnit unit)
throws ExecutionException, InterruptedException, TimeoutException {
Reported by PMD.
Line: 3086
public String get(long timeout, TimeUnit unit)
throws ExecutionException, InterruptedException, TimeoutException {
delegateForDelayedRuntimeException.get(timeout, unit);
throw new RuntimeException();
}
};
final Runnable doNothing =
new Runnable() {
Reported by PMD.
Line: 100
* @author Nishant Thakkar
*/
@GwtCompatible(emulated = true)
public class FuturesTest extends TestCase {
private static final Logger aggregateFutureLogger =
Logger.getLogger(AggregateFuture.class.getName());
private final TestLogHandler aggregateFutureLogHandler = new TestLogHandler();
private static final String DATA1 = "data";
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.Functions.identity;
import static com.google.common.base.Throwables.propagateIfInstanceOf;
import static com.google.common.collect.Iterables.getOnlyElement;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.Functions.identity;
import static com.google.common.base.Throwables.propagateIfInstanceOf;
import static com.google.common.collect.Iterables.getOnlyElement;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.util.concurrent;
import static com.google.common.base.Functions.constant;
import static com.google.common.base.Functions.identity;
import static com.google.common.base.Throwables.propagateIfInstanceOf;
import static com.google.common.collect.Iterables.getOnlyElement;
Reported by PMD.
Line: 99
*
* @author Nishant Thakkar
*/
@GwtCompatible(emulated = true)
public class FuturesTest extends TestCase {
private static final Logger aggregateFutureLogger =
Logger.getLogger(AggregateFuture.class.getName());
private final TestLogHandler aggregateFutureLogHandler = new TestLogHandler();
Reported by PMD.
android/guava-tests/test/com/google/common/collect/MapsTest.java
1161 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Maps.transformEntries;
import static com.google.common.collect.Maps.transformValues;
import static com.google.common.collect.Maps.unmodifiableNavigableMap;
import static com.google.common.collect.testing.Helpers.mapEntry;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Maps.transformEntries;
import static com.google.common.collect.Maps.transformValues;
import static com.google.common.collect.Maps.unmodifiableNavigableMap;
import static com.google.common.collect.testing.Helpers.mapEntry;
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 79
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
assertEquals(Collections.emptyMap(), map);
}
public void testHashMapWithInitialMap() {
Reported by PMD.
Line: 81
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
assertEquals(Collections.emptyMap(), map);
}
public void testHashMapWithInitialMap() {
Map<String, Integer> original = new TreeMap<>();
original.put("a", 1);
Reported by PMD.
guava-tests/test/com/google/common/collect/MapsTest.java
1161 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Maps.transformEntries;
import static com.google.common.collect.Maps.transformValues;
import static com.google.common.collect.Maps.unmodifiableNavigableMap;
import static com.google.common.collect.testing.Helpers.mapEntry;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Maps.transformEntries;
import static com.google.common.collect.Maps.transformValues;
import static com.google.common.collect.Maps.unmodifiableNavigableMap;
import static com.google.common.collect.testing.Helpers.mapEntry;
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 75
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class MapsTest extends TestCase {
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
Reported by PMD.
Line: 79
private static final Comparator<Integer> SOME_COMPARATOR = Collections.reverseOrder();
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
assertEquals(Collections.emptyMap(), map);
}
public void testHashMapWithInitialMap() {
Reported by PMD.
Line: 81
public void testHashMap() {
HashMap<Integer, Integer> map = Maps.newHashMap();
assertEquals(Collections.emptyMap(), map);
}
public void testHashMapWithInitialMap() {
Map<String, Integer> original = new TreeMap<>();
original.put("a", 1);
Reported by PMD.
guava-tests/test/com/google/common/reflect/TypeTokenTest.java
1007 issues
Line: 57
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class TypeTokenTest extends TestCase {
private abstract static class StringList implements List<String> {}
private abstract static class IntegerList implements List<Integer> {}
public void testValueEqualityNotInstanceEquality() {
TypeToken<List<String>> a = new TypeToken<List<String>>() {};
Reported by PMD.
Line: 59
private abstract static class StringList implements List<String> {}
private abstract static class IntegerList implements List<Integer> {}
public void testValueEqualityNotInstanceEquality() {
TypeToken<List<String>> a = new TypeToken<List<String>>() {};
TypeToken<List<String>> b = new TypeToken<List<String>>() {};
assertEquals(a, b);
Reported by PMD.
Line: 190
}
public void testGetTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types)
.containsExactly(
new TypeToken<Class3<String>>() {},
Reported by PMD.
Line: 191
public void testGetTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types)
.containsExactly(
new TypeToken<Class3<String>>() {},
new TypeToken<Interface3<String>>() {},
Reported by PMD.
Line: 221
}
public void testGetTypes_rawTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types.rawTypes())
.containsExactly(
Class3.class,
Reported by PMD.
Line: 222
public void testGetTypes_rawTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types.rawTypes())
.containsExactly(
Class3.class,
Interface3.class,
Reported by PMD.
Line: 567
private static final class NoInterface {}
private abstract static class Implementation<K, V> implements Iterable<V>, Map<K, V> {}
private abstract static class First<T> {}
private abstract static class Second<D> extends First<D> {}
Reported by PMD.
Line: 569
private abstract static class Implementation<K, V> implements Iterable<V>, Map<K, V> {}
private abstract static class First<T> {}
private abstract static class Second<D> extends First<D> {}
private abstract static class Third<T, D> extends Second<T> {}
Reported by PMD.
Line: 571
private abstract static class First<T> {}
private abstract static class Second<D> extends First<D> {}
private abstract static class Third<T, D> extends Second<T> {}
private abstract static class Fourth<T, D> extends Third<D, T> {}
Reported by PMD.
Line: 573
private abstract static class Second<D> extends First<D> {}
private abstract static class Third<T, D> extends Second<T> {}
private abstract static class Fourth<T, D> extends Third<D, T> {}
private static class ConcreteIS extends Fourth<Integer, String> {}
Reported by PMD.
android/guava-tests/test/com/google/common/reflect/TypeTokenTest.java
1007 issues
Line: 57
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class TypeTokenTest extends TestCase {
private abstract static class StringList implements List<String> {}
private abstract static class IntegerList implements List<Integer> {}
public void testValueEqualityNotInstanceEquality() {
TypeToken<List<String>> a = new TypeToken<List<String>>() {};
Reported by PMD.
Line: 59
private abstract static class StringList implements List<String> {}
private abstract static class IntegerList implements List<Integer> {}
public void testValueEqualityNotInstanceEquality() {
TypeToken<List<String>> a = new TypeToken<List<String>>() {};
TypeToken<List<String>> b = new TypeToken<List<String>>() {};
assertEquals(a, b);
Reported by PMD.
Line: 190
}
public void testGetTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types)
.containsExactly(
new TypeToken<Class3<String>>() {},
Reported by PMD.
Line: 191
public void testGetTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types)
.containsExactly(
new TypeToken<Class3<String>>() {},
new TypeToken<Interface3<String>>() {},
Reported by PMD.
Line: 221
}
public void testGetTypes_rawTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types.rawTypes())
.containsExactly(
Class3.class,
Reported by PMD.
Line: 222
public void testGetTypes_rawTypes_withInterfacesAndSuperclasses() {
abstract class Class2 extends Class1 implements Interface12 {}
abstract class Class3<T> extends Class2 implements Interface3<T> {}
TypeToken<Class3<String>>.TypeSet types = new TypeToken<Class3<String>>() {}.getTypes();
makeUnmodifiable(types.rawTypes())
.containsExactly(
Class3.class,
Interface3.class,
Reported by PMD.
Line: 567
private static final class NoInterface {}
private abstract static class Implementation<K, V> implements Iterable<V>, Map<K, V> {}
private abstract static class First<T> {}
private abstract static class Second<D> extends First<D> {}
Reported by PMD.
Line: 569
private abstract static class Implementation<K, V> implements Iterable<V>, Map<K, V> {}
private abstract static class First<T> {}
private abstract static class Second<D> extends First<D> {}
private abstract static class Third<T, D> extends Second<T> {}
Reported by PMD.
Line: 571
private abstract static class First<T> {}
private abstract static class Second<D> extends First<D> {}
private abstract static class Third<T, D> extends Second<T> {}
private abstract static class Fourth<T, D> extends Third<D, T> {}
Reported by PMD.
Line: 573
private abstract static class Second<D> extends First<D> {}
private abstract static class Third<T, D> extends Second<T> {}
private abstract static class Fourth<T, D> extends Third<D, T> {}
private static class ConcreteIS extends Fourth<Integer, String> {}
Reported by PMD.