Skip to content

Commit

Permalink
auto-merge test
Browse files Browse the repository at this point in the history
  • Loading branch information
moueza committed Apr 14, 2021
1 parent d92536d commit 6b49f3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spring-autowired-npe/src/main/java/dao/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Main {
public static void main(String[] args) throws ClassNotFoundException, SQLException {
BookDAOimplJDBC bookDAOimpljdbc = new BookDAOimplJDBC();
bookDAOimpljdbc.scratchAdd3books();
a

Optional<List<Book>> listOptional = Optional.ofNullable(bookDAOimpljdbc.list());

/** isEmpty java 11 */
Expand All @@ -26,7 +26,7 @@ public static void main(String[] args) throws ClassNotFoundException, SQLExcepti
// listOptional.ifPresent(l -> System.out.println());
/*********** !!!!ifPresent != isPresent **********/
if (listOptional.isPresent()) {
System.out.println("lbl1 exists, size=" + listOptional.get().size());
System.out.println("lbl1 exists" + listOptional.get().size());
} else {
System.out.println("lbl2 null");
}
Expand Down

0 comments on commit 6b49f3d

Please sign in to comment.