pmd:RedundantFieldInitializer - Redundant-Field-Initializer
This commit is contained in:
		@@ -31,7 +31,7 @@ import java.util.ArrayList;
 | 
			
		||||
 */
 | 
			
		||||
public class CacheStore {
 | 
			
		||||
 | 
			
		||||
  static LruCache cache = null;
 | 
			
		||||
  static LruCache cache;
 | 
			
		||||
 | 
			
		||||
  private CacheStore() {
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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() {
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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));
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ package com.iluwatar.singleton;
 | 
			
		||||
 */
 | 
			
		||||
public class ThreadSafeLazyLoadedIvoryTower {
 | 
			
		||||
 | 
			
		||||
  private static ThreadSafeLazyLoadedIvoryTower instance = null;
 | 
			
		||||
  private static ThreadSafeLazyLoadedIvoryTower instance;
 | 
			
		||||
 | 
			
		||||
  private ThreadSafeLazyLoadedIvoryTower() {}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@ package com.iluwatar.twin;
 | 
			
		||||
 */
 | 
			
		||||
public class BallItem extends GameItem {
 | 
			
		||||
 | 
			
		||||
  private boolean isSuspended = false;
 | 
			
		||||
  private boolean isSuspended;
 | 
			
		||||
 | 
			
		||||
  private BallThread twin;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user