Skip to content

Commit

Permalink
pmd:RedundantFieldInitializer - Redundant-Field-Initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed Ezzat committed Feb 18, 2016
1 parent 57be8aa commit 0003c6c
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion caching/src/main/java/com/iluwatar/caching/CacheStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
public class CacheStore {

static LruCache cache = null;
static LruCache cache;

private CacheStore() {
}
Expand Down
4 changes: 2 additions & 2 deletions caching/src/main/java/com/iluwatar/caching/LruCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public Node(String userId, UserAccount userAccount) {

int capacity;
HashMap<String, Node> cache = new HashMap<>();
Node head = null;
Node end = null;
Node head;
Node end;

public LruCache(int capacity) {
this.capacity = capacity;
Expand Down
2 changes: 1 addition & 1 deletion chain/src/main/java/com/iluwatar/chain/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class Request {
* 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
*/
private boolean handled = false;
private boolean handled;

/**
* Create a new request of the given type and accompanied description.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public abstract class DecoratingIterator<TYPE> implements Iterator<TYPE> {

protected final Iterator<TYPE> fromIterator;

private TYPE next = null;
private TYPE next;

/**
* Creates an iterator that decorates the given iterator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public FluentIterable<TYPE> first(int count) {
@Override
public Iterator<TYPE> iterator() {
return new DecoratingIterator<TYPE>(iterable.iterator()) {
int currentIndex = 0;
int currentIndex;

@Override
public TYPE computeNext() {
Expand Down Expand Up @@ -156,7 +156,7 @@ public Iterator<TYPE> iterator() {
private int stopIndex;
private int totalElementsCount;
private List<TYPE> list;
private int currentIndex = 0;
private int currentIndex;

@Override
public TYPE computeNext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class FileLoader {
/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

public class LoadBalancer {
private static List<Server> servers = new ArrayList<>();
private static int id = 0;
private static int lastServedId = 0;
private static int id;
private static int lastServedId;

static {
servers.add(new Server("localhost", 8081, ++id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Producer {

private final String name;

private int itemId = 0;
private int itemId;

public Producer(String name, ItemQueue queue) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ReaderWriterLock implements ReadWriteLock {

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
public class Writer implements Runnable {

private Lock writeLock = null;
private Lock writeLock;

private String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
public class ThreadSafeLazyLoadedIvoryTower {

private static ThreadSafeLazyLoadedIvoryTower instance = null;
private static ThreadSafeLazyLoadedIvoryTower instance;

private ThreadSafeLazyLoadedIvoryTower() {}

Expand Down
2 changes: 1 addition & 1 deletion twin/src/main/java/com/iluwatar/twin/BallItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class BallItem extends GameItem {

private boolean isSuspended = false;
private boolean isSuspended;

private BallThread twin;

Expand Down

0 comments on commit 0003c6c

Please sign in to comment.