Skip to content

Commit

Permalink
Apply Java 8 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
anistor committed Apr 26, 2016
1 parent b88973c commit cf129ab
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Expand Up @@ -43,8 +43,7 @@ public class ClientListenerNotifier {
private static final Log log = LogFactory.getLog(ClientListenerNotifier.class, Log.class);
private static final boolean trace = log.isTraceEnabled();

private static final Map<Class<? extends Annotation>, Class<?>[]> allowedListeners =
new HashMap<Class<? extends Annotation>, Class<?>[]>(4);
private static final Map<Class<? extends Annotation>, Class<?>[]> allowedListeners = new HashMap<>(4);

static {
allowedListeners.put(ClientCacheEntryCreated.class, new Class[]{ClientCacheEntryCreatedEvent.class, ClientCacheEntryCustomEvent.class});
Expand Down Expand Up @@ -167,8 +166,7 @@ public Transport findTransport(byte[] listenerId) {
}

private Map<Class<? extends Annotation>, List<ClientListenerInvocation>> findMethods(Object listener) {
Map<Class<? extends Annotation>, List<ClientListenerInvocation>> listenerMethodMap =
new HashMap<Class<? extends Annotation>, List<ClientListenerInvocation>>(4, 0.99f);
Map<Class<? extends Annotation>, List<ClientListenerInvocation>> listenerMethodMap = new HashMap<>(4, 0.99f);

for (Method m : listener.getClass().getMethods()) {
// loop through all valid method annotations
Expand All @@ -181,7 +179,7 @@ private Map<Class<? extends Annotation>, List<ClientListenerInvocation>> findMet
ClientListenerInvocation invocation = new ClientListenerInvocation(listener, m);
List<ClientListenerInvocation> invocables = listenerMethodMap.get(annotationType);
if (invocables == null) {
invocables = new ArrayList<ClientListenerInvocation>();
invocables = new ArrayList<>();
listenerMethodMap.put(annotationType, invocables);
}

Expand Down
Expand Up @@ -34,7 +34,7 @@ public final class ContinuousQueryImpl<K, V> implements ContinuousQuery<K, V> {

private final SerializationContext serializationContext;

private final List<ClientEntryListener> listeners = new ArrayList<ClientEntryListener>();
private final List<ClientEntryListener> listeners = new ArrayList<>();

public ContinuousQueryImpl(RemoteCache<K, V> cache) {
if (cache == null) {
Expand Down Expand Up @@ -70,7 +70,7 @@ public void removeContinuousQueryListener(ContinuousQueryListener<K, ?> listener
}

public List<ContinuousQueryListener<K, ?>> getListeners() {
List<ContinuousQueryListener<K, ?>> queryListeners = new ArrayList<ContinuousQueryListener<K, ?>>(listeners.size());
List<ContinuousQueryListener<K, ?>> queryListeners = new ArrayList<>(listeners.size());
for (ClientEntryListener l : listeners) {
queryListeners.add(l.listener);
}
Expand Down
Expand Up @@ -62,7 +62,7 @@ public ContinuousQueryResult readFrom(ProtoStreamReader reader) throws IOExcepti
boolean isJoining = reader.readBoolean("isJoining");
byte[] key = reader.readBytes("key");
byte[] value = reader.readBytes("value");
List<WrappedMessage> projection = reader.readCollection("projection", new ArrayList<WrappedMessage>(), WrappedMessage.class);
List<WrappedMessage> projection = reader.readCollection("projection", new ArrayList<>(), WrappedMessage.class);
Object[] p = null;
if (!projection.isEmpty()) {
p = new Object[projection.size()];
Expand Down
Expand Up @@ -56,8 +56,8 @@ public static final class Marshaller implements MessageMarshaller<FilterResult>
@Override
public FilterResult readFrom(ProtoStreamReader reader) throws IOException {
byte[] instance = reader.readBytes("instance");
List<WrappedMessage> projection = reader.readCollection("projection", new ArrayList<WrappedMessage>(), WrappedMessage.class);
List<WrappedMessage> sortProjection = reader.readCollection("sortProjection", new ArrayList<WrappedMessage>(), WrappedMessage.class);
List<WrappedMessage> projection = reader.readCollection("projection", new ArrayList<>(), WrappedMessage.class);
List<WrappedMessage> sortProjection = reader.readCollection("sortProjection", new ArrayList<>(), WrappedMessage.class);

Object i = null;
if (instance != null) {
Expand Down
Expand Up @@ -33,6 +33,7 @@ public JPAProtobufCacheEventFilterConverter(JPAFilterAndConverter<Object, Object
}

@Inject
@SuppressWarnings("unused")
protected void injectDependencies(EmbeddedCacheManager cacheManager) {
serCtx = ProtobufMetadataManagerImpl.getSerializationContextInternal(cacheManager);
}
Expand Down
Expand Up @@ -34,6 +34,7 @@ public JPAProtobufFilterAndConverter(String jpaQuery, Map<String, Object> namedP
}

@Inject
@SuppressWarnings("unused")
protected void injectDependencies(Configuration cfg) {
usesValueWrapper = cfg.indexing().index().isEnabled() && !cfg.compatibility().enabled();
}
Expand Down

0 comments on commit cf129ab

Please sign in to comment.