mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-05 23:22:47 +00:00
Source code cleanup
This commit is contained in:
@@ -186,7 +186,8 @@ public class SoftCacheService extends AbstractService implements CacheService {
|
||||
while ((en = (SoftEntry) refQueue.poll()) != null) {
|
||||
K key = en.getKey();
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("{} : cleaned up value for key: {}", cacheName, key);
|
||||
log.debug("{} : cleaned up value for key: {}", cacheName,
|
||||
key);
|
||||
cacheMap.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,8 @@ public class WeakCacheService extends AbstractService implements CacheService {
|
||||
while ((en = (Entry) refQueue.poll()) != null) {
|
||||
K key = en.getKey();
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("{}: cleaned up value for key: {}", cacheName, key);
|
||||
log.debug("{}: cleaned up value for key: {}", cacheName,
|
||||
key);
|
||||
cacheMap.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,7 @@ public class Log4JLoggingService extends
|
||||
|
||||
@Override
|
||||
protected void doStart() throws ServiceStartException {
|
||||
final Layout layout = new PatternLayout(
|
||||
"[%p %d] %c{1} - %m%n");
|
||||
final Layout layout = new PatternLayout("[%p %d] %c{1} - %m%n");
|
||||
rootLogger = Logger.getRootLogger();
|
||||
|
||||
rootLogger.removeAllAppenders();
|
||||
|
||||
@@ -50,7 +50,8 @@ public enum ThreadPoolPriority {
|
||||
public final int threadPriority;
|
||||
|
||||
/**
|
||||
* @param threadPriority the {@link Thread} priority {@link Integer} index
|
||||
* @param threadPriority
|
||||
* the {@link Thread} priority {@link Integer} index
|
||||
*/
|
||||
ThreadPoolPriority(int threadPriority) {
|
||||
this.threadPriority = threadPriority;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class Java7VFSService extends
|
||||
public Path resolve(String path) {
|
||||
return resolve(Paths.get(path));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Path resolve(Path path) {
|
||||
log.debug("Resolving file {}", path);
|
||||
@@ -81,14 +81,13 @@ public class Java7VFSService extends
|
||||
public Path resolveDataFile(String path) {
|
||||
return resolveDataFile(Paths.get(path));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Path resolveDataFile(Path path) {
|
||||
log.debug("Resolving data file {}", path);
|
||||
return dataRoot.resolve(path);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doStop() throws ServiceStopException {
|
||||
root = null;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class TrueZipVFSService extends
|
||||
public Path resolve(String path) {
|
||||
return resolve(Paths.get(path));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Path resolve(Path path) {
|
||||
log.debug("Resolving file {}", path);
|
||||
@@ -86,7 +86,7 @@ public class TrueZipVFSService extends
|
||||
public Path resolveDataFile(String path) {
|
||||
return resolveDataFile(Paths.get(path));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Path resolveDataFile(Path path) {
|
||||
log.debug("Resolving data file {}", path);
|
||||
|
||||
@@ -38,7 +38,7 @@ public interface VFSService extends Service {
|
||||
* @return the resolved file. Will return null if could not resolve.
|
||||
*/
|
||||
Path resolve(String path);
|
||||
|
||||
|
||||
/**
|
||||
* Resolves an file. If the file cannot be resolved, null will be returned.
|
||||
* <p>
|
||||
@@ -63,7 +63,7 @@ public interface VFSService extends Service {
|
||||
* @return the resolved file. Will return null if could not resolve.
|
||||
*/
|
||||
Path resolveDataFile(String path);
|
||||
|
||||
|
||||
/**
|
||||
* Resolves an file inside the data storage file system. If the file cannot
|
||||
* be resolved, null will be returned.
|
||||
|
||||
@@ -19,10 +19,10 @@ package com.l2jserver.service.database.ddl;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.service.database.ddl.struct.Column;
|
||||
import com.l2jserver.service.database.ddl.struct.Column.ColumnType;
|
||||
import com.l2jserver.service.database.ddl.struct.ForeignKey;
|
||||
import com.l2jserver.service.database.ddl.struct.PrimaryKey;
|
||||
import com.l2jserver.service.database.ddl.struct.Table;
|
||||
import com.l2jserver.service.database.ddl.struct.Column.ColumnType;
|
||||
import com.l2jserver.util.factory.CollectionFactory;
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,10 +47,14 @@ public class Table {
|
||||
private final List<ForeignKey> foreignKeys = CollectionFactory.newList();
|
||||
|
||||
/**
|
||||
* @param name the table name
|
||||
* @param columns the column
|
||||
* @param primaryKey the primary key
|
||||
* @param foreignKeys the foreign keys
|
||||
* @param name
|
||||
* the table name
|
||||
* @param columns
|
||||
* the column
|
||||
* @param primaryKey
|
||||
* the primary key
|
||||
* @param foreignKeys
|
||||
* the foreign keys
|
||||
*/
|
||||
public Table(String name, Map<String, Column> columns,
|
||||
PrimaryKey primaryKey, List<ForeignKey> foreignKeys) {
|
||||
@@ -62,8 +66,10 @@ public class Table {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name the table name
|
||||
* @param primaryKey the primary key
|
||||
* @param name
|
||||
* the table name
|
||||
* @param primaryKey
|
||||
* the primary key
|
||||
*/
|
||||
public Table(String name, PrimaryKey primaryKey) {
|
||||
this.name = name;
|
||||
@@ -104,7 +110,8 @@ public class Table {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name the column name
|
||||
* @param name
|
||||
* the column name
|
||||
* @return the column represented by <code>name</code>
|
||||
*/
|
||||
public Column getColumn(String name) {
|
||||
|
||||
@@ -1103,7 +1103,8 @@ public abstract class AbstractSQLDatabaseService extends
|
||||
*
|
||||
* @param q
|
||||
* the query clause
|
||||
* @param e the entity
|
||||
* @param e
|
||||
* the entity
|
||||
*/
|
||||
protected abstract void query(AbstractSQLQuery<?> q, E e);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,8 @@ public class QPathUtils {
|
||||
* @return the {@link Field} holding <code>path</code>
|
||||
*/
|
||||
public static Field getReflectionField(Path<?> path) {
|
||||
return ClassUtils.getFieldWithValue(path.getMetadata().getParent(), path);
|
||||
return ClassUtils.getFieldWithValue(path.getMetadata().getParent(),
|
||||
path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +82,7 @@ public class QPathUtils {
|
||||
*/
|
||||
public static int getColumnSize(Path<?> path) {
|
||||
final Field field = getReflectionField(path);
|
||||
if(field == null)
|
||||
if (field == null)
|
||||
return 0;
|
||||
final ColumnSize size = field.getAnnotation(ColumnSize.class);
|
||||
if (size != null)
|
||||
@@ -96,7 +97,7 @@ public class QPathUtils {
|
||||
*/
|
||||
public static boolean isAutoIncrementable(Path<?> path) {
|
||||
final Field field = getReflectionField(path);
|
||||
if(field == null)
|
||||
if (field == null)
|
||||
return false;
|
||||
final ColumnAutoIncrement autoInc = field
|
||||
.getAnnotation(ColumnAutoIncrement.class);
|
||||
@@ -112,7 +113,7 @@ public class QPathUtils {
|
||||
*/
|
||||
public static boolean isNullable(Path<?> path) {
|
||||
final Field field = getReflectionField(path);
|
||||
if(field == null)
|
||||
if (field == null)
|
||||
return false;
|
||||
final ColumnNullable nullable = field
|
||||
.getAnnotation(ColumnNullable.class);
|
||||
@@ -130,7 +131,7 @@ public class QPathUtils {
|
||||
*/
|
||||
public static boolean hasDefaultValue(Path<?> path) {
|
||||
final Field field = getReflectionField(path);
|
||||
if(field == null)
|
||||
if (field == null)
|
||||
return false;
|
||||
final ColumnDefault def = field.getAnnotation(ColumnDefault.class);
|
||||
if (def == null) {
|
||||
@@ -147,7 +148,7 @@ public class QPathUtils {
|
||||
*/
|
||||
public static String getDefaultUntransformedValue(Path<?> path) {
|
||||
final Field field = getReflectionField(path);
|
||||
if(field == null)
|
||||
if (field == null)
|
||||
return null;
|
||||
final ColumnDefault def = field.getAnnotation(ColumnDefault.class);
|
||||
if (def != null)
|
||||
|
||||
@@ -82,7 +82,7 @@ public class TransformerFactory {
|
||||
return PathTransformer.SHARED_INSTANCE;
|
||||
} else if (type.isEnum()) {
|
||||
return EnumTransformer.SHARED_INSTANCE;
|
||||
} else if(type.isArray()) {
|
||||
} else if (type.isArray()) {
|
||||
return ArrayTransformer.SHARED_INSTANCE;
|
||||
} else if (type == String.class)
|
||||
return StringTransformer.SHARED_INSTANCE;
|
||||
|
||||
@@ -47,6 +47,7 @@ public class ArrayUtilsTest extends ArrayUtils {
|
||||
|
||||
/**
|
||||
* Simple test class
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
private static class TestClass {
|
||||
@@ -56,7 +57,8 @@ public class ArrayUtilsTest extends ArrayUtils {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* @param string the name
|
||||
* @param string
|
||||
* the name
|
||||
*/
|
||||
public TestClass(String string) {
|
||||
this.name = string;
|
||||
|
||||
Reference in New Issue
Block a user