Github user eminency commented on a diff in the pull request:
https://github.com/apache/tajo/pull/944#discussion_r56448985
--- Diff:
tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/XMLCatalogSchemaManager.java
---
@@ -602,18 +597,10 @@ protected void copySchemaInfo(StoreObject
sourceStore) {
unorderedObjects.add(object);
}
}
-
- for (DatabaseObject object: orderedObjects) {
- if (object != null) {
- mergedObjects.add(object);
- }
- }
-
- for (DatabaseObject object: unorderedObjects) {
- if (object != null) {
- mergedObjects.add(object);
- }
- }
+
+ orderedObjects.stream().filter(object -> object !=
null).forEach(mergedObjects::add);
+
+ unorderedObjects.stream().filter(object -> object !=
null).forEach(mergedObjects::add);
--- End diff --
You can merge two statements into one like this:
```java
Stream.concat(orderedObjects.stream(), unorderedObjects.stream())
.filter(o -> o != null)
.forEach(mergedObjects::add);
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---