The following issues were found
android/guava-tests/test/com/google/common/reflect/TypesTest.java
144 issues
Line: 46
* @author Ben Yu
*/
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class TypesTest extends TestCase {
public void testNewParameterizedType_ownerTypeImplied() throws Exception {
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<Entry<String, Integer>>() {}.capture();
ParameterizedType ourType =
Types.newParameterizedType(Entry.class, String.class, Integer.class);
Reported by PMD.
Line: 47
*/
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class TypesTest extends TestCase {
public void testNewParameterizedType_ownerTypeImplied() throws Exception {
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<Entry<String, Integer>>() {}.capture();
ParameterizedType ourType =
Types.newParameterizedType(Entry.class, String.class, Integer.class);
assertEquals(jvmType, ourType);
Reported by PMD.
Line: 47
*/
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class TypesTest extends TestCase {
public void testNewParameterizedType_ownerTypeImplied() throws Exception {
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<Entry<String, Integer>>() {}.capture();
ParameterizedType ourType =
Types.newParameterizedType(Entry.class, String.class, Integer.class);
assertEquals(jvmType, ourType);
Reported by PMD.
Line: 52
(ParameterizedType) new TypeCapture<Entry<String, Integer>>() {}.capture();
ParameterizedType ourType =
Types.newParameterizedType(Entry.class, String.class, Integer.class);
assertEquals(jvmType, ourType);
assertEquals(Map.class, ourType.getOwnerType());
}
public void testNewParameterizedType() {
ParameterizedType jvmType =
Reported by PMD.
Line: 53
ParameterizedType ourType =
Types.newParameterizedType(Entry.class, String.class, Integer.class);
assertEquals(jvmType, ourType);
assertEquals(Map.class, ourType.getOwnerType());
}
public void testNewParameterizedType() {
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<HashMap<String, int[][]>>() {}.capture();
Reported by PMD.
Line: 53
ParameterizedType ourType =
Types.newParameterizedType(Entry.class, String.class, Integer.class);
assertEquals(jvmType, ourType);
assertEquals(Map.class, ourType.getOwnerType());
}
public void testNewParameterizedType() {
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<HashMap<String, int[][]>>() {}.capture();
Reported by PMD.
Line: 56
assertEquals(Map.class, ourType.getOwnerType());
}
public void testNewParameterizedType() {
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<HashMap<String, int[][]>>() {}.capture();
ParameterizedType ourType =
Types.newParameterizedType(HashMap.class, String.class, int[][].class);
Reported by PMD.
Line: 56
assertEquals(Map.class, ourType.getOwnerType());
}
public void testNewParameterizedType() {
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<HashMap<String, int[][]>>() {}.capture();
ParameterizedType ourType =
Types.newParameterizedType(HashMap.class, String.class, int[][].class);
Reported by PMD.
Line: 60
ParameterizedType jvmType =
(ParameterizedType) new TypeCapture<HashMap<String, int[][]>>() {}.capture();
ParameterizedType ourType =
Types.newParameterizedType(HashMap.class, String.class, int[][].class);
new EqualsTester().addEqualityGroup(jvmType, ourType).testEquals();
assertEquals(jvmType.toString(), ourType.toString());
assertEquals(jvmType.hashCode(), ourType.hashCode());
assertEquals(HashMap.class, ourType.getRawType());
Reported by PMD.
Line: 63
Types.newParameterizedType(HashMap.class, String.class, int[][].class);
new EqualsTester().addEqualityGroup(jvmType, ourType).testEquals();
assertEquals(jvmType.toString(), ourType.toString());
assertEquals(jvmType.hashCode(), ourType.hashCode());
assertEquals(HashMap.class, ourType.getRawType());
assertThat(ourType.getActualTypeArguments())
.asList()
.containsExactlyElementsIn(asList(jvmType.getActualTypeArguments()))
Reported by PMD.
android/guava-tests/test/com/google/common/base/ToStringHelperTest.java
143 issues
Line: 159
@GwtIncompatible // Class names are obfuscated in GWT
public void testToString_oneIntegerField() {
String toTest =
MoreObjects.toStringHelper(new TestClass()).add("field1", new Integer(42)).toString();
assertEquals("TestClass{field1=42}", toTest);
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testToString_nullInteger() {
Reported by PMD.
Line: 177
public void testToStringLenient_oneIntegerField() {
String toTest =
MoreObjects.toStringHelper(new TestClass()).add("field1", new Integer(42)).toString();
assertTrue(toTest, toTest.matches(".*\\{field1\\=42\\}"));
}
public void testToStringLenient_nullInteger() {
String toTest =
Reported by PMD.
Line: 32
* @author Jason Lee
*/
@GwtCompatible
public class ToStringHelperTest extends TestCase {
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
Reported by PMD.
Line: 34
@GwtCompatible
public class ToStringHelperTest extends TestCase {
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
}
Reported by PMD.
Line: 36
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
Reported by PMD.
Line: 37
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
Reported by PMD.
Line: 40
assertEquals("ToStringHelperTest{}", toTest);
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
Reported by PMD.
Line: 41
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_innerClass() {
Reported by PMD.
Line: 42
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_innerClass() {
String toTest = MoreObjects.toStringHelper(new TestClass()).toString();
Reported by PMD.
Line: 42
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_innerClass() {
String toTest = MoreObjects.toStringHelper(new TestClass()).toString();
Reported by PMD.
guava-tests/test/com/google/common/base/ToStringHelperTest.java
143 issues
Line: 159
@GwtIncompatible // Class names are obfuscated in GWT
public void testToString_oneIntegerField() {
String toTest =
MoreObjects.toStringHelper(new TestClass()).add("field1", new Integer(42)).toString();
assertEquals("TestClass{field1=42}", toTest);
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testToString_nullInteger() {
Reported by PMD.
Line: 177
public void testToStringLenient_oneIntegerField() {
String toTest =
MoreObjects.toStringHelper(new TestClass()).add("field1", new Integer(42)).toString();
assertTrue(toTest, toTest.matches(".*\\{field1\\=42\\}"));
}
public void testToStringLenient_nullInteger() {
String toTest =
Reported by PMD.
Line: 32
* @author Jason Lee
*/
@GwtCompatible
public class ToStringHelperTest extends TestCase {
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
Reported by PMD.
Line: 34
@GwtCompatible
public class ToStringHelperTest extends TestCase {
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
}
Reported by PMD.
Line: 36
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
Reported by PMD.
Line: 37
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertEquals("ToStringHelperTest{}", toTest);
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
Reported by PMD.
Line: 40
assertEquals("ToStringHelperTest{}", toTest);
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
Reported by PMD.
Line: 41
}
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_innerClass() {
Reported by PMD.
Line: 42
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_innerClass() {
String toTest = MoreObjects.toStringHelper(new TestClass()).toString();
Reported by PMD.
Line: 42
public void testConstructorLenient_instance() {
String toTest = MoreObjects.toStringHelper(this).toString();
assertTrue(toTest, toTest.matches(".*\\{\\}"));
}
@GwtIncompatible // Class names are obfuscated in GWT
public void testConstructor_innerClass() {
String toTest = MoreObjects.toStringHelper(new TestClass()).toString();
Reported by PMD.
guava/src/com/google/common/collect/TreeRangeMap.java
143 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Predicates.compose;
import static com.google.common.base.Predicates.in;
Reported by PMD.
Line: 57
@Beta
@GwtIncompatible // NavigableMap
@ElementTypesAreNonnullByDefault
public final class TreeRangeMap<K extends Comparable, V> implements RangeMap<K, V> {
private final NavigableMap<Cut<K>, RangeMapEntry<K, V>> entriesByLowerBound;
public static <K extends Comparable, V> TreeRangeMap<K, V> create() {
return new TreeRangeMap<>();
Reported by PMD.
Line: 57
@Beta
@GwtIncompatible // NavigableMap
@ElementTypesAreNonnullByDefault
public final class TreeRangeMap<K extends Comparable, V> implements RangeMap<K, V> {
private final NavigableMap<Cut<K>, RangeMapEntry<K, V>> entriesByLowerBound;
public static <K extends Comparable, V> TreeRangeMap<K, V> create() {
return new TreeRangeMap<>();
Reported by PMD.
Line: 59
@ElementTypesAreNonnullByDefault
public final class TreeRangeMap<K extends Comparable, V> implements RangeMap<K, V> {
private final NavigableMap<Cut<K>, RangeMapEntry<K, V>> entriesByLowerBound;
public static <K extends Comparable, V> TreeRangeMap<K, V> create() {
return new TreeRangeMap<>();
}
Reported by PMD.
Line: 71
private static final class RangeMapEntry<K extends Comparable, V>
extends AbstractMapEntry<Range<K>, V> {
private final Range<K> range;
private final V value;
RangeMapEntry(Cut<K> lowerBound, Cut<K> upperBound, V value) {
this(Range.create(lowerBound, upperBound), value);
}
Reported by PMD.
Line: 110
@CheckForNull
public V get(K key) {
Entry<Range<K>, V> entry = getEntry(key);
return (entry == null) ? null : entry.getValue();
}
@Override
@CheckForNull
public Entry<Range<K>, V> getEntry(K key) {
Reported by PMD.
Line: 118
public Entry<Range<K>, V> getEntry(K key) {
Entry<Cut<K>, RangeMapEntry<K, V>> mapEntry =
entriesByLowerBound.floorEntry(Cut.belowValue(key));
if (mapEntry != null && mapEntry.getValue().contains(key)) {
return mapEntry.getValue();
} else {
return null;
}
}
Reported by PMD.
Line: 118
public Entry<Range<K>, V> getEntry(K key) {
Entry<Cut<K>, RangeMapEntry<K, V>> mapEntry =
entriesByLowerBound.floorEntry(Cut.belowValue(key));
if (mapEntry != null && mapEntry.getValue().contains(key)) {
return mapEntry.getValue();
} else {
return null;
}
}
Reported by PMD.
Line: 164
private static <K extends Comparable, V> Range<K> coalesce(
Range<K> range, V value, @CheckForNull Entry<Cut<K>, RangeMapEntry<K, V>> entry) {
if (entry != null
&& entry.getValue().getKey().isConnected(range)
&& entry.getValue().getValue().equals(value)) {
return range.span(entry.getValue().getKey());
}
return range;
}
Reported by PMD.
Line: 164
private static <K extends Comparable, V> Range<K> coalesce(
Range<K> range, V value, @CheckForNull Entry<Cut<K>, RangeMapEntry<K, V>> entry) {
if (entry != null
&& entry.getValue().getKey().isConnected(range)
&& entry.getValue().getValue().equals(value)) {
return range.span(entry.getValue().getKey());
}
return range;
}
Reported by PMD.
android/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java
142 issues
Line: 120
testSort(new long[] {2, GREATEST, 1, LEAST}, new long[] {LEAST, 1, 2, GREATEST});
}
static void testSort(long[] input, long[] expected) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sort(input);
assertTrue(Arrays.equals(expected, input));
}
Reported by PMD.
Line: 126
assertTrue(Arrays.equals(expected, input));
}
static void testSort(long[] input, int from, int to, long[] expected) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sort(input, from, to);
assertTrue(Arrays.equals(expected, input));
}
Reported by PMD.
Line: 149
new long[] {GREATEST - 1, GREATEST - 2, 2, 1});
}
private static void testSortDescending(long[] input, long[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sortDescending(input);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
Line: 156
}
private static void testSortDescending(
long[] input, int fromIndex, int toIndex, long[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sortDescending(input, fromIndex, toIndex);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
Line: 37
* @author Louis Wasserman
*/
@GwtCompatible(emulated = true)
public class UnsignedLongsTest extends TestCase {
private static final long LEAST = 0L;
private static final long GREATEST = 0xffffffffffffffffL;
public void testCompare() {
// max value
Reported by PMD.
Line: 41
private static final long LEAST = 0L;
private static final long GREATEST = 0xffffffffffffffffL;
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
Reported by PMD.
Line: 41
private static final long LEAST = 0L;
private static final long GREATEST = 0xffffffffffffffffL;
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
Reported by PMD.
Line: 43
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0xff1a618b7f65ea12L) > 0);
Reported by PMD.
Line: 44
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0xff1a618b7f65ea12L) > 0);
Reported by PMD.
Line: 47
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0xff1a618b7f65ea12L) > 0);
// one with high bit set
assertTrue(UnsignedLongs.compare(0x5a4316b8c153ac4dL, 0xff1a618b7f65ea12L) < 0);
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0x5a4316b8c153ac4dL) > 0);
Reported by PMD.
guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java
142 issues
Line: 120
testSort(new long[] {2, GREATEST, 1, LEAST}, new long[] {LEAST, 1, 2, GREATEST});
}
static void testSort(long[] input, long[] expected) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sort(input);
assertTrue(Arrays.equals(expected, input));
}
Reported by PMD.
Line: 126
assertTrue(Arrays.equals(expected, input));
}
static void testSort(long[] input, int from, int to, long[] expected) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sort(input, from, to);
assertTrue(Arrays.equals(expected, input));
}
Reported by PMD.
Line: 149
new long[] {GREATEST - 1, GREATEST - 2, 2, 1});
}
private static void testSortDescending(long[] input, long[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sortDescending(input);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
Line: 156
}
private static void testSortDescending(
long[] input, int fromIndex, int toIndex, long[] expectedOutput) {
input = Arrays.copyOf(input, input.length);
UnsignedLongs.sortDescending(input, fromIndex, toIndex);
assertTrue(Arrays.equals(expectedOutput, input));
}
Reported by PMD.
Line: 37
* @author Louis Wasserman
*/
@GwtCompatible(emulated = true)
public class UnsignedLongsTest extends TestCase {
private static final long LEAST = 0L;
private static final long GREATEST = 0xffffffffffffffffL;
public void testCompare() {
// max value
Reported by PMD.
Line: 41
private static final long LEAST = 0L;
private static final long GREATEST = 0xffffffffffffffffL;
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
Reported by PMD.
Line: 41
private static final long LEAST = 0L;
private static final long GREATEST = 0xffffffffffffffffL;
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
Reported by PMD.
Line: 43
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0xff1a618b7f65ea12L) > 0);
Reported by PMD.
Line: 44
public void testCompare() {
// max value
assertTrue(UnsignedLongs.compare(0, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0xff1a618b7f65ea12L) > 0);
Reported by PMD.
Line: 47
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0) > 0);
// both with high bit set
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0xffffffffffffffffL) < 0);
assertTrue(UnsignedLongs.compare(0xffffffffffffffffL, 0xff1a618b7f65ea12L) > 0);
// one with high bit set
assertTrue(UnsignedLongs.compare(0x5a4316b8c153ac4dL, 0xff1a618b7f65ea12L) < 0);
assertTrue(UnsignedLongs.compare(0xff1a618b7f65ea12L, 0x5a4316b8c153ac4dL) > 0);
Reported by PMD.
guava/src/com/google/common/collect/Streams.java
141 issues
Line: 17
* permissions and limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT;
import static java.util.Objects.requireNonNull;
Reported by PMD.
Line: 60
*/
@GwtCompatible
@ElementTypesAreNonnullByDefault
public final class Streams {
/**
* Returns a sequential {@link Stream} of the contents of {@code iterable}, delegating to {@link
* Collection#stream} if possible.
*/
public static <T extends @Nullable Object> Stream<T> stream(Iterable<T> iterable) {
Reported by PMD.
Line: 60
*/
@GwtCompatible
@ElementTypesAreNonnullByDefault
public final class Streams {
/**
* Returns a sequential {@link Stream} of the contents of {@code iterable}, delegating to {@link
* Collection#stream} if possible.
*/
public static <T extends @Nullable Object> Stream<T> stream(Iterable<T> iterable) {
Reported by PMD.
Line: 146
}
private static void closeAll(BaseStream<?, ?>[] toClose) {
for (BaseStream<?, ?> stream : toClose) {
// TODO(b/80534298): Catch exceptions, rethrowing later with extras as suppressed exceptions.
stream.close();
}
}
Reported by PMD.
Line: 173
isParallel |= stream.isParallel();
Spliterator<? extends T> splitr = stream.spliterator();
splitrsBuilder.add(splitr);
characteristics &= splitr.characteristics();
estimatedSize = LongMath.saturatedAdd(estimatedSize, splitr.estimateSize());
}
return StreamSupport.stream(
CollectSpliterators.flatMap(
splitrsBuilder.build().spliterator(),
Reported by PMD.
Line: 174
Spliterator<? extends T> splitr = stream.spliterator();
splitrsBuilder.add(splitr);
characteristics &= splitr.characteristics();
estimatedSize = LongMath.saturatedAdd(estimatedSize, splitr.estimateSize());
}
return StreamSupport.stream(
CollectSpliterators.flatMap(
splitrsBuilder.build().spliterator(),
splitr -> (Spliterator<T>) splitr,
Reported by PMD.
Line: 176
characteristics &= splitr.characteristics();
estimatedSize = LongMath.saturatedAdd(estimatedSize, splitr.estimateSize());
}
return StreamSupport.stream(
CollectSpliterators.flatMap(
splitrsBuilder.build().spliterator(),
splitr -> (Spliterator<T>) splitr,
characteristics,
estimatedSize),
Reported by PMD.
Line: 178
}
return StreamSupport.stream(
CollectSpliterators.flatMap(
splitrsBuilder.build().spliterator(),
splitr -> (Spliterator<T>) splitr,
characteristics,
estimatedSize),
isParallel)
.onClose(() -> closeAll(streams));
Reported by PMD.
Line: 205
isParallel |= stream.isParallel();
Spliterator.OfInt splitr = stream.spliterator();
splitrsBuilder.add(splitr);
characteristics &= splitr.characteristics();
estimatedSize = LongMath.saturatedAdd(estimatedSize, splitr.estimateSize());
}
return StreamSupport.intStream(
CollectSpliterators.flatMapToInt(
splitrsBuilder.build().spliterator(),
Reported by PMD.
Line: 206
Spliterator.OfInt splitr = stream.spliterator();
splitrsBuilder.add(splitr);
characteristics &= splitr.characteristics();
estimatedSize = LongMath.saturatedAdd(estimatedSize, splitr.estimateSize());
}
return StreamSupport.intStream(
CollectSpliterators.flatMapToInt(
splitrsBuilder.build().spliterator(),
splitr -> splitr,
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java
140 issues
Line: 43
* different "source Future" for {@link AbstractFuture#setFuture} calls.
*/
@GwtCompatible(emulated = true)
abstract class AbstractAbstractFutureTest extends TestCase {
private TestedFuture<Integer> future;
private AbstractFuture<Integer> delegate;
abstract AbstractFuture<Integer> newDelegate();
Reported by PMD.
Line: 44
*/
@GwtCompatible(emulated = true)
abstract class AbstractAbstractFutureTest extends TestCase {
private TestedFuture<Integer> future;
private AbstractFuture<Integer> delegate;
abstract AbstractFuture<Integer> newDelegate();
@Override
Reported by PMD.
Line: 45
@GwtCompatible(emulated = true)
abstract class AbstractAbstractFutureTest extends TestCase {
private TestedFuture<Integer> future;
private AbstractFuture<Integer> delegate;
abstract AbstractFuture<Integer> newDelegate();
@Override
protected void setUp() {
Reported by PMD.
Line: 49
abstract AbstractFuture<Integer> newDelegate();
@Override
protected void setUp() {
future = TestedFuture.create();
delegate = newDelegate();
}
Reported by PMD.
Line: 55
delegate = newDelegate();
}
public void testPending() {
assertPending(future);
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
Reported by PMD.
Line: 59
assertPending(future);
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Reported by PMD.
Line: 59
assertPending(future);
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Reported by PMD.
Line: 60
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Exception cause = new Exception();
Reported by PMD.
Line: 64
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Exception cause = new Exception();
assertThat(future.setException(cause)).isTrue();
assertFailed(future, cause);
}
Reported by PMD.
Line: 64
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Exception cause = new Exception();
assertThat(future.setException(cause)).isTrue();
assertFailed(future, cause);
}
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java
140 issues
Line: 43
* different "source Future" for {@link AbstractFuture#setFuture} calls.
*/
@GwtCompatible(emulated = true)
abstract class AbstractAbstractFutureTest extends TestCase {
private TestedFuture<Integer> future;
private AbstractFuture<Integer> delegate;
abstract AbstractFuture<Integer> newDelegate();
Reported by PMD.
Line: 44
*/
@GwtCompatible(emulated = true)
abstract class AbstractAbstractFutureTest extends TestCase {
private TestedFuture<Integer> future;
private AbstractFuture<Integer> delegate;
abstract AbstractFuture<Integer> newDelegate();
@Override
Reported by PMD.
Line: 45
@GwtCompatible(emulated = true)
abstract class AbstractAbstractFutureTest extends TestCase {
private TestedFuture<Integer> future;
private AbstractFuture<Integer> delegate;
abstract AbstractFuture<Integer> newDelegate();
@Override
protected void setUp() {
Reported by PMD.
Line: 49
abstract AbstractFuture<Integer> newDelegate();
@Override
protected void setUp() {
future = TestedFuture.create();
delegate = newDelegate();
}
Reported by PMD.
Line: 55
delegate = newDelegate();
}
public void testPending() {
assertPending(future);
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
Reported by PMD.
Line: 59
assertPending(future);
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Reported by PMD.
Line: 59
assertPending(future);
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Reported by PMD.
Line: 60
}
public void testSuccessful() throws Exception {
assertThat(future.set(1)).isTrue();
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Exception cause = new Exception();
Reported by PMD.
Line: 64
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Exception cause = new Exception();
assertThat(future.setException(cause)).isTrue();
assertFailed(future, cause);
}
Reported by PMD.
Line: 64
assertSuccessful(future, 1);
}
public void testFailed() throws Exception {
Exception cause = new Exception();
assertThat(future.setException(cause)).isTrue();
assertFailed(future, cause);
}
Reported by PMD.
android/guava-tests/test/com/google/common/graph/EndpointPairTest.java
140 issues
Line: 33
/** Tests for {@link EndpointPair} and {@link Graph#edges()}. */
@RunWith(JUnit4.class)
public final class EndpointPairTest {
private static final Integer N0 = 0;
private static final Integer N1 = 1;
private static final Integer N2 = 2;
private static final Integer N3 = 3;
private static final Integer N4 = 4;
Reported by PMD.
Line: 48
// Test for EndpointPair class
@Test
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
Reported by PMD.
Line: 49
@Test
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
Reported by PMD.
Line: 49
@Test
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
Reported by PMD.
Line: 50
@Test
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
assertThat(ordered.nodeV()).isEqualTo("target");
Reported by PMD.
Line: 50
@Test
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
assertThat(ordered.nodeV()).isEqualTo("target");
Reported by PMD.
Line: 51
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
assertThat(ordered.nodeV()).isEqualTo("target");
assertThat(ordered.adjacentNode("source")).isEqualTo("target");
Reported by PMD.
Line: 51
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
assertThat(ordered.nodeV()).isEqualTo("target");
assertThat(ordered.adjacentNode("source")).isEqualTo("target");
Reported by PMD.
Line: 51
public void testOrderedEndpointPair() {
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
assertThat(ordered.nodeV()).isEqualTo("target");
assertThat(ordered.adjacentNode("source")).isEqualTo("target");
Reported by PMD.
Line: 52
EndpointPair<String> ordered = EndpointPair.ordered("source", "target");
assertThat(ordered.isOrdered()).isTrue();
assertThat(ordered).containsExactly("source", "target").inOrder();
assertThat(ordered.source()).isEqualTo("source");
assertThat(ordered.target()).isEqualTo("target");
assertThat(ordered.nodeU()).isEqualTo("source");
assertThat(ordered.nodeV()).isEqualTo("target");
assertThat(ordered.adjacentNode("source")).isEqualTo("target");
assertThat(ordered.adjacentNode("target")).isEqualTo("source");
Reported by PMD.