Merge pull request #384 from DevFactory/release/Redundant-Field-Initializer-fix-1

pmd:RedundantFieldInitializer - Redundant-Field-Initializer
This commit is contained in:
Narendra Pathai 2016-02-18 12:39:06 +05:30
commit dfef28e93e
12 changed files with 15 additions and 15 deletions

View File

@ -31,7 +31,7 @@ import java.util.ArrayList;
*/
public class CacheStore {
static LruCache cache = null;
static LruCache cache;
private CacheStore() {
}

View File

@ -50,8 +50,8 @@ public class LruCache {
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;

View File

@ -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.

View File

@ -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.

View File

@ -111,7 +111,7 @@ public class LazyFluentIterable<TYPE> implements FluentIterable<TYPE> {
@Override
public Iterator<TYPE> iterator() {
return new DecoratingIterator<TYPE>(iterable.iterator()) {
int currentIndex = 0;
int currentIndex;
@Override
public TYPE computeNext() {
@ -156,7 +156,7 @@ public class LazyFluentIterable<TYPE> implements FluentIterable<TYPE> {
private int stopIndex;
private int totalElementsCount;
private List<TYPE> list;
private int currentIndex = 0;
private int currentIndex;
@Override
public TYPE computeNext() {

View File

@ -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.

View File

@ -35,8 +35,8 @@ import java.util.List;
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));

View File

@ -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;

View File

@ -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.

View File

@ -29,7 +29,7 @@ import java.util.concurrent.locks.Lock;
*/
public class Writer implements Runnable {
private Lock writeLock = null;
private Lock writeLock;
private String name;

View File

@ -31,7 +31,7 @@ package com.iluwatar.singleton;
*/
public final class ThreadSafeLazyLoadedIvoryTower {
private static ThreadSafeLazyLoadedIvoryTower instance = null;
private static ThreadSafeLazyLoadedIvoryTower instance;
private ThreadSafeLazyLoadedIvoryTower() {}

View File

@ -30,7 +30,7 @@ package com.iluwatar.twin;
*/
public class BallItem extends GameItem {
private boolean isSuspended = false;
private boolean isSuspended;
private BallThread twin;