This commit is contained in:
RedKale
2016-02-24 11:25:03 +08:00
parent a99413f49d
commit d2f684ce66
12 changed files with 14 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ import java.util.regex.*;
* @author zhangjx
* @param <T> 泛型
*/
@SuppressWarnings("unchecked")
public final class ClassFilter<T> {
private final Set<FilterEntry<T>> entrys = new HashSet<>();

View File

@@ -38,6 +38,7 @@ import org.redkale.util.*;
*
* @author zhangjx
*/
@SuppressWarnings("unchecked")
public abstract class NodeServer {
//INFO日志的换行符

View File

@@ -65,6 +65,7 @@ public abstract class Writer {
*
* @param obj 写入的对象
*/
@SuppressWarnings("unchecked")
public final void writeObjectField(final EnMember member, Object obj) {
Object value = member.attribute.get(obj);
if (value == null) return;

View File

@@ -15,6 +15,7 @@ import org.redkale.convert.*;
*
* @author zhangjx
*/
@SuppressWarnings("unchecked")
public final class BsonFactory extends ConvertFactory<BsonReader, BsonWriter> {
private static final BsonFactory instance = new BsonFactory(null, Boolean.getBoolean("convert.bson.tiny"));

View File

@@ -116,6 +116,7 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
return this.logger;
}
@SuppressWarnings("unchecked")
public void addServlet(S servlet, final Object attachment, AnyValue conf, K... mappings) {
this.prepare.addServlet(servlet, attachment, conf, mappings);
}

View File

@@ -92,7 +92,7 @@ public final class Transport {
this.group = first.group;
this.bufferPool = first.bufferPool;
this.clientAddress = first.clientAddress;
Set<InetSocketAddress> addrs = new HashSet();
Set<InetSocketAddress> addrs = new HashSet<>();
transports.forEach(t -> addrs.addAll(Arrays.asList(t.getRemoteAddresses())));
updateRemoteAddresses(addrs);
}

View File

@@ -40,6 +40,7 @@ public final class ServiceWrapper<T extends Service> implements Comparable<Servi
private final Class[] types;
@SuppressWarnings("unchecked")
public ServiceWrapper(Class<T> type, T service, String name, String sncpGroup, Set<String> groups, AnyValue conf) {
this.service = service;
this.conf = conf;

View File

@@ -21,6 +21,7 @@ import org.redkale.watch.*;
*
* @author zhangjx
*/
@SuppressWarnings("unchecked")
public final class SncpServer extends Server<DLong, SncpContext, SncpRequest, SncpResponse, SncpServlet> {
public SncpServer() {

View File

@@ -24,6 +24,7 @@ import org.redkale.util.*;
* @author zhangjx
* @param <T> Entity类的泛型
*/
@SuppressWarnings("unchecked")
public final class EntityCache<T> {
private static final Logger logger = Logger.getLogger(EntityCache.class.getName());

View File

@@ -287,6 +287,7 @@ public class FilterNode {
return createElementPredicate(cache, join, cache.getAttribute(column));
}
@SuppressWarnings("unchecked")
protected final <T> Predicate<T> createElementPredicate(final EntityCache<T> cache, final boolean join, final Attribute<T, Serializable> attr) {
if (attr == null) return null;
final String field = join ? (cache.getType().getSimpleName() + "." + attr.field()) : attr.field();

View File

@@ -119,6 +119,7 @@ public interface Attribute<T, F> {
* @param field 字段,如果该字段不存在则抛异常
* @return Attribute对象
*/
@SuppressWarnings("unchecked")
public static <T, F> Attribute<T, F> create(final java.lang.reflect.Field field) {
return create((Class<T>) field.getDeclaringClass(), field.getName(), field, null, null);
}
@@ -132,6 +133,7 @@ public interface Attribute<T, F> {
* @param field 字段,如果该字段不存在则抛异常
* @return Attribute对象
*/
@SuppressWarnings("unchecked")
public static <T, F> Attribute<T, F> create(String fieldalias, final java.lang.reflect.Field field) {
return create((Class<T>) field.getDeclaringClass(), fieldalias, field, null, null);
}
@@ -190,6 +192,7 @@ public interface Attribute<T, F> {
* @param setter setter方法
* @return Attribute对象
*/
@SuppressWarnings("unchecked")
public static <T, F> Attribute<T, F> create(final java.lang.reflect.Method getter, final java.lang.reflect.Method setter) {
return create((Class) (getter == null ? setter.getDeclaringClass() : getter.getDeclaringClass()), null, null, getter, setter);
}

View File

@@ -58,7 +58,7 @@ public final class ObjectPool<T> implements Supplier<T> {
this.creator = creator;
this.prepare = prepare;
this.recycler = recycler;
this.queue = new LinkedBlockingQueue(Math.max(Runtime.getRuntime().availableProcessors() * 2, max));
this.queue = new LinkedBlockingQueue<>(Math.max(Runtime.getRuntime().availableProcessors() * 2, max));
this.debug = logger.isLoggable(Level.FINER);
}