The following issues were found
guava/src/com/google/common/cache/LocalCache.java
541 issues
Line: 264
? LocalCache.<RemovalNotification<K, V>>discardingQueue()
: new ConcurrentLinkedQueue<RemovalNotification<K, V>>();
ticker = builder.getTicker(recordsTime());
entryFactory = EntryFactory.getFactory(keyStrength, usesAccessEntries(), usesWriteEntries());
globalStatsCounter = builder.getStatsCounterSupplier().get();
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
Reported by PMD.
Line: 265
: new ConcurrentLinkedQueue<RemovalNotification<K, V>>();
ticker = builder.getTicker(recordsTime());
entryFactory = EntryFactory.getFactory(keyStrength, usesAccessEntries(), usesWriteEntries());
globalStatsCounter = builder.getStatsCounterSupplier().get();
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
Reported by PMD.
Line: 265
: new ConcurrentLinkedQueue<RemovalNotification<K, V>>();
ticker = builder.getTicker(recordsTime());
entryFactory = EntryFactory.getFactory(keyStrength, usesAccessEntries(), usesWriteEntries());
globalStatsCounter = builder.getStatsCounterSupplier().get();
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
Reported by PMD.
Line: 270
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
initialCapacity = (int) Math.min(initialCapacity, maxWeight);
}
// Find the lowest power-of-two segmentCount that exceeds concurrencyLevel, unless
// maximumSize/Weight is specified in which case ensure that each segment gets at least 10
Reported by PMD.
Line: 270
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
initialCapacity = (int) Math.min(initialCapacity, maxWeight);
}
// Find the lowest power-of-two segmentCount that exceeds concurrencyLevel, unless
// maximumSize/Weight is specified in which case ensure that each segment gets at least 10
Reported by PMD.
Line: 281
// will result in random eviction behavior.
int segmentShift = 0;
int segmentCount = 1;
while (segmentCount < concurrencyLevel && (!evictsBySize() || segmentCount * 20 <= maxWeight)) {
++segmentShift;
segmentCount <<= 1;
}
this.segmentShift = 32 - segmentShift;
segmentMask = segmentCount - 1;
Reported by PMD.
Line: 300
segmentSize <<= 1;
}
if (evictsBySize()) {
// Ensure sum of segment max weights = overall max weights
long maxSegmentWeight = maxWeight / segmentCount + 1;
long remainder = maxWeight % segmentCount;
for (int i = 0; i < this.segments.length; ++i) {
if (i == remainder) {
Reported by PMD.
Line: 1947
this.map = map;
this.maxSegmentWeight = maxSegmentWeight;
this.statsCounter = checkNotNull(statsCounter);
initTable(newEntryArray(initialCapacity));
keyReferenceQueue = map.usesKeyReferences() ? new ReferenceQueue<K>() : null;
valueReferenceQueue = map.usesValueReferences() ? new ReferenceQueue<V>() : null;
Reported by PMD.
Line: 4339
HashIterator() {
nextSegmentIndex = segments.length - 1;
nextTableIndex = -1;
advance();
}
@Override
public abstract T next();
Reported by PMD.
Line: 1653
*
* @param h hash code
*/
static int rehash(int h) {
// Spread bits to regularize both segment and index locations,
// using variant of single-word Wang/Jenkins hash.
// TODO(kevinb): use Hashing/move this to Hashing?
h += (h << 15) ^ 0xffffcd7d;
h ^= (h >>> 10);
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java
528 issues
Line: 36
* @author mike nonemacher
*/
@GwtCompatible(emulated = true)
public class AtomicLongMapTest extends TestCase {
private static final int ITERATIONS = 100;
private static final int MAX_ADDEND = 100;
private final Random random = new Random(301);
Reported by PMD.
Line: 36
* @author mike nonemacher
*/
@GwtCompatible(emulated = true)
public class AtomicLongMapTest extends TestCase {
private static final int ITERATIONS = 100;
private static final int MAX_ADDEND = 100;
private final Random random = new Random(301);
Reported by PMD.
Line: 40
private static final int ITERATIONS = 100;
private static final int MAX_ADDEND = 100;
private final Random random = new Random(301);
@GwtIncompatible // NullPointerTester
public void testNulls() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(AtomicLongMap.class);
Reported by PMD.
Line: 42
private final Random random = new Random(301);
@GwtIncompatible // NullPointerTester
public void testNulls() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(AtomicLongMap.class);
tester.testAllPublicStaticMethods(AtomicLongMap.class);
AtomicLongMap<Object> map = AtomicLongMap.create();
Reported by PMD.
Line: 43
private final Random random = new Random(301);
@GwtIncompatible // NullPointerTester
public void testNulls() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(AtomicLongMap.class);
tester.testAllPublicStaticMethods(AtomicLongMap.class);
AtomicLongMap<Object> map = AtomicLongMap.create();
tester.testAllPublicInstanceMethods(map);
Reported by PMD.
Line: 51
tester.testAllPublicInstanceMethods(map);
}
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
Reported by PMD.
Line: 51
tester.testAllPublicInstanceMethods(map);
}
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
Reported by PMD.
Line: 54
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
assertTrue(map.containsKey("2"));
assertTrue(map.containsKey("3"));
assertEquals(1L, map.get("1"));
Reported by PMD.
Line: 54
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
assertTrue(map.containsKey("2"));
assertTrue(map.containsKey("3"));
assertEquals(1L, map.get("1"));
Reported by PMD.
Line: 55
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
assertTrue(map.containsKey("2"));
assertTrue(map.containsKey("3"));
assertEquals(1L, map.get("1"));
assertEquals(2L, map.get("2"));
Reported by PMD.
android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java
528 issues
Line: 36
* @author mike nonemacher
*/
@GwtCompatible(emulated = true)
public class AtomicLongMapTest extends TestCase {
private static final int ITERATIONS = 100;
private static final int MAX_ADDEND = 100;
private final Random random = new Random(301);
Reported by PMD.
Line: 36
* @author mike nonemacher
*/
@GwtCompatible(emulated = true)
public class AtomicLongMapTest extends TestCase {
private static final int ITERATIONS = 100;
private static final int MAX_ADDEND = 100;
private final Random random = new Random(301);
Reported by PMD.
Line: 40
private static final int ITERATIONS = 100;
private static final int MAX_ADDEND = 100;
private final Random random = new Random(301);
@GwtIncompatible // NullPointerTester
public void testNulls() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(AtomicLongMap.class);
Reported by PMD.
Line: 42
private final Random random = new Random(301);
@GwtIncompatible // NullPointerTester
public void testNulls() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(AtomicLongMap.class);
tester.testAllPublicStaticMethods(AtomicLongMap.class);
AtomicLongMap<Object> map = AtomicLongMap.create();
Reported by PMD.
Line: 43
private final Random random = new Random(301);
@GwtIncompatible // NullPointerTester
public void testNulls() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(AtomicLongMap.class);
tester.testAllPublicStaticMethods(AtomicLongMap.class);
AtomicLongMap<Object> map = AtomicLongMap.create();
tester.testAllPublicInstanceMethods(map);
Reported by PMD.
Line: 51
tester.testAllPublicInstanceMethods(map);
}
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
Reported by PMD.
Line: 51
tester.testAllPublicInstanceMethods(map);
}
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
Reported by PMD.
Line: 54
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
assertTrue(map.containsKey("2"));
assertTrue(map.containsKey("3"));
assertEquals(1L, map.get("1"));
Reported by PMD.
Line: 54
public void testCreate_map() {
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
assertTrue(map.containsKey("2"));
assertTrue(map.containsKey("3"));
assertEquals(1L, map.get("1"));
Reported by PMD.
Line: 55
Map<String, Long> in = ImmutableMap.of("1", 1L, "2", 2L, "3", 3L);
AtomicLongMap<String> map = AtomicLongMap.create(in);
assertFalse(map.isEmpty());
assertSame(3, map.size());
assertTrue(map.containsKey("1"));
assertTrue(map.containsKey("2"));
assertTrue(map.containsKey("3"));
assertEquals(1L, map.get("1"));
assertEquals(2L, map.get("2"));
Reported by PMD.
guava-tests/test/com/google/common/collect/FluentIterableTest.java
523 issues
Line: 17
* limitations under the License.
*/
package com.google.common.collect;
import static com.google.common.collect.FluentIterableTest.Help.assertThat;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;
Reported by PMD.
Line: 55
* @author Marcin Mikosik
*/
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
Reported by PMD.
Line: 55
* @author Marcin Mikosik
*/
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
Reported by PMD.
Line: 55
* @author Marcin Mikosik
*/
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
Reported by PMD.
Line: 57
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
}
Reported by PMD.
Line: 58
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
}
public void testFromArrayAndAppend() {
Reported by PMD.
Line: 63
tester.testAllPublicStaticMethods(FluentIterable.class);
}
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
Reported by PMD.
Line: 63
tester.testAllPublicStaticMethods(FluentIterable.class);
}
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
Reported by PMD.
Line: 64
}
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
FluentIterable<TimeUnit> units = FluentIterable.from(TimeUnit.values());
Reported by PMD.
Line: 65
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
FluentIterable<TimeUnit> units = FluentIterable.from(TimeUnit.values());
try {
Reported by PMD.
android/guava/src/com/google/common/cache/LocalCache.java
513 issues
Line: 260
? LocalCache.<RemovalNotification<K, V>>discardingQueue()
: new ConcurrentLinkedQueue<RemovalNotification<K, V>>();
ticker = builder.getTicker(recordsTime());
entryFactory = EntryFactory.getFactory(keyStrength, usesAccessEntries(), usesWriteEntries());
globalStatsCounter = builder.getStatsCounterSupplier().get();
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
Reported by PMD.
Line: 261
: new ConcurrentLinkedQueue<RemovalNotification<K, V>>();
ticker = builder.getTicker(recordsTime());
entryFactory = EntryFactory.getFactory(keyStrength, usesAccessEntries(), usesWriteEntries());
globalStatsCounter = builder.getStatsCounterSupplier().get();
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
Reported by PMD.
Line: 261
: new ConcurrentLinkedQueue<RemovalNotification<K, V>>();
ticker = builder.getTicker(recordsTime());
entryFactory = EntryFactory.getFactory(keyStrength, usesAccessEntries(), usesWriteEntries());
globalStatsCounter = builder.getStatsCounterSupplier().get();
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
Reported by PMD.
Line: 266
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
initialCapacity = (int) Math.min(initialCapacity, maxWeight);
}
// Find the lowest power-of-two segmentCount that exceeds concurrencyLevel, unless
// maximumSize/Weight is specified in which case ensure that each segment gets at least 10
Reported by PMD.
Line: 266
defaultLoader = loader;
int initialCapacity = Math.min(builder.getInitialCapacity(), MAXIMUM_CAPACITY);
if (evictsBySize() && !customWeigher()) {
initialCapacity = (int) Math.min(initialCapacity, maxWeight);
}
// Find the lowest power-of-two segmentCount that exceeds concurrencyLevel, unless
// maximumSize/Weight is specified in which case ensure that each segment gets at least 10
Reported by PMD.
Line: 277
// will result in random eviction behavior.
int segmentShift = 0;
int segmentCount = 1;
while (segmentCount < concurrencyLevel && (!evictsBySize() || segmentCount * 20 <= maxWeight)) {
++segmentShift;
segmentCount <<= 1;
}
this.segmentShift = 32 - segmentShift;
segmentMask = segmentCount - 1;
Reported by PMD.
Line: 296
segmentSize <<= 1;
}
if (evictsBySize()) {
// Ensure sum of segment max weights = overall max weights
long maxSegmentWeight = maxWeight / segmentCount + 1;
long remainder = maxWeight % segmentCount;
for (int i = 0; i < this.segments.length; ++i) {
if (i == remainder) {
Reported by PMD.
Line: 1945
this.map = map;
this.maxSegmentWeight = maxSegmentWeight;
this.statsCounter = checkNotNull(statsCounter);
initTable(newEntryArray(initialCapacity));
keyReferenceQueue = map.usesKeyReferences() ? new ReferenceQueue<K>() : null;
valueReferenceQueue = map.usesValueReferences() ? new ReferenceQueue<V>() : null;
Reported by PMD.
Line: 4195
HashIterator() {
nextSegmentIndex = segments.length - 1;
nextTableIndex = -1;
advance();
}
@Override
public abstract T next();
Reported by PMD.
Line: 1651
*
* @param h hash code
*/
static int rehash(int h) {
// Spread bits to regularize both segment and index locations,
// using variant of single-word Wang/Jenkins hash.
// TODO(kevinb): use Hashing/move this to Hashing?
h += (h << 15) ^ 0xffffcd7d;
h ^= (h >>> 10);
Reported by PMD.
android/guava-tests/test/com/google/common/collect/FluentIterableTest.java
511 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.truth.Truth.assertThat;
import static java.util.Arrays.asList;
Reported by PMD.
Line: 51
* @author Marcin Mikosik
*/
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
Reported by PMD.
Line: 51
* @author Marcin Mikosik
*/
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
Reported by PMD.
Line: 51
* @author Marcin Mikosik
*/
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
Reported by PMD.
Line: 53
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
}
Reported by PMD.
Line: 54
public class FluentIterableTest extends TestCase {
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(FluentIterable.class);
}
public void testFromArrayAndAppend() {
Reported by PMD.
Line: 59
tester.testAllPublicStaticMethods(FluentIterable.class);
}
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
Reported by PMD.
Line: 59
tester.testAllPublicStaticMethods(FluentIterable.class);
}
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
Reported by PMD.
Line: 60
}
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
FluentIterable<TimeUnit> units = FluentIterable.from(TimeUnit.values());
Reported by PMD.
Line: 61
public void testFromArrayAndAppend() {
FluentIterable<TimeUnit> units =
FluentIterable.from(TimeUnit.values()).append(TimeUnit.SECONDS);
}
public void testFromArrayAndIteratorRemove() {
FluentIterable<TimeUnit> units = FluentIterable.from(TimeUnit.values());
try {
Reported by PMD.
guava-tests/test/com/google/common/base/SplitterTest.java
506 issues
Line: 17
* limitations under the License.
*/
package com.google.common.base;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.annotations.GwtCompatible;
Reported by PMD.
Line: 35
/** @author Julien Silland */
@GwtCompatible(emulated = true)
public class SplitterTest extends TestCase {
private static final Splitter COMMA_SPLITTER = Splitter.on(',');
public void testSplitNullString() {
try {
Reported by PMD.
Line: 35
/** @author Julien Silland */
@GwtCompatible(emulated = true)
public class SplitterTest extends TestCase {
private static final Splitter COMMA_SPLITTER = Splitter.on(',');
public void testSplitNullString() {
try {
Reported by PMD.
Line: 39
private static final Splitter COMMA_SPLITTER = Splitter.on(',');
public void testSplitNullString() {
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
Reported by PMD.
Line: 42
public void testSplitNullString() {
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
Reported by PMD.
Line: 42
public void testSplitNullString() {
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
Reported by PMD.
Line: 43
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Reported by PMD.
Line: 43
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Reported by PMD.
Line: 47
}
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Iterable<String> letters = COMMA_SPLITTER.split(simple);
assertThat(letters).containsExactly("a", "b", "c").inOrder();
}
Reported by PMD.
Line: 48
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Iterable<String> letters = COMMA_SPLITTER.split(simple);
assertThat(letters).containsExactly("a", "b", "c").inOrder();
}
/**
Reported by PMD.
android/guava-tests/test/com/google/common/base/SplitterTest.java
502 issues
Line: 17
* limitations under the License.
*/
package com.google.common.base;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
Reported by PMD.
Line: 34
/** @author Julien Silland */
@GwtCompatible(emulated = true)
public class SplitterTest extends TestCase {
private static final Splitter COMMA_SPLITTER = Splitter.on(',');
public void testSplitNullString() {
try {
Reported by PMD.
Line: 34
/** @author Julien Silland */
@GwtCompatible(emulated = true)
public class SplitterTest extends TestCase {
private static final Splitter COMMA_SPLITTER = Splitter.on(',');
public void testSplitNullString() {
try {
Reported by PMD.
Line: 38
private static final Splitter COMMA_SPLITTER = Splitter.on(',');
public void testSplitNullString() {
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
Reported by PMD.
Line: 41
public void testSplitNullString() {
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
Reported by PMD.
Line: 41
public void testSplitNullString() {
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
Reported by PMD.
Line: 42
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Reported by PMD.
Line: 42
try {
COMMA_SPLITTER.split(null);
fail();
} catch (NullPointerException expected) {
}
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Reported by PMD.
Line: 46
}
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Iterable<String> letters = COMMA_SPLITTER.split(simple);
assertThat(letters).containsExactly("a", "b", "c").inOrder();
}
Reported by PMD.
Line: 47
}
public void testCharacterSimpleSplit() {
String simple = "a,b,c";
Iterable<String> letters = COMMA_SPLITTER.split(simple);
assertThat(letters).containsExactly("a", "b", "c").inOrder();
}
/**
Reported by PMD.
android/guava-tests/test/com/google/common/collect/OrderingTest.java
487 issues
Line: 660
}
public void testLeastOfIterable_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
Reported by PMD.
Line: 661
public void testLeastOfIterable_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
List<Integer> list = Arrays.asList(3, foo, bar, -1);
Reported by PMD.
Line: 672
}
public void testLeastOfIterator_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
Reported by PMD.
Line: 673
public void testLeastOfIterator_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
List<Integer> list = Arrays.asList(3, foo, bar, -1);
Reported by PMD.
Line: 756
assertEquals(0, (int) numberOrdering.min(ints.iterator()));
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints.iterator()));
assertSame(a, numberOrdering.min(ints.iterator()));
}
Reported by PMD.
Line: 757
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints.iterator()));
assertSame(a, numberOrdering.min(ints.iterator()));
}
Reported by PMD.
Line: 783
assertEquals(0, (int) numberOrdering.min(ints));
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints));
assertSame(a, numberOrdering.min(ints));
}
Reported by PMD.
Line: 784
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints));
assertSame(a, numberOrdering.min(ints));
}
Reported by PMD.
Line: 805
assertEquals(0, (int) numberOrdering.min(5, 3, 0, 9, 0));
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
assertSame(a, numberOrdering.max(a, b, b));
assertSame(a, numberOrdering.min(a, b, b));
}
Reported by PMD.
Line: 806
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
assertSame(a, numberOrdering.max(a, b, b));
assertSame(a, numberOrdering.min(a, b, b));
}
public void testParameterMinAndMax() {
Reported by PMD.
guava-tests/test/com/google/common/collect/OrderingTest.java
487 issues
Line: 660
}
public void testLeastOfIterable_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
Reported by PMD.
Line: 661
public void testLeastOfIterable_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
List<Integer> list = Arrays.asList(3, foo, bar, -1);
Reported by PMD.
Line: 672
}
public void testLeastOfIterator_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
Reported by PMD.
Line: 673
public void testLeastOfIterator_ties() {
Integer foo = new Integer(Integer.MAX_VALUE - 10);
Integer bar = new Integer(Integer.MAX_VALUE - 10);
assertNotSame(foo, bar);
assertEquals(foo, bar);
List<Integer> list = Arrays.asList(3, foo, bar, -1);
Reported by PMD.
Line: 756
assertEquals(0, (int) numberOrdering.min(ints.iterator()));
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints.iterator()));
assertSame(a, numberOrdering.min(ints.iterator()));
}
Reported by PMD.
Line: 757
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints.iterator()));
assertSame(a, numberOrdering.min(ints.iterator()));
}
Reported by PMD.
Line: 783
assertEquals(0, (int) numberOrdering.min(ints));
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints));
assertSame(a, numberOrdering.min(ints));
}
Reported by PMD.
Line: 784
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
ints = Lists.newArrayList(a, b, b);
assertSame(a, numberOrdering.max(ints));
assertSame(a, numberOrdering.min(ints));
}
Reported by PMD.
Line: 805
assertEquals(0, (int) numberOrdering.min(5, 3, 0, 9, 0));
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
assertSame(a, numberOrdering.max(a, b, b));
assertSame(a, numberOrdering.min(a, b, b));
}
Reported by PMD.
Line: 806
// when the values are the same, the first argument should be returned
Integer a = new Integer(4);
Integer b = new Integer(4);
assertSame(a, numberOrdering.max(a, b, b));
assertSame(a, numberOrdering.min(a, b, b));
}
public void testParameterMinAndMax() {
Reported by PMD.