The following issues were found
guava-tests/test/com/google/common/collect/StreamsTest.java
204 issues
Line: 15
* the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Streams.stream;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
Reported by PMD.
Line: 43
/** Unit test for {@link Streams}. */
@GwtCompatible(emulated = true)
public class StreamsTest extends TestCase {
/*
* Full and proper black-box testing of a Stream-returning method is extremely involved, and is
* overkill when nearly all Streams are produced using well-tested JDK calls. So, we cheat and
* just test that the toArray() contents are as expected.
*/
Reported by PMD.
Line: 43
/** Unit test for {@link Streams}. */
@GwtCompatible(emulated = true)
public class StreamsTest extends TestCase {
/*
* Full and proper black-box testing of a Stream-returning method is extremely involved, and is
* overkill when nearly all Streams are produced using well-tested JDK calls. So, we cheat and
* just test that the toArray() contents are as expected.
*/
Reported by PMD.
Line: 49
* overkill when nearly all Streams are produced using well-tested JDK calls. So, we cheat and
* just test that the toArray() contents are as expected.
*/
public void testStream_nonCollection() {
assertThat(stream(FluentIterable.of())).isEmpty();
assertThat(stream(FluentIterable.of("a"))).containsExactly("a");
assertThat(stream(FluentIterable.of(1, 2, 3)).filter(n -> n > 1)).containsExactly(2, 3);
}
Reported by PMD.
Line: 49
* overkill when nearly all Streams are produced using well-tested JDK calls. So, we cheat and
* just test that the toArray() contents are as expected.
*/
public void testStream_nonCollection() {
assertThat(stream(FluentIterable.of())).isEmpty();
assertThat(stream(FluentIterable.of("a"))).containsExactly("a");
assertThat(stream(FluentIterable.of(1, 2, 3)).filter(n -> n > 1)).containsExactly(2, 3);
}
Reported by PMD.
Line: 50
* just test that the toArray() contents are as expected.
*/
public void testStream_nonCollection() {
assertThat(stream(FluentIterable.of())).isEmpty();
assertThat(stream(FluentIterable.of("a"))).containsExactly("a");
assertThat(stream(FluentIterable.of(1, 2, 3)).filter(n -> n > 1)).containsExactly(2, 3);
}
@SuppressWarnings("deprecation")
Reported by PMD.
Line: 51
*/
public void testStream_nonCollection() {
assertThat(stream(FluentIterable.of())).isEmpty();
assertThat(stream(FluentIterable.of("a"))).containsExactly("a");
assertThat(stream(FluentIterable.of(1, 2, 3)).filter(n -> n > 1)).containsExactly(2, 3);
}
@SuppressWarnings("deprecation")
public void testStream_collection() {
Reported by PMD.
Line: 52
public void testStream_nonCollection() {
assertThat(stream(FluentIterable.of())).isEmpty();
assertThat(stream(FluentIterable.of("a"))).containsExactly("a");
assertThat(stream(FluentIterable.of(1, 2, 3)).filter(n -> n > 1)).containsExactly(2, 3);
}
@SuppressWarnings("deprecation")
public void testStream_collection() {
assertThat(stream(Arrays.asList())).isEmpty();
Reported by PMD.
Line: 52
public void testStream_nonCollection() {
assertThat(stream(FluentIterable.of())).isEmpty();
assertThat(stream(FluentIterable.of("a"))).containsExactly("a");
assertThat(stream(FluentIterable.of(1, 2, 3)).filter(n -> n > 1)).containsExactly(2, 3);
}
@SuppressWarnings("deprecation")
public void testStream_collection() {
assertThat(stream(Arrays.asList())).isEmpty();
Reported by PMD.
Line: 52
public void testStream_nonCollection() {
assertThat(stream(FluentIterable.of())).isEmpty();
assertThat(stream(FluentIterable.of("a"))).containsExactly("a");
assertThat(stream(FluentIterable.of(1, 2, 3)).filter(n -> n > 1)).containsExactly(2, 3);
}
@SuppressWarnings("deprecation")
public void testStream_collection() {
assertThat(stream(Arrays.asList())).isEmpty();
Reported by PMD.
guava-tests/test/com/google/common/collect/LinkedHashMultimapTest.java
203 issues
Line: 54
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class LinkedHashMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
Reported by PMD.
Line: 56
@GwtCompatible(emulated = true)
public class LinkedHashMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
SetMultimapTestSuiteBuilder.using(
new TestStringSetMultimapGenerator() {
Reported by PMD.
Line: 87
return suite;
}
public void testValueSetHashTableExpansion() {
LinkedHashMultimap<String, Integer> multimap = LinkedHashMultimap.create();
for (int z = 1; z <= 100; z++) {
multimap.put("a", z);
// The Eclipse compiler (and hence GWT) rejects a parameterized cast.
@SuppressWarnings("unchecked")
Reported by PMD.
Line: 87
return suite;
}
public void testValueSetHashTableExpansion() {
LinkedHashMultimap<String, Integer> multimap = LinkedHashMultimap.create();
for (int z = 1; z <= 100; z++) {
multimap.put("a", z);
// The Eclipse compiler (and hence GWT) rejects a parameterized cast.
@SuppressWarnings("unchecked")
Reported by PMD.
Line: 94
// The Eclipse compiler (and hence GWT) rejects a parameterized cast.
@SuppressWarnings("unchecked")
LinkedHashMultimap<String, Integer>.ValueSet valueSet =
(LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
assertEquals(z, valueSet.size());
assertFalse(
Hashing.needsResizing(
valueSet.size(),
valueSet.hashTable.length,
Reported by PMD.
Line: 95
@SuppressWarnings("unchecked")
LinkedHashMultimap<String, Integer>.ValueSet valueSet =
(LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
assertEquals(z, valueSet.size());
assertFalse(
Hashing.needsResizing(
valueSet.size(),
valueSet.hashTable.length,
LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));
Reported by PMD.
Line: 95
@SuppressWarnings("unchecked")
LinkedHashMultimap<String, Integer>.ValueSet valueSet =
(LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
assertEquals(z, valueSet.size());
assertFalse(
Hashing.needsResizing(
valueSet.size(),
valueSet.hashTable.length,
LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));
Reported by PMD.
Line: 96
LinkedHashMultimap<String, Integer>.ValueSet valueSet =
(LinkedHashMultimap.ValueSet) multimap.backingMap().get("a");
assertEquals(z, valueSet.size());
assertFalse(
Hashing.needsResizing(
valueSet.size(),
valueSet.hashTable.length,
LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));
}
Reported by PMD.
Line: 98
assertEquals(z, valueSet.size());
assertFalse(
Hashing.needsResizing(
valueSet.size(),
valueSet.hashTable.length,
LinkedHashMultimap.VALUE_SET_LOAD_FACTOR));
}
}
Reported by PMD.
Line: 106
private Multimap<String, Integer> initializeMultimap5() {
Multimap<String, Integer> multimap = LinkedHashMultimap.create();
multimap.put("foo", 5);
multimap.put("bar", 4);
multimap.put("foo", 3);
multimap.put("cow", 2);
multimap.put("bar", 1);
return multimap;
Reported by PMD.
guava-tests/test/com/google/common/cache/CacheManualTest.java
203 issues
Line: 26
/** @author Charles Fry */
public class CacheManualTest extends TestCase {
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
Reported by PMD.
Line: 26
/** @author Charles Fry */
public class CacheManualTest extends TestCase {
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
Reported by PMD.
Line: 26
/** @author Charles Fry */
public class CacheManualTest extends TestCase {
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
Reported by PMD.
Line: 28
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Reported by PMD.
Line: 29
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Reported by PMD.
Line: 29
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Reported by PMD.
Line: 30
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
Line: 30
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
Line: 31
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
Line: 31
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
android/guava-tests/test/com/google/common/cache/CacheManualTest.java
203 issues
Line: 26
/** @author Charles Fry */
public class CacheManualTest extends TestCase {
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
Reported by PMD.
Line: 26
/** @author Charles Fry */
public class CacheManualTest extends TestCase {
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
Reported by PMD.
Line: 26
/** @author Charles Fry */
public class CacheManualTest extends TestCase {
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
Reported by PMD.
Line: 28
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Reported by PMD.
Line: 29
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Reported by PMD.
Line: 29
public void testGetIfPresent() {
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Reported by PMD.
Line: 30
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
Line: 30
Cache<Object, Object> cache = CacheBuilder.newBuilder().recordStats().build();
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
Line: 31
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
Line: 31
CacheStats stats = cache.stats();
assertEquals(0, stats.missCount());
assertEquals(0, stats.loadSuccessCount());
assertEquals(0, stats.loadExceptionCount());
assertEquals(0, stats.hitCount());
Object one = new Object();
Object two = new Object();
Reported by PMD.
android/guava-tests/test/com/google/common/reflect/ClassPathTest.java
202 issues
Line: 520
Closer closer = Closer.create();
try {
FileOutputStream fileOut = closer.register(new FileOutputStream(jarFile));
JarOutputStream jarOut = closer.register(new JarOutputStream(fileOut));
for (String entry : entries) {
jarOut.putNextEntry(new ZipEntry(entry));
Resources.copy(ClassPathTest.class.getResource(entry), jarOut);
jarOut.closeEntry();
Reported by PMD.
Line: 16
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.common.reflect;
import static com.google.common.base.Charsets.US_ASCII;
import static com.google.common.base.StandardSystemProperty.JAVA_CLASS_PATH;
import static com.google.common.base.StandardSystemProperty.PATH_SEPARATOR;
import static com.google.common.truth.Truth.assertThat;
Reported by PMD.
Line: 54
import org.junit.Test;
/** Functional tests of {@link ClassPath}. */
public class ClassPathTest extends TestCase {
private static final Logger log = Logger.getLogger(ClassPathTest.class.getName());
private static final File FILE = new File(".");
public void testEquals() {
new EqualsTester()
Reported by PMD.
Line: 54
import org.junit.Test;
/** Functional tests of {@link ClassPath}. */
public class ClassPathTest extends TestCase {
private static final Logger log = Logger.getLogger(ClassPathTest.class.getName());
private static final File FILE = new File(".");
public void testEquals() {
new EqualsTester()
Reported by PMD.
Line: 55
/** Functional tests of {@link ClassPath}. */
public class ClassPathTest extends TestCase {
private static final Logger log = Logger.getLogger(ClassPathTest.class.getName());
private static final File FILE = new File(".");
public void testEquals() {
new EqualsTester()
.addEqualityGroup(classInfo(ClassPathTest.class), classInfo(ClassPathTest.class))
Reported by PMD.
Line: 58
private static final Logger log = Logger.getLogger(ClassPathTest.class.getName());
private static final File FILE = new File(".");
public void testEquals() {
new EqualsTester()
.addEqualityGroup(classInfo(ClassPathTest.class), classInfo(ClassPathTest.class))
.addEqualityGroup(classInfo(Test.class), classInfo(Test.class, getClass().getClassLoader()))
.addEqualityGroup(
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()),
Reported by PMD.
Line: 58
private static final Logger log = Logger.getLogger(ClassPathTest.class.getName());
private static final File FILE = new File(".");
public void testEquals() {
new EqualsTester()
.addEqualityGroup(classInfo(ClassPathTest.class), classInfo(ClassPathTest.class))
.addEqualityGroup(classInfo(Test.class), classInfo(Test.class, getClass().getClassLoader()))
.addEqualityGroup(
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()),
Reported by PMD.
Line: 61
public void testEquals() {
new EqualsTester()
.addEqualityGroup(classInfo(ClassPathTest.class), classInfo(ClassPathTest.class))
.addEqualityGroup(classInfo(Test.class), classInfo(Test.class, getClass().getClassLoader()))
.addEqualityGroup(
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()),
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()))
.addEqualityGroup(new ResourceInfo(FILE, "x.txt", getClass().getClassLoader()))
.testEquals();
Reported by PMD.
Line: 61
public void testEquals() {
new EqualsTester()
.addEqualityGroup(classInfo(ClassPathTest.class), classInfo(ClassPathTest.class))
.addEqualityGroup(classInfo(Test.class), classInfo(Test.class, getClass().getClassLoader()))
.addEqualityGroup(
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()),
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()))
.addEqualityGroup(new ResourceInfo(FILE, "x.txt", getClass().getClassLoader()))
.testEquals();
Reported by PMD.
Line: 63
.addEqualityGroup(classInfo(ClassPathTest.class), classInfo(ClassPathTest.class))
.addEqualityGroup(classInfo(Test.class), classInfo(Test.class, getClass().getClassLoader()))
.addEqualityGroup(
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()),
new ResourceInfo(FILE, "a/b/c.txt", getClass().getClassLoader()))
.addEqualityGroup(new ResourceInfo(FILE, "x.txt", getClass().getClassLoader()))
.testEquals();
}
Reported by PMD.
guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java
197 issues
Line: 342
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
Reported by PMD.
Line: 343
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
Reported by PMD.
Line: 378
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
Reported by PMD.
Line: 379
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
assertTrue(multiset.contains(s2));
Reported by PMD.
Line: 424
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
multiset = reserializeAndAssert(multiset);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
Reported by PMD.
Line: 425
multiset = reserializeAndAssert(multiset);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
Reported by PMD.
Line: 49
* @author Cliff L. Biffle
* @author mike nonemacher
*/
public class ConcurrentHashMultisetTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
Reported by PMD.
Line: 51
*/
public class ConcurrentHashMultisetTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
Reported by PMD.
Line: 54
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.SERIALIZABLE,
CollectionFeature.ALLOWS_NULL_QUERIES)
Reported by PMD.
Line: 54
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.SERIALIZABLE,
CollectionFeature.ALLOWS_NULL_QUERIES)
Reported by PMD.
guava-tests/test/com/google/common/base/FunctionsTest.java
197 issues
Line: 48
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
}
@GwtIncompatible // SerializableTester
public void testIdentitySerializable() {
checkCanReserializeSingleton(Functions.identity());
Reported by PMD.
Line: 48
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
}
@GwtIncompatible // SerializableTester
public void testIdentitySerializable() {
checkCanReserializeSingleton(Functions.identity());
Reported by PMD.
Line: 38
* @author Vlad Patryshev
*/
@GwtCompatible(emulated = true)
public class FunctionsTest extends TestCase {
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
Reported by PMD.
Line: 40
@GwtCompatible(emulated = true)
public class FunctionsTest extends TestCase {
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
Reported by PMD.
Line: 40
@GwtCompatible(emulated = true)
public class FunctionsTest extends TestCase {
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
Reported by PMD.
Line: 42
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
Reported by PMD.
Line: 42
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
Reported by PMD.
Line: 43
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
Reported by PMD.
Line: 43
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
Reported by PMD.
Line: 46
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
}
@GwtIncompatible // SerializableTester
Reported by PMD.
android/guava-tests/test/com/google/common/base/FunctionsTest.java
197 issues
Line: 48
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
}
@GwtIncompatible // SerializableTester
public void testIdentitySerializable() {
checkCanReserializeSingleton(Functions.identity());
Reported by PMD.
Line: 48
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
}
@GwtIncompatible // SerializableTester
public void testIdentitySerializable() {
checkCanReserializeSingleton(Functions.identity());
Reported by PMD.
Line: 38
* @author Vlad Patryshev
*/
@GwtCompatible(emulated = true)
public class FunctionsTest extends TestCase {
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
Reported by PMD.
Line: 40
@GwtCompatible(emulated = true)
public class FunctionsTest extends TestCase {
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
Reported by PMD.
Line: 40
@GwtCompatible(emulated = true)
public class FunctionsTest extends TestCase {
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
Reported by PMD.
Line: 42
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
Reported by PMD.
Line: 42
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
Reported by PMD.
Line: 43
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
Reported by PMD.
Line: 43
public void testIdentity_same() {
Function<String, String> identity = Functions.identity();
assertNull(identity.apply(null));
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
Reported by PMD.
Line: 46
assertSame("foo", identity.apply("foo"));
}
public void testIdentity_notSame() {
Function<Long, Long> identity = Functions.identity();
assertNotSame(new Long(135135L), identity.apply(new Long(135135L)));
}
@GwtIncompatible // SerializableTester
Reported by PMD.
android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java
197 issues
Line: 342
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
Reported by PMD.
Line: 343
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
Reported by PMD.
Line: 378
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
Reported by PMD.
Line: 379
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
assertTrue(multiset.contains(s2));
Reported by PMD.
Line: 424
ConcurrentHashMultiset<String> multiset = ConcurrentHashMultiset.create(map);
multiset = reserializeAndAssert(multiset);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
Reported by PMD.
Line: 425
multiset = reserializeAndAssert(multiset);
String s1 = new String("a");
String s2 = new String("a");
assertEquals(s1, s2); // Stating the obvious.
assertTrue(s1 != s2); // Stating the obvious.
multiset.add(s1);
assertTrue(multiset.contains(s1));
Reported by PMD.
Line: 49
* @author Cliff L. Biffle
* @author mike nonemacher
*/
public class ConcurrentHashMultisetTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
Reported by PMD.
Line: 51
*/
public class ConcurrentHashMultisetTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
Reported by PMD.
Line: 54
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.SERIALIZABLE,
CollectionFeature.ALLOWS_NULL_QUERIES)
Reported by PMD.
Line: 54
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
MultisetTestSuiteBuilder.using(concurrentHashMultisetGenerator())
.withFeatures(
CollectionSize.ANY,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.SERIALIZABLE,
CollectionFeature.ALLOWS_NULL_QUERIES)
Reported by PMD.
guava-tests/test/com/google/common/math/PairedStatsAccumulatorTest.java
194 issues
Line: 17
* limitations under the License.
*/
package com.google.common.math;
import static com.google.common.math.StatsTesting.ALLOWED_ERROR;
import static com.google.common.math.StatsTesting.ALL_MANY_VALUES;
import static com.google.common.math.StatsTesting.EMPTY_STATS_ITERABLE;
import static com.google.common.math.StatsTesting.MANY_VALUES;
Reported by PMD.
Line: 60
*
* @author Pete Gillin
*/
public class PairedStatsAccumulatorTest extends TestCase {
private PairedStatsAccumulator emptyAccumulator;
private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
Reported by PMD.
Line: 60
*
* @author Pete Gillin
*/
public class PairedStatsAccumulatorTest extends TestCase {
private PairedStatsAccumulator emptyAccumulator;
private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
Reported by PMD.
Line: 62
*/
public class PairedStatsAccumulatorTest extends TestCase {
private PairedStatsAccumulator emptyAccumulator;
private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator twoValuesAccumulator;
private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
Reported by PMD.
Line: 63
public class PairedStatsAccumulatorTest extends TestCase {
private PairedStatsAccumulator emptyAccumulator;
private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator twoValuesAccumulator;
private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator manyValuesAccumulator;
Reported by PMD.
Line: 64
private PairedStatsAccumulator emptyAccumulator;
private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator twoValuesAccumulator;
private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator manyValuesAccumulator;
private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
Reported by PMD.
Line: 65
private PairedStatsAccumulator emptyAccumulator;
private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator twoValuesAccumulator;
private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator manyValuesAccumulator;
private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator horizontalValuesAccumulator;
Reported by PMD.
Line: 66
private PairedStatsAccumulator emptyAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator twoValuesAccumulator;
private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator manyValuesAccumulator;
private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator horizontalValuesAccumulator;
private PairedStatsAccumulator horizontalValuesAccumulatorByAddAllPartitionedPairedStats;
Reported by PMD.
Line: 67
private PairedStatsAccumulator oneValueAccumulator;
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator twoValuesAccumulator;
private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator manyValuesAccumulator;
private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator horizontalValuesAccumulator;
private PairedStatsAccumulator horizontalValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator verticalValuesAccumulator;
Reported by PMD.
Line: 68
private PairedStatsAccumulator oneValueAccumulatorByAddAllEmptyPairedStats;
private PairedStatsAccumulator twoValuesAccumulator;
private PairedStatsAccumulator twoValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator manyValuesAccumulator;
private PairedStatsAccumulator manyValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator horizontalValuesAccumulator;
private PairedStatsAccumulator horizontalValuesAccumulatorByAddAllPartitionedPairedStats;
private PairedStatsAccumulator verticalValuesAccumulator;
private PairedStatsAccumulator verticalValuesAccumulatorByAddAllPartitionedPairedStats;
Reported by PMD.