Martin Ahrer

Thinking outside the box

0001-01-01 1 min read

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

With JEP-400, now UTF-8 is the default charset of the standard Java APIs.

In JDK 17 and earlier, the default charset is determined when the Java runtime starts. On macOS, it is UTF-8 except in the POSIX C locale. On other operating systems, it depends upon the user’s locale and the default encoding, e.g., on Windows, it is a codepage-based charset such as windows-1252 or windows-31j.

Continue reading

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

Older posts Newer posts