The following issues were found
android/guava-tests/test/com/google/common/collect/ImmutableListTest.java
300 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.Iterables.unmodifiableIterable;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_QUERIES;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.Iterables.unmodifiableIterable;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_QUERIES;
Reported by PMD.
Line: 66
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class ImmutableListTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
Reported by PMD.
Line: 68
@GwtCompatible(emulated = true)
public class ImmutableListTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
ListTestSuiteBuilder.using(new ImmutableListOfGenerator())
.named("ImmutableList")
Reported by PMD.
Line: 115
return suite;
}
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
Reported by PMD.
Line: 115
return suite;
}
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
Reported by PMD.
Line: 116
}
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
public void testCreation_oneElement() {
Reported by PMD.
Line: 118
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
public void testCreation_oneElement() {
List<String> list = ImmutableList.of("a");
assertEquals(Collections.singletonList("a"), list);
Reported by PMD.
Line: 121
assertEquals(Collections.emptyList(), list);
}
public void testCreation_oneElement() {
List<String> list = ImmutableList.of("a");
assertEquals(Collections.singletonList("a"), list);
}
public void testCreation_twoElements() {
Reported by PMD.
Line: 123
public void testCreation_oneElement() {
List<String> list = ImmutableList.of("a");
assertEquals(Collections.singletonList("a"), list);
}
public void testCreation_twoElements() {
List<String> list = ImmutableList.of("a", "b");
assertEquals(Lists.newArrayList("a", "b"), list);
Reported by PMD.
android/guava-tests/test/com/google/common/math/QuantilesTest.java
298 issues
Line: 17
* limitations under the License.
*/
package com.google.common.math;
import static com.google.common.math.Quantiles.median;
import static com.google.common.math.Quantiles.percentiles;
import static com.google.common.math.Quantiles.quartiles;
import static com.google.common.truth.Truth.assertThat;
Reported by PMD.
Line: 52
*
* @author Pete Gillin
*/
public class QuantilesTest extends TestCase {
/*
* Since Quantiles provides a fluent-style API, each test covers a chain of methods resulting in
* the computation of one or more quantiles (or in an error) rather than individual methods. The
* tests are divided into three sections:
Reported by PMD.
Line: 52
*
* @author Pete Gillin
*/
public class QuantilesTest extends TestCase {
/*
* Since Quantiles provides a fluent-style API, each test covers a chain of methods resulting in
* the computation of one or more quantiles (or in an error) rather than individual methods. The
* tests are divided into three sections:
Reported by PMD.
Line: 52
*
* @author Pete Gillin
*/
public class QuantilesTest extends TestCase {
/*
* Since Quantiles provides a fluent-style API, each test covers a chain of methods resulting in
* the computation of one or more quantiles (or in an error) rather than individual methods. The
* tests are divided into three sections:
Reported by PMD.
Line: 125
private static final double SIXTEEN_SQUARES_DECILE_8 = 144.0;
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
Reported by PMD.
Line: 126
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
Reported by PMD.
Line: 126
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
Reported by PMD.
Line: 126
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
Reported by PMD.
Line: 131
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
double[] dataset = Doubles.toArray(SIXTEEN_SQUARES_DOUBLES);
assertThat(median().computeInPlace(dataset)).isWithin(ALLOWED_ERROR).of(SIXTEEN_SQUARES_MEDIAN);
assertThat(dataset).usingExactEquality().containsExactlyElementsIn(SIXTEEN_SQUARES_DOUBLES);
}
Reported by PMD.
Line: 131
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
double[] dataset = Doubles.toArray(SIXTEEN_SQUARES_DOUBLES);
assertThat(median().computeInPlace(dataset)).isWithin(ALLOWED_ERROR).of(SIXTEEN_SQUARES_MEDIAN);
assertThat(dataset).usingExactEquality().containsExactlyElementsIn(SIXTEEN_SQUARES_DOUBLES);
}
Reported by PMD.
guava-tests/test/com/google/common/math/QuantilesTest.java
298 issues
Line: 17
* limitations under the License.
*/
package com.google.common.math;
import static com.google.common.math.Quantiles.median;
import static com.google.common.math.Quantiles.percentiles;
import static com.google.common.math.Quantiles.quartiles;
import static com.google.common.truth.Truth.assertThat;
Reported by PMD.
Line: 52
*
* @author Pete Gillin
*/
public class QuantilesTest extends TestCase {
/*
* Since Quantiles provides a fluent-style API, each test covers a chain of methods resulting in
* the computation of one or more quantiles (or in an error) rather than individual methods. The
* tests are divided into three sections:
Reported by PMD.
Line: 52
*
* @author Pete Gillin
*/
public class QuantilesTest extends TestCase {
/*
* Since Quantiles provides a fluent-style API, each test covers a chain of methods resulting in
* the computation of one or more quantiles (or in an error) rather than individual methods. The
* tests are divided into three sections:
Reported by PMD.
Line: 52
*
* @author Pete Gillin
*/
public class QuantilesTest extends TestCase {
/*
* Since Quantiles provides a fluent-style API, each test covers a chain of methods resulting in
* the computation of one or more quantiles (or in an error) rather than individual methods. The
* tests are divided into three sections:
Reported by PMD.
Line: 125
private static final double SIXTEEN_SQUARES_DECILE_8 = 144.0;
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
Reported by PMD.
Line: 126
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
Reported by PMD.
Line: 126
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
Reported by PMD.
Line: 126
private static final double SIXTEEN_SQUARES_MAX = 225.0;
public void testMedian_compute_doubleCollection() {
assertThat(median().compute(SIXTEEN_SQUARES_DOUBLES))
.isWithin(ALLOWED_ERROR)
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
Reported by PMD.
Line: 131
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
double[] dataset = Doubles.toArray(SIXTEEN_SQUARES_DOUBLES);
assertThat(median().computeInPlace(dataset)).isWithin(ALLOWED_ERROR).of(SIXTEEN_SQUARES_MEDIAN);
assertThat(dataset).usingExactEquality().containsExactlyElementsIn(SIXTEEN_SQUARES_DOUBLES);
}
Reported by PMD.
Line: 131
.of(SIXTEEN_SQUARES_MEDIAN);
}
public void testMedian_computeInPlace() {
double[] dataset = Doubles.toArray(SIXTEEN_SQUARES_DOUBLES);
assertThat(median().computeInPlace(dataset)).isWithin(ALLOWED_ERROR).of(SIXTEEN_SQUARES_MEDIAN);
assertThat(dataset).usingExactEquality().containsExactlyElementsIn(SIXTEEN_SQUARES_DOUBLES);
}
Reported by PMD.
android/guava-tests/test/com/google/common/primitives/ShortsTest.java
296 issues
Line: 45
private static final short[] ARRAY1 = {(short) 1};
private static final short[] ARRAY234 = {(short) 2, (short) 3, (short) 4};
private static final short LEAST = Short.MIN_VALUE;
private static final short GREATEST = Short.MAX_VALUE;
private static final short[] VALUES = {LEAST, (short) -1, (short) 0, (short) 1, GREATEST};
public void testHashCode() {
Reported by PMD.
Line: 46
private static final short[] ARRAY234 = {(short) 2, (short) 3, (short) 4};
private static final short LEAST = Short.MIN_VALUE;
private static final short GREATEST = Short.MAX_VALUE;
private static final short[] VALUES = {LEAST, (short) -1, (short) 0, (short) 1, GREATEST};
public void testHashCode() {
for (short value : VALUES) {
Reported by PMD.
Line: 51
private static final short[] VALUES = {LEAST, (short) -1, (short) 0, (short) 1, GREATEST};
public void testHashCode() {
for (short value : VALUES) {
assertEquals(((Short) value).hashCode(), Shorts.hashCode(value));
}
}
public void testCheckedCast() {
Reported by PMD.
Line: 57
}
public void testCheckedCast() {
for (short value : VALUES) {
assertEquals(value, Shorts.checkedCast((long) value));
}
assertCastFails(GREATEST + 1L);
assertCastFails(LEAST - 1L);
assertCastFails(Long.MAX_VALUE);
Reported by PMD.
Line: 67
}
public void testSaturatedCast() {
for (short value : VALUES) {
assertEquals(value, Shorts.saturatedCast((long) value));
}
assertEquals(GREATEST, Shorts.saturatedCast(GREATEST + 1L));
assertEquals(LEAST, Shorts.saturatedCast(LEAST - 1L));
assertEquals(GREATEST, Shorts.saturatedCast(Long.MAX_VALUE));
Reported by PMD.
Line: 88
}
public void testCompare() {
for (short x : VALUES) {
for (short y : VALUES) {
// Only compare the sign of the result of compareTo().
int expected = Short.valueOf(x).compareTo(y);
int actual = Shorts.compare(x, y);
if (expected == 0) {
Reported by PMD.
Line: 89
public void testCompare() {
for (short x : VALUES) {
for (short y : VALUES) {
// Only compare the sign of the result of compareTo().
int expected = Short.valueOf(x).compareTo(y);
int actual = Shorts.compare(x, y);
if (expected == 0) {
assertEquals(x + ", " + y, expected, actual);
Reported by PMD.
Line: 276
// total overkill, but, it takes 0.1 sec so why not...
for (int i = 0; i < 10000; i++) {
short num = (short) r.nextInt();
assertEquals(num, Shorts.fromByteArray(Shorts.toByteArray(num)));
r.nextBytes(b);
assertTrue(Arrays.equals(b, Shorts.toByteArray(Shorts.fromByteArray(b))));
}
Reported by PMD.
Line: 345
testReverse(new short[] {-1, 1, -2, 2}, new short[] {2, -2, 1, -1});
}
private static void testReverse(short[] input, short[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
Shorts.reverse(input);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
Line: 352
}
private static void testReverse(
short[] input, int fromIndex, int toIndex, short[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
Shorts.reverse(input, fromIndex, toIndex);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
android/guava-tests/test/com/google/common/net/MediaTypeTest.java
296 issues
Line: 120
try {
return (MediaType) input.get(null);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
});
}
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.net;
import static com.google.common.base.Charsets.UTF_16;
import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.net.MediaType.ANY_APPLICATION_TYPE;
import static com.google.common.net.MediaType.ANY_AUDIO_TYPE;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.net;
import static com.google.common.base.Charsets.UTF_16;
import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.net.MediaType.ANY_APPLICATION_TYPE;
import static com.google.common.net.MediaType.ANY_AUDIO_TYPE;
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 60
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
}
Reported by PMD.
Line: 63
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
}
@GwtIncompatible // reflection
public void testCreate_useConstants() throws Exception {
Reported by PMD.
guava-tests/test/com/google/common/net/MediaTypeTest.java
296 issues
Line: 120
try {
return (MediaType) input.get(null);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
});
}
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.net;
import static com.google.common.base.Charsets.UTF_16;
import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.net.MediaType.ANY_APPLICATION_TYPE;
import static com.google.common.net.MediaType.ANY_AUDIO_TYPE;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.net;
import static com.google.common.base.Charsets.UTF_16;
import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.net.MediaType.ANY_APPLICATION_TYPE;
import static com.google.common.net.MediaType.ANY_AUDIO_TYPE;
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 59
* @author Gregory Kick
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
Reported by PMD.
Line: 60
*/
@GwtCompatible(emulated = true)
public class MediaTypeTest extends TestCase {
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
}
Reported by PMD.
Line: 63
@GwtIncompatible // reflection
public void testParse_useConstants() throws Exception {
for (MediaType constant : getConstants()) {
assertSame(constant, MediaType.parse(constant.toString()));
}
}
@GwtIncompatible // reflection
public void testCreate_useConstants() throws Exception {
Reported by PMD.
guava-tests/test/com/google/common/primitives/ShortsTest.java
296 issues
Line: 45
private static final short[] ARRAY1 = {(short) 1};
private static final short[] ARRAY234 = {(short) 2, (short) 3, (short) 4};
private static final short LEAST = Short.MIN_VALUE;
private static final short GREATEST = Short.MAX_VALUE;
private static final short[] VALUES = {LEAST, (short) -1, (short) 0, (short) 1, GREATEST};
public void testHashCode() {
Reported by PMD.
Line: 46
private static final short[] ARRAY234 = {(short) 2, (short) 3, (short) 4};
private static final short LEAST = Short.MIN_VALUE;
private static final short GREATEST = Short.MAX_VALUE;
private static final short[] VALUES = {LEAST, (short) -1, (short) 0, (short) 1, GREATEST};
public void testHashCode() {
for (short value : VALUES) {
Reported by PMD.
Line: 51
private static final short[] VALUES = {LEAST, (short) -1, (short) 0, (short) 1, GREATEST};
public void testHashCode() {
for (short value : VALUES) {
assertEquals(((Short) value).hashCode(), Shorts.hashCode(value));
}
}
public void testCheckedCast() {
Reported by PMD.
Line: 57
}
public void testCheckedCast() {
for (short value : VALUES) {
assertEquals(value, Shorts.checkedCast((long) value));
}
assertCastFails(GREATEST + 1L);
assertCastFails(LEAST - 1L);
assertCastFails(Long.MAX_VALUE);
Reported by PMD.
Line: 67
}
public void testSaturatedCast() {
for (short value : VALUES) {
assertEquals(value, Shorts.saturatedCast((long) value));
}
assertEquals(GREATEST, Shorts.saturatedCast(GREATEST + 1L));
assertEquals(LEAST, Shorts.saturatedCast(LEAST - 1L));
assertEquals(GREATEST, Shorts.saturatedCast(Long.MAX_VALUE));
Reported by PMD.
Line: 88
}
public void testCompare() {
for (short x : VALUES) {
for (short y : VALUES) {
// Only compare the sign of the result of compareTo().
int expected = Short.valueOf(x).compareTo(y);
int actual = Shorts.compare(x, y);
if (expected == 0) {
Reported by PMD.
Line: 89
public void testCompare() {
for (short x : VALUES) {
for (short y : VALUES) {
// Only compare the sign of the result of compareTo().
int expected = Short.valueOf(x).compareTo(y);
int actual = Shorts.compare(x, y);
if (expected == 0) {
assertEquals(x + ", " + y, expected, actual);
Reported by PMD.
Line: 276
// total overkill, but, it takes 0.1 sec so why not...
for (int i = 0; i < 10000; i++) {
short num = (short) r.nextInt();
assertEquals(num, Shorts.fromByteArray(Shorts.toByteArray(num)));
r.nextBytes(b);
assertTrue(Arrays.equals(b, Shorts.toByteArray(Shorts.fromByteArray(b))));
}
Reported by PMD.
Line: 345
testReverse(new short[] {-1, 1, -2, 2}, new short[] {2, -2, 1, -1});
}
private static void testReverse(short[] input, short[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
Shorts.reverse(input);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
Line: 352
}
private static void testReverse(
short[] input, int fromIndex, int toIndex, short[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
Shorts.reverse(input, fromIndex, toIndex);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
android/guava-tests/test/com/google/common/collect/LinkedListMultimapTest.java
292 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.Sets.newLinkedHashSet;
import static com.google.common.collect.testing.IteratorFeature.MODIFIABLE;
Reported by PMD.
Line: 58
* @author Mike Bostock
*/
@GwtCompatible(emulated = true)
public class LinkedListMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
Reported by PMD.
Line: 60
@GwtCompatible(emulated = true)
public class LinkedListMultimapTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
ListMultimapTestSuiteBuilder.using(
new TestStringListMultimapGenerator() {
Reported by PMD.
Line: 95
}
/** Confirm that get() returns a List that doesn't implement RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertFalse(multimap.get("foo") instanceof RandomAccess);
assertFalse(multimap.get("bar") instanceof RandomAccess);
Reported by PMD.
Line: 95
}
/** Confirm that get() returns a List that doesn't implement RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertFalse(multimap.get("foo") instanceof RandomAccess);
assertFalse(multimap.get("bar") instanceof RandomAccess);
Reported by PMD.
Line: 97
/** Confirm that get() returns a List that doesn't implement RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertFalse(multimap.get("foo") instanceof RandomAccess);
assertFalse(multimap.get("bar") instanceof RandomAccess);
}
Reported by PMD.
Line: 97
/** Confirm that get() returns a List that doesn't implement RandomAccess. */
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertFalse(multimap.get("foo") instanceof RandomAccess);
assertFalse(multimap.get("bar") instanceof RandomAccess);
}
Reported by PMD.
Line: 98
public void testGetRandomAccess() {
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertFalse(multimap.get("foo") instanceof RandomAccess);
assertFalse(multimap.get("bar") instanceof RandomAccess);
}
/**
Reported by PMD.
Line: 99
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertFalse(multimap.get("foo") instanceof RandomAccess);
assertFalse(multimap.get("bar") instanceof RandomAccess);
}
/**
* Confirm that removeAll() returns a List that implements RandomAccess, even though get()
Reported by PMD.
Line: 99
Multimap<String, Integer> multimap = create();
multimap.put("foo", 1);
multimap.put("foo", 3);
assertFalse(multimap.get("foo") instanceof RandomAccess);
assertFalse(multimap.get("bar") instanceof RandomAccess);
}
/**
* Confirm that removeAll() returns a List that implements RandomAccess, even though get()
Reported by PMD.
guava-tests/test/com/google/common/collect/TreeRangeMapTest.java
292 issues
Line: 15
* the License.
*/
package com.google.common.collect;
import static com.google.common.collect.BoundType.OPEN;
import static com.google.common.collect.testing.Helpers.mapEntry;
import com.google.common.annotations.GwtIncompatible;
Reported by PMD.
Line: 42
* @author Louis Wasserman
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
Reported by PMD.
Line: 42
* @author Louis Wasserman
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
Reported by PMD.
Line: 42
* @author Louis Wasserman
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
Reported by PMD.
Line: 42
* @author Louis Wasserman
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
Reported by PMD.
Line: 42
* @author Louis Wasserman
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
Reported by PMD.
Line: 43
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
new TestMapGenerator<Range<Integer>, String>() {
Reported by PMD.
Line: 43
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
new TestMapGenerator<Range<Integer>, String>() {
Reported by PMD.
Line: 43
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
new TestMapGenerator<Range<Integer>, String>() {
Reported by PMD.
Line: 43
*/
@GwtIncompatible // NavigableMap
public class TreeRangeMapTest extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(TreeRangeMapTest.class);
suite.addTest(
MapTestSuiteBuilder.using(
new TestMapGenerator<Range<Integer>, String>() {
Reported by PMD.
guava-tests/test/com/google/common/collect/ImmutableListTest.java
291 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.Iterables.unmodifiableIterable;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_QUERIES;
Reported by PMD.
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.Iterables.unmodifiableIterable;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_QUERIES;
Reported by PMD.
Line: 67
* @author Jared Levy
*/
@GwtCompatible(emulated = true)
public class ImmutableListTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
Reported by PMD.
Line: 69
@GwtCompatible(emulated = true)
public class ImmutableListTest extends TestCase {
@GwtIncompatible // suite
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(
ListTestSuiteBuilder.using(new ImmutableListOfGenerator())
.named("ImmutableList")
Reported by PMD.
Line: 116
return suite;
}
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
Reported by PMD.
Line: 116
return suite;
}
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
Reported by PMD.
Line: 117
}
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
public void testCreation_oneElement() {
Reported by PMD.
Line: 119
public static class CreationTests extends TestCase {
public void testCreation_noArgs() {
List<String> list = ImmutableList.of();
assertEquals(Collections.emptyList(), list);
}
public void testCreation_oneElement() {
List<String> list = ImmutableList.of("a");
assertEquals(Collections.singletonList("a"), list);
Reported by PMD.
Line: 122
assertEquals(Collections.emptyList(), list);
}
public void testCreation_oneElement() {
List<String> list = ImmutableList.of("a");
assertEquals(Collections.singletonList("a"), list);
}
public void testCreation_twoElements() {
Reported by PMD.
Line: 124
public void testCreation_oneElement() {
List<String> list = ImmutableList.of("a");
assertEquals(Collections.singletonList("a"), list);
}
public void testCreation_twoElements() {
List<String> list = ImmutableList.of("a", "b");
assertEquals(Lists.newArrayList("a", "b"), list);
Reported by PMD.