Skip to content

Commit 562b9fc

Browse files
SeunMattmaibin
authored andcommitted
Updated extractJsonResult method (eugenp#2639)
* added updated example codes * updated example code StringToCharStream * deleted StringToCharStream.java locally * removed redundant file * added code for apache commons collection SetUtils * refactored example code * added example code for bytebuddy * added example code for PCollections * update pom * refactored tests for PCollections * spring security xml config * spring security xml config * remove redundant comment * example code for apache-shiro * updated example code for Vavr Collections * updated Vavr's Collection example * updated Vavr Collection file * updated example code for Apache Shiro * updated Vavr Collections example * added example code for N1QL * update example code for N1QL * added integration test for N1QL * update N1QL Example code * update the N1QL example Code
1 parent f7ab9fa commit 562b9fc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎couchbase-sdk/src/main/java/com/baeldung/couchbase/n1ql/CodeSnippets.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,27 @@
33
import com.couchbase.client.java.query.N1qlQueryResult;
44
import com.fasterxml.jackson.databind.JsonNode;
55
import com.fasterxml.jackson.databind.ObjectMapper;
6+
67
import java.io.IOException;
78
import java.util.List;
89
import java.util.Objects;
10+
import java.util.logging.Level;
11+
import java.util.logging.Logger;
912
import java.util.stream.Collectors;
1013

1114
public class CodeSnippets {
1215

1316
private static ObjectMapper objectMapper = new ObjectMapper();
1417

18+
private static final Logger logger = Logger.getLogger(CodeSnippets.class.getName());
19+
1520
public static List<JsonNode> extractJsonResult(N1qlQueryResult result) {
1621
return result.allRows().stream()
1722
.map(row -> {
1823
try {
1924
return objectMapper.readTree(row.value().toString());
2025
}catch (IOException e) {
21-
e.printStackTrace();
26+
logger.log(Level.WARNING, e.getLocalizedMessage());
2227
return null;
2328
}
2429
})

0 commit comments

Comments
 (0)