神刀安全网

Java Annotated Monthly – June 2016

Java: past, present and future – we’re still counting down to the release of Java 9, there are ever more resources for getting a handle on what Java 8 can offer us, and the Oracle vs Google court case is over (for now). The language is not the only thing that continues to evolve, well-used libraries like JUnit and Log4J are making the most of modern Java. But with all this change, we need to keep an eye on performance and correctness.

Java Annotated Monthly – June 2016

Java 9

Early Access build 121 is now available for JDK 9 and  JDK 9 with Jigsaw .  Check the documentation for using the early access builds. There’s also a matrix of open source projects that have been tested against JDK 9. And don’t forget, if you do run into any unexpected behaviour, you can  ask for help .

Although Jigsaw is the most talked about feature in Java 9, it’s nice to see it’s not the only thing we’re waiting for, there are several other interesting features .

Garbage collection is changing in Java 9, to get a heads-up on the new options, take a look at the new garbage collectors in OpenJDK .

Java 8

Everyone may be getting excited about Java 9, but with Java 8 maturing and seeing good adoption , there are plenty of resources out there for getting up to speed on new features like Optional , reading  pragmatic advice from those who’ve been using these features, or leveling up your Java 8 knowledge. For example, it’s worth getting to know CompletableFuture and looking at some examples to understand what you can achieve with asynchronous programming.

Even accepted standards that we’ve coded to for years can be dusted off and questioned .

Continuing Evolution

The eagerly awaited JUnit 5 is available in alpha . Take a first look at how this could change our unit tests.

Log4j 2.6 is out, with a number of configuration options to let it run in a garbage free fashion . This, combined with its support for Java 8 lambdas, can help reduce your logging framework’s impact on performance.

Twitter released a Pants build tool . I’m fairly certain that it’s not actually pants though, it’s probably rather good.

Performance and Correctness

Java 8 came with performance improvements for HashMap . To understanding why this is, have a look at how HashMaps work in Java 7 and 8 .

One of the main culprits for adding unnecessary processing to our applications is the way we create Strings. Benchmarking shows how the approach we take impacts performance .

And remember, getting the best performance out of your application depends upon what “best performance” means for you .

Good testing practices, such as TDD , aren’t just applicable to plain vanilla Java. Find out more about testing Java EE (and did you know how Java EE standards are tested ?), and what are some of the challenges when testing in Android .

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Java Annotated Monthly – June 2016

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址