java-13

How to set up a spring-boot application with java 13

感情迁移 提交于 2019-12-01 05:23:54
问题 I am creating a spring-boot application, which is running and performing well with openJdk12. The application: https://github.com/jactor-rises/jactor-persistence I am looking for how to set it up with openJdk13. I tried with spring-boot 2.1.8.RELEASE and 2.1.9.RELEASE , but both versions fails runtime with an IllegalStateException : java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext

What does the new keyword “yield” mean in Java 13?

谁说我不能喝 提交于 2019-11-29 14:00:11
问题 Java 13 introduced the yield keyword for switch expressions. How can I use it and what's the difference to a default return or break value? 回答1: Q&A How can I use it? With arrow labels when a full block is needed: int value = switch (greeting) { case "hi" -> { System.out.println("I am not just yielding!"); yield 1; } case "hello" -> { System.out.println("Me too."); yield 2; } default -> { System.out.println("OK"); yield -1; } }; With traditional blocks: int value = switch (greeting) { case