Merge pull request #384 from DevFactory/release/Redundant-Field-Initializer-fix-1
pmd:RedundantFieldInitializer - Redundant-Field-Initializer
This commit is contained in:
commit
dfef28e93e
@ -31,7 +31,7 @@ import java.util.ArrayList;
|
|||||||
*/
|
*/
|
||||||
public class CacheStore {
|
public class CacheStore {
|
||||||
|
|
||||||
static LruCache cache = null;
|
static LruCache cache;
|
||||||
|
|
||||||
private CacheStore() {
|
private CacheStore() {
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,8 @@ public class LruCache {
|
|||||||
|
|
||||||
int capacity;
|
int capacity;
|
||||||
HashMap<String, Node> cache = new HashMap<>();
|
HashMap<String, Node> cache = new HashMap<>();
|
||||||
Node head = null;
|
Node head;
|
||||||
Node end = null;
|
Node end;
|
||||||
|
|
||||||
public LruCache(int capacity) {
|
public LruCache(int capacity) {
|
||||||
this.capacity = capacity;
|
this.capacity = capacity;
|
||||||
|
@ -44,7 +44,7 @@ public class Request {
|
|||||||
* Indicates if the request is handled or not. A request can only switch state from unhandled to
|
* Indicates if the request is handled or not. A request can only switch state from unhandled to
|
||||||
* handled, there's no way to 'unhandle' a request
|
* handled, there's no way to 'unhandle' a request
|
||||||
*/
|
*/
|
||||||
private boolean handled = false;
|
private boolean handled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new request of the given type and accompanied description.
|
* Create a new request of the given type and accompanied description.
|
||||||
|
@ -32,7 +32,7 @@ public abstract class DecoratingIterator<TYPE> implements Iterator<TYPE> {
|
|||||||
|
|
||||||
protected final Iterator<TYPE> fromIterator;
|
protected final Iterator<TYPE> fromIterator;
|
||||||
|
|
||||||
private TYPE next = null;
|
private TYPE next;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an iterator that decorates the given iterator.
|
* Creates an iterator that decorates the given iterator.
|
||||||
|
@ -111,7 +111,7 @@ public class LazyFluentIterable<TYPE> implements FluentIterable<TYPE> {
|
|||||||
@Override
|
@Override
|
||||||
public Iterator<TYPE> iterator() {
|
public Iterator<TYPE> iterator() {
|
||||||
return new DecoratingIterator<TYPE>(iterable.iterator()) {
|
return new DecoratingIterator<TYPE>(iterable.iterator()) {
|
||||||
int currentIndex = 0;
|
int currentIndex;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TYPE computeNext() {
|
public TYPE computeNext() {
|
||||||
@ -156,7 +156,7 @@ public class LazyFluentIterable<TYPE> implements FluentIterable<TYPE> {
|
|||||||
private int stopIndex;
|
private int stopIndex;
|
||||||
private int totalElementsCount;
|
private int totalElementsCount;
|
||||||
private List<TYPE> list;
|
private List<TYPE> list;
|
||||||
private int currentIndex = 0;
|
private int currentIndex;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TYPE computeNext() {
|
public TYPE computeNext() {
|
||||||
|
@ -37,7 +37,7 @@ public class FileLoader {
|
|||||||
/**
|
/**
|
||||||
* Indicates if the file is loaded or not.
|
* Indicates if the file is loaded or not.
|
||||||
*/
|
*/
|
||||||
private boolean loaded = false;
|
private boolean loaded;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the file that we want to load.
|
* The name of the file that we want to load.
|
||||||
|
@ -35,8 +35,8 @@ import java.util.List;
|
|||||||
|
|
||||||
public class LoadBalancer {
|
public class LoadBalancer {
|
||||||
private static List<Server> servers = new ArrayList<>();
|
private static List<Server> servers = new ArrayList<>();
|
||||||
private static int id = 0;
|
private static int id;
|
||||||
private static int lastServedId = 0;
|
private static int lastServedId;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
servers.add(new Server("localhost", 8081, ++id));
|
servers.add(new Server("localhost", 8081, ++id));
|
||||||
|
@ -34,7 +34,7 @@ public class Producer {
|
|||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
private int itemId = 0;
|
private int itemId;
|
||||||
|
|
||||||
public Producer(String name, ItemQueue queue) {
|
public Producer(String name, ItemQueue queue) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -40,7 +40,7 @@ public class ReaderWriterLock implements ReadWriteLock {
|
|||||||
|
|
||||||
private Object readerMutex = new Object();
|
private Object readerMutex = new Object();
|
||||||
|
|
||||||
private int currentReaderCount = 0;
|
private int currentReaderCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global mutex is used to indicate that whether reader or writer gets the lock in the moment.
|
* Global mutex is used to indicate that whether reader or writer gets the lock in the moment.
|
||||||
|
@ -29,7 +29,7 @@ import java.util.concurrent.locks.Lock;
|
|||||||
*/
|
*/
|
||||||
public class Writer implements Runnable {
|
public class Writer implements Runnable {
|
||||||
|
|
||||||
private Lock writeLock = null;
|
private Lock writeLock;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ package com.iluwatar.singleton;
|
|||||||
*/
|
*/
|
||||||
public final class ThreadSafeLazyLoadedIvoryTower {
|
public final class ThreadSafeLazyLoadedIvoryTower {
|
||||||
|
|
||||||
private static ThreadSafeLazyLoadedIvoryTower instance = null;
|
private static ThreadSafeLazyLoadedIvoryTower instance;
|
||||||
|
|
||||||
private ThreadSafeLazyLoadedIvoryTower() {}
|
private ThreadSafeLazyLoadedIvoryTower() {}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ package com.iluwatar.twin;
|
|||||||
*/
|
*/
|
||||||
public class BallItem extends GameItem {
|
public class BallItem extends GameItem {
|
||||||
|
|
||||||
private boolean isSuspended = false;
|
private boolean isSuspended;
|
||||||
|
|
||||||
private BallThread twin;
|
private BallThread twin;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user