Martin Ahrer

Thinking outside the box

0001-01-01 1 min read

With a snippet region defined we can include a fragment of compileable and tested code.

Snippet Include
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/eighteen/tooling/JavaDocSnippetTag.java[tag=snippetInclude]

With a snippet tag we can just inline code. There is no need to escape or use HTML.

Continue reading

0001-01-01 1 min read

The following describes selected improvements of the Java tooling. See the Java 18 release notes.

Java 18 is introducing the following tooling enhancements.

  • JEP 408 is adding the jwebserver tool that can serve static files and support the HEAD and GET methods. This is simplifying situations where a simple web server is needed for example for testing and eliminating the need for external dependencies. In case a more customized web server is required, we can use the implementations from the package com.sun.net.httpserver which constitutes the base for jwebserver.

  • JEP 413 is adding support to include Java code snippets either from external sources of inline snippets. Nicolai Parlog has a pretty decent summary of some of the features builtin. See https://nipafx.dev/inside-java-newscast-20/#code-in-javadoc

Continue reading

0001-01-01 1 min read
To Array
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/eleven/api/CollectionApi.java[tag=toArray]

0001-01-01 1 min read
Files.readString() and Files.writeString()
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/eleven/api/FilesApi.java[tag=writeStringAndReadString]

0001-01-01 1 min read

The following describes selected improvements of the Java API. See the Java 11 release notes.

Unresolved directive in <stdin> - include::CollectionApi.adoc[leveloffset=+1] Unresolved directive in <stdin> - include::FilesApi.adoc[leveloffset=+1] Unresolved directive in <stdin> - include::PredicateApi.adoc[leveloffset=+1] Unresolved directive in <stdin> - include::StringApi.adoc[leveloffset=+1]

0001-01-01 1 min read

Before Java 11 we had to use Predicate::negate and it was not possible to use a method reference. With Predicate::not we can use method references and Predicate::not reads more natural.

Not
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/eleven/api/PredicateApi.java[tag=not]
Older posts Newer posts