Skip to content

Commit

Permalink
enabled modifier order check and fixed all the relative issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed May 24, 2019
1 parent 7be53b8 commit add35f9
Show file tree
Hide file tree
Showing 64 changed files with 191 additions and 193 deletions.
2 changes: 0 additions & 2 deletions _base/orient_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@
<!--
<module name="UpperEll"/>
-->
<!--
<module name="ModifierOrder"/>
-->
<!--
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class OLRUCache<K, V> extends LinkedHashMap<K, V> {

private static final long serialVersionUID = 0;

final private int cacheSize;
private final int cacheSize;

public OLRUCache(final int iCacheSize) {
super(16, (float) 0.75, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public enum LOCK {
private long acquireTimeout;
protected final ConcurrentSkipListMap<T, CountableLock> map;
private final boolean enabled;
private final static Object NULL_KEY = new Object();
private static final Object NULL_KEY = new Object();

@SuppressWarnings("serial")
private static class CountableLock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public enum LOCK {
private final boolean enabled;
private final int amountOfCachedInstances;

private final static Object NULL_KEY = new Object();
private static final Object NULL_KEY = new Object();

@SuppressWarnings("serial")
private static class CountableLock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ protected OModifiableInteger initialValue() {
}
}

private final static class WNode {
private static final class WNode {
private final ConcurrentHashMap<Thread, Boolean> waitingReaders = new ConcurrentHashMap<Thread, Boolean>();

private volatile boolean locked = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,34 @@ public class ScalableRWLock implements ReadWriteLock, java.io.Serializable {
private static final long serialVersionUID = -7552055681918630764L;

// Definition of an invalid thread-id (must be negative)
private final static int SRWL_STATE_NOT_WRITING = 0;
private final static int SRWL_STATE_WRITING = 1;
private final static int SRWL_STATE_NOT_READING = 0;
private final static int SRWL_STATE_READING = 1;
private final static AtomicInteger[] dummyArray = new AtomicInteger[0];
private static final int SRWL_STATE_NOT_WRITING = 0;
private static final int SRWL_STATE_WRITING = 1;
private static final int SRWL_STATE_NOT_READING = 0;
private static final int SRWL_STATE_READING = 1;
private static final AtomicInteger[] dummyArray = new AtomicInteger[0];

/**
* List of Reader's states that the Writer will scan when attempting to
* acquire the lock in write-mode
*/
private transient final ConcurrentLinkedQueue<AtomicInteger> readersStateList;
private final transient ConcurrentLinkedQueue<AtomicInteger> readersStateList;

/**
* The thread-id of the Writer currently holding the lock in write-mode, or
* SRWL_INVALID_TID if there is no Writer holding or attempting to acquire
* the lock in write mode.
*/
private transient final StampedLock stampedLock;
private final transient StampedLock stampedLock;

/**
* Thread-local reference to the current thread's ReadersEntry instance.
* It's from this instance that the current Reader thread is able
* to determine where to store its own state, and the number of reentrant
* read lock loops for that particular thread.
*/
private transient final ThreadLocal<ReadersEntry> entry;
private final transient ThreadLocal<ReadersEntry> entry;

private transient final AtomicReference<AtomicInteger[]> readersStateArrayRef;
private final transient AtomicReference<AtomicInteger[]> readersStateArrayRef;

/**
* The lock returned by method {@link ScalableRWLock#readLock}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@
* Custom implementation of TTY reader. Supports arrow keys + history.
*/
public class TTYConsoleReader implements OConsoleReader {
public final static int HORIZONTAL_TAB_CHAR = 9;
public final static int NEW_LINE_CHAR = 10;
public final static int VERTICAL_TAB_CHAR = 11;
public final static int ESC = 27;
public final static int UNIT_SEPARATOR_CHAR = 31;
public final static int CTRL = 53;
public final static int SEMICOLON = 59;
public final static int UP_CHAR = 65;
public final static int DOWN_CHAR = 66;
public final static int RIGHT_CHAR = 67;
public final static int LEFT_CHAR = 68;
public final static int END_CHAR = 70;
public final static int BEGIN_CHAR = 72;
public final static int BACKSLASH = 92;
public final static int DEL_CHAR = 126;
public final static int BACKSPACE_CHAR = 127;
private final static int MAX_HISTORY_ENTRIES = 50;
public static final int HORIZONTAL_TAB_CHAR = 9;
public static final int NEW_LINE_CHAR = 10;
public static final int VERTICAL_TAB_CHAR = 11;
public static final int ESC = 27;
public static final int UNIT_SEPARATOR_CHAR = 31;
public static final int CTRL = 53;
public static final int SEMICOLON = 59;
public static final int UP_CHAR = 65;
public static final int DOWN_CHAR = 66;
public static final int RIGHT_CHAR = 67;
public static final int LEFT_CHAR = 68;
public static final int END_CHAR = 70;
public static final int BEGIN_CHAR = 72;
public static final int BACKSLASH = 92;
public static final int DEL_CHAR = 126;
public static final int BACKSPACE_CHAR = 127;
private static final int MAX_HISTORY_ENTRIES = 50;
private static final Object signalLock = new Object();
private static String HISTORY_FILE_NAME = ".orientdb_history";
private static String ORIENTDB_HOME_DIR = ".orientdb";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public String toString() {
return code;
}

private final static boolean supportsColors;
private static final boolean supportsColors;

public static boolean isSupportsColors() {
return supportsColors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static OTraversePath empty() {
return EMPTY_PATH;
}

private static abstract class PathItem {
private abstract static class PathItem {
protected final PathItem parentItem;
protected final int depth;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
*/
public class OExecutionThreadLocal extends ThreadLocal<OExecutionThreadLocal.OExecutionThreadData> {
public class OExecutionThreadData {
volatile public OAsyncReplicationOk onAsyncReplicationOk;
volatile public OAsyncReplicationError onAsyncReplicationError;
public volatile OAsyncReplicationOk onAsyncReplicationOk;
public volatile OAsyncReplicationError onAsyncReplicationError;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/
public interface ODatabaseDocument extends ODatabase<ORecord> {

final static String TYPE = "document";
String TYPE = "document";

/**
* Browses all the records of the specified class and also all the subclasses. If you've a class Vehicle and Car that extends
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
*
*/
public class OLazyRecordIterator implements OLazyIterator<OIdentifiable>, OResettable {
final private ORecord sourceRecord;
final private Iterable<? extends OIdentifiable> source;
private final ORecord sourceRecord;
private final Iterable<? extends OIdentifiable> source;
private Iterator<? extends OIdentifiable> underlying;
final private boolean autoConvert2Record;
private final boolean autoConvert2Record;

public OLazyRecordIterator(final Iterator<? extends OIdentifiable> iIterator, final boolean iConvertToRecord) {
this.sourceRecord = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
@SuppressWarnings({ "serial" })
public class ORecordLazyMap extends OTrackedMap<OIdentifiable> implements ORecordLazyMultiValue {
final private byte recordType;
private final byte recordType;
private ORecordMultiValueHelper.MULTIVALUE_CONTENT_TYPE status = MULTIVALUE_CONTENT_TYPE.EMPTY;
protected boolean marshalling = false;
private boolean autoConvertToRecord = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
*
*/
public class ORecordTrackedIterator implements Iterator<OIdentifiable> {
final private ORecord sourceRecord;
final private Iterator<?> underlying;
private final ORecord sourceRecord;
private final Iterator<?> underlying;

public ORecordTrackedIterator(final ORecord iSourceRecord, final Iterator<?> iIterator) {
this.sourceRecord = iSourceRecord;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ORecordTrackedSet extends AbstractCollection<OIdentifiable> impleme
protected final ORecord sourceRecord;
protected Map<OIdentifiable, Object> map = new HashMap<OIdentifiable, Object>();
private STATUS status = STATUS.NOT_LOADED;
protected final static Object ENTRY_REMOVAL = new Object();
protected static final Object ENTRY_REMOVAL = new Object();
private List<OMultiValueChangeListener<OIdentifiable, OIdentifiable>> changeListeners;

public ORecordTrackedSet(final ORecord iSourceRecord) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
@SuppressWarnings("serial")
public class OTrackedMap<T> extends LinkedHashMap<Object, T> implements ORecordElement, OTrackedMultiValue<Object, T>, Serializable {
final protected ORecord sourceRecord;
protected final ORecord sourceRecord;
private STATUS status = STATUS.NOT_LOADED;
private List<OMultiValueChangeListener<Object, T>> changeListeners = null;
protected Class<?> genericClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*/
public abstract class ODatabaseImpExpAbstract extends ODatabaseTool {
protected final static String DEFAULT_EXT = ".json";
protected static final String DEFAULT_EXT = ".json";
protected ODatabaseDocumentInternal database;
protected String fileName;
protected Set<String> includeClusters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
* @author Artem Orobets added composite index managemement
*/
public class OIndexManagerShared extends OIndexManagerAbstract {
private volatile transient Thread recreateIndexesThread = null;
private transient volatile Thread recreateIndexesThread = null;
private volatile boolean rebuildCompleted = false;
private final OStorage storage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@ public abstract class OIndexRemote<T> implements OIndex<T> {
public static final String QUERY_GET_VALUES_BEETWEN_EXCLUSIVE_TO_CONDITION = "key < ?";
public static final String QUERY_GET_VALUES_AND_OPERATOR = " and ";
public static final String QUERY_GET_VALUES_LIMIT = " limit ";
protected final static String QUERY_ENTRIES = "select key, rid from index:`%s`";
protected final static String QUERY_ENTRIES_DESC = "select key, rid from index:`%s` order by key desc";

private final static String QUERY_ITERATE_ENTRIES = "select from index:`%s` where key in [%s] order by key %s ";
private final static String QUERY_GET_ENTRIES = "select from index:`%s` where key in [%s]";

private final static String QUERY_PUT = "insert into index:`%s` (key,rid) values (?,?)";
private final static String QUERY_REMOVE = "delete from index:`%s` where key = ?";
private final static String QUERY_REMOVE2 = "delete from index:`%s` where key = ? and rid = ?";
private final static String QUERY_REMOVE3 = "delete from index:`%s` where rid = ?";
private final static String QUERY_CONTAINS = "select count(*) as size from index:`%s` where key = ?";
private final static String QUERY_COUNT = "select count(*) as size from index:`%s` where key = ?";
private final static String QUERY_COUNT_RANGE = "select count(*) as size from index:`%s` where ";
private final static String QUERY_SIZE = "select count(*) as size from index:`%s`";
private final static String QUERY_KEY_SIZE = "select indexKeySize('%s') as size";
private final static String QUERY_KEYS = "select key from index:`%s`";
private final static String QUERY_REBUILD = "rebuild index %s";
private final static String QUERY_CLEAR = "delete from index:`%s`";
private final static String QUERY_DROP = "drop index %s";
protected static final String QUERY_ENTRIES = "select key, rid from index:`%s`";
protected static final String QUERY_ENTRIES_DESC = "select key, rid from index:`%s` order by key desc";

private static final String QUERY_ITERATE_ENTRIES = "select from index:`%s` where key in [%s] order by key %s ";
private static final String QUERY_GET_ENTRIES = "select from index:`%s` where key in [%s]";

private static final String QUERY_PUT = "insert into index:`%s` (key,rid) values (?,?)";
private static final String QUERY_REMOVE = "delete from index:`%s` where key = ?";
private static final String QUERY_REMOVE2 = "delete from index:`%s` where key = ? and rid = ?";
private static final String QUERY_REMOVE3 = "delete from index:`%s` where rid = ?";
private static final String QUERY_CONTAINS = "select count(*) as size from index:`%s` where key = ?";
private static final String QUERY_COUNT = "select count(*) as size from index:`%s` where key = ?";
private static final String QUERY_COUNT_RANGE = "select count(*) as size from index:`%s` where ";
private static final String QUERY_SIZE = "select count(*) as size from index:`%s`";
private static final String QUERY_KEY_SIZE = "select indexKeySize('%s') as size";
private static final String QUERY_KEYS = "select key from index:`%s`";
private static final String QUERY_REBUILD = "rebuild index %s";
private static final String QUERY_CLEAR = "delete from index:`%s`";
private static final String QUERY_DROP = "drop index %s";
protected final String databaseName;
private final String wrappedType;
private final String algorithm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
@SuppressWarnings("unchecked")
public class OIndexRemoteMultiValue extends OIndexRemote<Collection<OIdentifiable>> {
protected final static String QUERY_GET = "select expand( rid ) from index:`%s` where key = ?";
protected static final String QUERY_GET = "select expand( rid ) from index:`%s` where key = ?";

public OIndexRemoteMultiValue(final String iName, final String iWrappedType, final String algorithm, final ORID iRid,
final OIndexDefinition iIndexDefinition, final ODocument iConfiguration, final Set<String> clustersToIndex, String database) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Luca Garulli (l.garulli--(at)--orientdb.com)
*/
public class OIndexRemoteOneValue extends OIndexRemote<OIdentifiable> {
protected final static String QUERY_GET = "select rid from index:`%s` where key = ?";
protected static final String QUERY_GET = "select rid from index:`%s` where key = ?";

public OIndexRemoteOneValue(final String iName, final String iWrappedType, final String algorithm, final ORID iRid,
final OIndexDefinition iIndexDefinition, final ODocument iConfiguration, final Set<String> clustersToIndex, String database) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
*/
public class ONullOutputListener implements OProgressListener {
public final static ONullOutputListener INSTANCE = new ONullOutputListener();
public static final ONullOutputListener INSTANCE = new ONullOutputListener();

@Override
public void onBegin(Object iTask, long iTotal, Object metadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Set;

public final class OCellBTreeMultiValueIndexEngine implements OMultiValueIndexEngine {
private final static int BINARY_VERSION = 2;
private static final int BINARY_VERSION = 2;
public static final String DATA_FILE_EXTENSION = ".cbt";
private static final String NULL_BUCKET_FILE_EXTENSION = ".nbt";
public static final String M_CONTAINER_EXTENSION = ".mbt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class OPropertyImpl implements OProperty {
protected final OClassImpl owner;
protected OType linkedType;
protected OClass linkedClass;
transient private String linkedClassName;
private transient String linkedClassName;

protected String description;
protected boolean mandatory;
Expand Down
Loading

0 comments on commit add35f9

Please sign in to comment.