Skip to content
This repository was archived by the owner on Feb 12, 2019. It is now read-only.

Commit bd1ba25

Browse files
committed
optmizes for each
1 parent 1e30898 commit bd1ba25

File tree

12 files changed

+19
-14
lines changed

12 files changed

+19
-14
lines changed

artemis-column/src/main/java/org/jnosql/artemis/column/query/AbstractColumnRepositoryAsyncProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private Object getJnosqlQuery(Method method, Object[] args) {
7676
getTemplate().query(value, consumer);
7777
} else {
7878
PreparedStatementAsync prepare = getTemplate().prepare(value);
79-
params.entrySet().stream().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
79+
params.entrySet().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
8080
prepare.getResultList(consumer);
8181
}
8282

artemis-column/src/main/java/org/jnosql/artemis/column/query/AbstractColumnRepositoryProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private Object getJnosqlQuery(Method method, Object[] args, Class<?> typeClass)
8282
entities = getTemplate().query(value);
8383
} else {
8484
PreparedStatement prepare = getTemplate().prepare(value);
85-
params.entrySet().stream().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
85+
params.entrySet().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
8686
entities = prepare.getResultList();
8787
}
8888
return ReturnTypeConverterUtil.returnObject(entities, typeClass, method);

artemis-column/src/main/java/org/jnosql/artemis/column/spi/ColumnFamilyProducerExtension.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import javax.enterprise.inject.spi.ProcessAnnotatedType;
3232
import javax.enterprise.inject.spi.ProcessProducer;
3333
import java.lang.reflect.Modifier;
34+
import java.util.Arrays;
3435
import java.util.Collection;
3536
import java.util.HashSet;
3637
import java.util.Set;
@@ -61,7 +62,7 @@ <T extends Repository> void onProcessAnnotatedType(@Observes final ProcessAnnota
6162
if (Repository.class.equals(javaClass)) {
6263
return;
6364
}
64-
if (Stream.of(javaClass.getInterfaces()).anyMatch(Repository.class::equals)
65+
if (Arrays.asList(javaClass.getInterfaces()).contains(Repository.class)
6566
&& Modifier.isInterface(javaClass.getModifiers())) {
6667
LOGGER.info("Adding a new Repository as discovered on Column: " + javaClass);
6768
crudTypes.add(javaClass);
@@ -73,7 +74,7 @@ <T extends RepositoryAsync> void onProcessAnnotatedTypeAsync(@Observes final Pro
7374
if (RepositoryAsync.class.equals(javaClass)) {
7475
return;
7576
}
76-
if (Stream.of(javaClass.getInterfaces()).anyMatch(RepositoryAsync.class::equals)
77+
if (Arrays.asList(javaClass.getInterfaces()).contains(RepositoryAsync.class)
7778
&& Modifier.isInterface(javaClass.getModifiers())) {
7879
LOGGER.info("Adding a new RepositoryAsync as discovered on Column: " + javaClass);
7980
crudAsyncTypes.add(javaClass);

artemis-core/src/main/java/org/jnosql/artemis/reflection/DefaultClassRepresentations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void init() {
5454

5555
classes.putAll(extension.getClasses());
5656
representations.putAll(extension.getRepresentations());
57-
representations.values().stream().forEach(r -> {
57+
representations.values().forEach(r -> {
5858
Class<?> entityClass = r.getClassInstance();
5959
findBySimpleName.put(entityClass.getSimpleName(), r);
6060
findByClassName.put(entityClass.getName(), r);

artemis-document/src/main/java/org/jnosql/artemis/document/query/AbstractDocumentRepositoryAsyncProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private Object getJnosqlQuery(Method method, Object[] args) {
100100
getTemplate().query(value, consumer);
101101
} else {
102102
PreparedStatementAsync prepare = getTemplate().prepare(value);
103-
params.entrySet().stream().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
103+
params.entrySet().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
104104
prepare.getResultList(consumer);
105105
}
106106

artemis-document/src/main/java/org/jnosql/artemis/document/query/AbstractDocumentRepositoryProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private Object getJnosqlQuery(Method method, Object[] args, Class<?> typeClass)
8080
entities = getTemplate().query(value);
8181
} else {
8282
PreparedStatement prepare = getTemplate().prepare(value);
83-
params.entrySet().stream().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
83+
params.entrySet().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
8484
entities = prepare.getResultList();
8585
}
8686
return ReturnTypeConverterUtil.returnObject(entities, typeClass, method);

artemis-document/src/main/java/org/jnosql/artemis/document/spi/DocumentCollectionProducerExtension.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import javax.enterprise.inject.spi.ProcessAnnotatedType;
3232
import javax.enterprise.inject.spi.ProcessProducer;
3333
import java.lang.reflect.Modifier;
34+
import java.util.Arrays;
3435
import java.util.Collection;
3536
import java.util.HashSet;
3637
import java.util.Set;
@@ -63,7 +64,7 @@ <T extends Repository> void onProcessAnnotatedType(@Observes final ProcessAnnota
6364
}
6465

6566

66-
if (Stream.of(javaClass.getInterfaces()).anyMatch(Repository.class::equals)
67+
if (Arrays.asList(javaClass.getInterfaces()).contains(Repository.class)
6768
&& Modifier.isInterface(javaClass.getModifiers())) {
6869
LOGGER.info("Adding a new Repository as discovered on document: " + javaClass);
6970
crudTypes.add(javaClass);
@@ -77,7 +78,7 @@ <T extends RepositoryAsync> void onProcessAnnotatedTypeAsync(@Observes final Pro
7778
return;
7879
}
7980

80-
if (Stream.of(javaClass.getInterfaces()).anyMatch(RepositoryAsync.class::equals)
81+
if (Arrays.asList(javaClass.getInterfaces()).contains(RepositoryAsync.class)
8182
&& Modifier.isInterface(javaClass.getModifiers())) {
8283
LOGGER.info("Adding a new RepositoryAsync as discovered on document: " + javaClass);
8384
crudAsyncTypes.add(javaClass);

artemis-graph/src/main/java/org/jnosql/artemis/graph/query/AbstractGraphRepositoryProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private Object getJnosqlQuery(Method method, Object[] args, Class<?> typeClass)
128128
entities = getTemplate().query(value);
129129
} else {
130130
PreparedStatement prepare = getTemplate().prepare(value);
131-
params.entrySet().stream().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
131+
params.entrySet().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
132132
entities = prepare.getResultList();
133133
}
134134
return ReturnTypeConverterUtil.returnObject(entities, typeClass, method);

artemis-graph/src/main/java/org/jnosql/artemis/graph/spi/GraphProducerExtension.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import javax.enterprise.inject.spi.ProcessAnnotatedType;
2828
import javax.enterprise.inject.spi.ProcessProducer;
2929
import java.lang.reflect.Modifier;
30+
import java.util.Arrays;
3031
import java.util.Collection;
3132
import java.util.HashSet;
3233
import java.util.Set;
@@ -53,7 +54,7 @@ <T extends Repository> void onProcessAnnotatedType(@Observes final ProcessAnnota
5354
if (Repository.class.equals(javaClass)) {
5455
return;
5556
}
56-
if (Stream.of(javaClass.getInterfaces()).anyMatch(Repository.class::equals)
57+
if (Arrays.asList(javaClass.getInterfaces()).contains(Repository.class)
5758
&& Modifier.isInterface(javaClass.getModifiers())) {
5859
LOGGER.info("Adding a new Repository as discovered on Graph: " + javaClass);
5960
crudTypes.add(javaClass);

artemis-key-value/src/main/java/org/jnosql/artemis/key/query/AbstractKeyValueRepositoryProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private Object executeQuery(Method method, Object[] args, String query) {
6262
entities = getTemplate().query(query, getEntityClass());
6363
} else {
6464
PreparedStatement prepare = getTemplate().prepare(query, getEntityClass());
65-
params.entrySet().stream().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
65+
params.entrySet().forEach(e -> prepare.bind(e.getKey(), e.getValue()));
6666
entities = prepare.getResultList();
6767
}
6868
return ReturnTypeConverterUtil.returnObject(entities, getEntityClass(), method);

0 commit comments

Comments
 (0)