# Stephen Colebourne

Thoughts and Musings on the world of Java and beyond

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Embedded records - extracting data from classes

DevFeed: [Embedded records - extracting data from classes](<https://devfeed.tech/articles/embedded-records-extracting-data-from-classes-22014.md>)

Original publisher: [Read original article](<http://blog.joda.org/2025/11/embedded-records.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2025-11-05T06:30:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Data serialization](<https://devfeed.tech/topics/data-serialization.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [2025](<https://devfeed.tech/tags/2025.md>), [belgium](<https://devfeed.tech/tags/belgium.md>), [capture](<https://devfeed.tech/tags/capture.md>), [classes](<https://devfeed.tech/tags/classes.md>), [data](<https://devfeed.tech/tags/data.md>), [embedded](<https://devfeed.tech/tags/embedded.md>), [java](<https://devfeed.tech/tags/java.md>), [javaideas](<https://devfeed.tech/tags/javaideas.md>), [records](<https://devfeed.tech/tags/records.md>), [serialization](<https://devfeed.tech/tags/serialization.md>)

### AI overview

Embedded records are proposed as a way to bring record-like support for capturing data to Java classes that cannot be converted to records. The idea addresses a perceived gap between records and classes that still represent data, with Serialization 2.0 cited as added context. The excerpt points to a separate proposal for details, which are not included here.

### Source excerpt

At Devoxx Belgium 2025 I discussed the idea of embedded records with a few people. The idea is to take what is great about records, and extend that to classes that represent data. This responds to a pain point in Java, where there is a bit of a cliff-edge between records and classes. While millions of classes could and should be converted to records, millions more cannot. Yet they still represent data, and it would be a Good Thing to be able to capture that. Especially with Serialization 2.0 on the horizon. Please see the proposal document for more details.

## Type conversion in Java - an alternative proposal for primitive type patterns

DevFeed: [Type conversion in Java - an alternative proposal for primitive type patterns](<https://devfeed.tech/articles/type-conversion-in-java-an-alternative-proposal-for-primitive-type-patterns-22013.md>)

Original publisher: [Read original article](<http://blog.joda.org/2025/10/type-conversion-in-java-alternative.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2025-10-15T06:09:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [openjdk](<https://devfeed.tech/topics/openjdk.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [subtype](<https://devfeed.tech/topics/subtype.md>)

Tags: [conversion](<https://devfeed.tech/tags/conversion.md>), [java](<https://devfeed.tech/tags/java.md>), [javaideas](<https://devfeed.tech/tags/javaideas.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [patterns](<https://devfeed.tech/tags/patterns.md>)

### AI overview

The author proposes separate syntax for primitive type conversion, arguing it makes conversion checks distinct from subtype checks. A `~` cast, such as `(~int) val`, would convert a `long` to `int` and throw `TypeConversionException` if the conversion is lossy, unlike the ordinary cast, which can silently truncate. A related `~int` switch pattern would match values convertible to `int`; the author says type patterns would continue to check subtype relationships, while conversion patterns check point-to-point conversions for primitive or value types. The excerpt presents this as an alternative to primitive type patterns in JEP 507 and asks readers to review the full proposal.

### Source excerpt

A lot of good work has been done by the core Java team on patterns, providing new ways to explore data. The latest extension, in JEP 507, is the idea that primitive type patterns should be supported. Today I'm publishing an alternative approach. Primitive Types in Patterns, instanceof, and switch The current proposal is as follows: long val = createLong(); int i = (int) val; // cast long to int, potentially silently losing information switch (val) { case int j -> IO.println("Long fits in an int"); case long v -> IO.println("Long does not fit in an int"); }; I like the idea of being able to tell if a long value fits into an int without loss. But I hate the syntax. The key problem is that type patterns check the supertype/subtype relationship, and int is not a subtype of long. The result is code that doesn't seem to make sense. The official explanation is based on the notion that develoeprs use instanceof String before a cast to String all the time. Thus a parallel can be drawn to have an instanceof int before a cast to int. Effectively the aim is to extend the meaning of type patterns to cover primitive type casts, which are type conversions, not type checks. I know I am not alone in finding this argument weak, and in finding the proposed syntax highly confusing. But it took a while, and an 8 page document, to figure out exactly why. Type conversion in Java In response to the JEP and subsequent discussions, I have written up a detailed proposal for type conversion casts and type conversion patterns. These allow developers to more clearly express the difference between type checks (that check the supertype/subtype relationship) and type conversions (where primitive types are changed to a different type). The big idea is to introduce a new kind of cast, the type conversion cast that operates like a standard primitive type cast, but throws an exception when the conversion would be lossy. long val = createLong(); int i = (int) val; // cast long to int, potentially losing

## Pattern match Optional in Java 21

DevFeed: [Pattern match Optional in Java 21](<https://devfeed.tech/articles/pattern-match-optional-in-java-21-22012.md>)

Original publisher: [Read original article](<http://blog.joda.org/2024/02/pattern-match-optional-in-java-21.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2024-02-20T09:19:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [java](<https://devfeed.tech/tags/java.md>), [java21](<https://devfeed.tech/tags/java21.md>), [null](<https://devfeed.tech/tags/null.md>), [optional](<https://devfeed.tech/tags/optional.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>)

### AI overview

This article presents a rarely useful technique for pattern matching an Optional in Java 21 by converting its value with orElse(null) and testing it with instanceof. It discusses functional Optional methods, an iterable helper, limitations in Java 17, and a possible use in long if-else chains.

### Source excerpt

I'm going to describe a trick to get pattern patching on Optional in Java 21, but one you'll probably never actually use. Using Optional As of Java 21, Pattern matching in Java allows us to check a value against a type like an instanceof with a new variable being declared of the correct type. Pattern matching can handle simple types and the deconstruction of records. But pattern matching of arbitrary classes like Optional is not yet supported. (Work to support pattern match methods is ongoing). In normal code, the best way to use Optional is with one of the functional methods: var addressOpt = findAddress(personId); var addressStr = addressOpt .map(address -> address.format()) .orElse("No address available"); This works well in most cases. But sometimes you want to use the Optional with a return statement. This results in code using get() like this: var addressOpt = findAddress(personId); if (addressOpt.isPresent()) { // early return if address found return addressOpt.get().format(); } // lots of other code to handle case when address not found One way to improve this is to write a simple method: /** * Converts an optional to an iterable for use in the for-each statement. * * @param &ltlT> the type of optional element * @param optional the optional * @return an iterable representation of the optional */ public static &ltlT> Iterable&ltlT> inOptional(Optional&ltlT> optional) { return optional.isPresent() ? List.of(optional.get()): List.of(); } Which allows the following neat form: for (var address : inOptional(findAddress(personId))) { // early return if address found return address.format(); } // lots of other code to handle case when address not found This is a great approach providing that you don't need an else branch. Using Optional with Pattern matching With Java 21 and pattern matching we have a new way to do this! if (findAddress(personId).orElse(null) instanceof Address address) { // early return if address found return address.format(); } else { // lots of

## Java on-ramp - Fully defined Entrypoints

DevFeed: [Java on-ramp - Fully defined Entrypoints](<https://devfeed.tech/articles/java-on-ramp-fully-defined-entrypoints-22011.md>)

Original publisher: [Read original article](<http://blog.joda.org/2022/10/fully-defined-entrypoints.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2022-10-06T11:18:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [openjdk](<https://devfeed.tech/topics/openjdk.md>), [Boilerplate](<https://devfeed.tech/topics/boilerplate.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [access-control](<https://devfeed.tech/tags/access-control.md>), [arrays](<https://devfeed.tech/tags/arrays.md>), [call](<https://devfeed.tech/tags/call.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [easier](<https://devfeed.tech/tags/easier.md>), [enum](<https://devfeed.tech/tags/enum.md>), [field](<https://devfeed.tech/tags/field.md>), [fields](<https://devfeed.tech/tags/fields.md>), [getting-started](<https://devfeed.tech/tags/getting-started.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [java](<https://devfeed.tech/tags/java.md>), [javaideas](<https://devfeed.tech/tags/javaideas.md>), [launch](<https://devfeed.tech/tags/launch.md>), [newcomers](<https://devfeed.tech/tags/newcomers.md>), [program](<https://devfeed.tech/tags/program.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [source-code](<https://devfeed.tech/tags/source-code.md>)

### AI overview

The proposal introduces `entrypoint` as a new Java declaration for program launch code, intended to make beginner examples less ceremonial while separating launch logic from ordinary classes. A minimal entrypoint uses top-level code and `SystemOut`; instructors can progressively add private methods, parameters, return types, and blocks. Entrypoints would have no fields or access control, with ordinary classes used when those features are needed. The author proposes compiling them to final classes implementing `java.lang.Entrypoint`; the JVM would invoke that interface when present, otherwise fall back to legacy `public static void main(String[])`. Because the interface could also be implemented by frameworks, the proposal aims to support custom lifecycle management. These are proposed design ideas in the excerpt, not established Java behavior.

### Source excerpt

How do you start a Java program? With a main method of course. But the ceremony around writing such a method is perhaps not the nicest for newcomers to Java. There has been a bit of dicussion recently about how the "on-ramp" for Java could be made easier. This is the original proposal. Here are follow ups - OpenJDK, Reddit, Hacker news. Starting point This is the classic Java Hello Word: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } } Lots of stuff going on - public, class, a class name, void, arrays, a method, method call. And one of the weirdest things in Java - System.out - a public static field in lower case. Something that is pretty much never seen in normal Java code. (I still remember System.out.println being the most confusing part about getting started in Java 1.0 - why are there two dots and why isn't it out()?) The official proposal continues to discuss: A more tolerant launch protocol Unnamed classes Predefined static imports for the most critical methods and fields The ensuing discussion resulted in various suggestions. Having taken some time to reflect on the proposal and discussion, here is my contribution, which is that what is really needed is something more comprehensive. Entrypoints When a Java program starts some kind of class file needs to be run. It could be a normal class, but that isn't ideal as we don't really want static/instance variables, subclasses, parent interfaces, access control etc. One suggestion was for it to be a normal interface, but that isn't ideal as we don't want to mark the methods as default or allow abstract methods. I'd like to propose that what Java needs is a new kind of class declaration for entrypoints. I don't think this is overly radical. We already have two alternate class declarations - record and enum. They have alternate syntax that compiles to a class file without being explictly a class in source code. What we need here is a new kind - entrypoint - tha

## Proposed Europe/Oslo timezone alias change could discard pre-1970 data and break Joda-Time behavior

DevFeed: [Proposed Europe/Oslo timezone alias change could discard pre-1970 data and break Joda-Time behavior](<https://devfeed.tech/articles/big-problems-at-the-timezone-database-22010.md>)

Original publisher: [Read original article](<http://blog.joda.org/2021/09/big-problems-at-timezone-database.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2021-09-25T00:55:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [DateTime](<https://devfeed.tech/topics/datetime.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [systems](<https://devfeed.tech/topics/systems.md>), [Operating system](<https://devfeed.tech/topics/operating-system.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [joda](<https://devfeed.tech/tags/joda.md>), [operating-systems](<https://devfeed.tech/tags/operating-systems.md>), [smartphones](<https://devfeed.tech/tags/smartphones.md>), [systems](<https://devfeed.tech/tags/systems.md>), [timezone](<https://devfeed.tech/tags/timezone.md>)

### AI overview

The article criticizes a proposed change to the IANA timezone database that would make Europe/Oslo an alias of Europe/Berlin because their post-1970 data matches. It argues that this could replace researched pre-1970 Oslo data with Berlin data and cause Joda-Time tests and timezone identifier handling to fail.

### Source excerpt

The last time I wrote about the timezone database on this blog, the database was under threat from a lawsuit. Fortunately that lawsuit went away relatively quickly as the company involved got the message that their action was a big mistake. Unfortunately this time the mess is internal. Paul Eggert is the project lead of the timezone database hosted at IANA, a position referred to as the TZ Coordinator. He is an expert in the field, having been involved in documenting timezone data for decades. Unfortunately, he is currently ignoring all objections to an action only he seems intent on making to solve an invented problem that only he sees as important. The database is the world's principle source of timezone information. The data is included in everything from operating systems to smartphones to programming language development kits such as the JDK. While you may never have heard of it, the sheer pervasiveness of the data makes the potential impact of change or damage pretty huge. The timezone database contains information about how clocks have varies in each region around the world. The mandate of the project is to record this information from 1970 onwards. Of course, computers being what they are, a function that returns the timezone for a given date can be passed in a pre-1970 date as well as a post-1970 one. For this, and reasons of completeness, the timezone database contains pre-1970 data as well as post-1970 data. If you go to your JDK or operating system and ask for the timezone offset for 1920-01-01 for the ID "Europe/Oslo" or "Europe/Berlin" you will get an answer: DateTimeZone oslo = DateTimeZone.forID("Europe/Oslo"); System.out.println(oslo.getOffset(new DateTime(1948, 6, 1, 12, 0))); //prints 3600000 DateTimeZone berlin = DateTimeZone.forID("Europe/Berlin"); System.out.println(berlin.getOffset(new DateTime(1948, 6, 1, 12, 0))); //prints 7200000 The proposed change is to downgrade "Europe/Oslo" to be merely an alias for "Europe/Berlin". The rationale is th

## Java switch - 4 wrongs don't make a right

DevFeed: [Java switch - 4 wrongs don't make a right](<https://devfeed.tech/articles/java-switch-4-wrongs-don-t-make-a-right-22009.md>)

Original publisher: [Read original article](<http://blog.joda.org/2019/11/java-switch-4-wrongs-dont-make-right.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2019-11-04T20:32:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [conditionals](<https://devfeed.tech/topics/conditionals.md>), [enum](<https://devfeed.tech/topics/enum.md>), [if statement](<https://devfeed.tech/topics/if-statement.md>)

Tags: [complex](<https://devfeed.tech/tags/complex.md>), [design](<https://devfeed.tech/tags/design.md>), [expression](<https://devfeed.tech/tags/expression.md>), [fall](<https://devfeed.tech/tags/fall.md>), [java](<https://devfeed.tech/tags/java.md>), [project](<https://devfeed.tech/tags/project.md>), [project-amber](<https://devfeed.tech/tags/project-amber.md>), [return](<https://devfeed.tech/tags/return.md>), [switch](<https://devfeed.tech/tags/switch.md>)

### AI overview

The author argues that Java's planned switch upgrade adds complexity around the useful arrow-form switch expression. The classic switch can fall through when `break` is omitted, shares one variable scope across cases, and does not require `default`. The proposal adds four forms: classic and arrow syntax, each as a statement or expression. Arrow forms avoid fall-through; expressions must be exhaustive, while statement forms need not be. The author sees the classic-syntax expression as preserving fall-through risks and the arrow statement as allowing silent omissions, and questions whether orthogonality justifies both. They favor keeping only the arrow expression, allowing it to serve as a statement expression, and introducing `match` as its keyword. The excerpt also notes that switch expressions cannot return early or continue/break a loop.

### Source excerpt

The switch statement in Java is being changed. But is it an upgrade or a mess? Classic switch The classic switch statement in Java isn't great. Unlike many other parts of Java, it wasn't properly rethought when pulling features across from C all those years ago. The key flaw is "fall-through-by-default". This means that if you forget to put a break clause in each case, processing will continue on to the next case clause. Another flaw is that variables are scoped to the entire switch, thus you cannot reuse a variable name in two different case clauses. In addition, default clause is not required, which leaves readers of the code unclear as to whether a clause was forgotten or not. And of course there is also the key limitation - that the type to be switched on can only be an integer, enum or string. String instruction; switch (trafficLight) { case RED: instruction = "Stop"; case YELLOW: instruction = "Prepare"; break; case GREEN: instruction = "Go"; break; } System.out.println(instruction); The code above does not compile because there is no default clause, leaving instruction undefined. But even if it did compile, it would never print "Stop" due to the missing break. In my own coding, I prefer to always put a switch at the end of a method, with each clause containing a return to reduce the risks of switch. Upgraded switch As part of Project Amber, switch is being upgraded. But sadly, I'm unconvinced as to the merits of the new design. To be clear, there are some good aspects, but overall I think the solution is overly complex and with some unpleasant syntax choices. The key aim is to add an expression form, where you can assign the result of the switch to a variable. This is rather like the ternary operator (eg. x != null ? x : ""), which is the expression equivalent of an if statement. An expression form would reduce problems like the undefined variable above, because it makes it more obvious that each branch must result in a variable. The current plan is to add no

## User-defined literals in Java?

DevFeed: [User-defined literals in Java?](<https://devfeed.tech/articles/user-defined-literals-in-java-22008.md>)

Original publisher: [Read original article](<http://blog.joda.org/2019/03/user-defined-literals-in-java.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2019-03-22T11:39:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [data type](<https://devfeed.tech/topics/data-type.md>)

Tags: [2019](<https://devfeed.tech/tags/2019.md>), [class](<https://devfeed.tech/tags/class.md>), [compile](<https://devfeed.tech/tags/compile.md>), [data-types](<https://devfeed.tech/tags/data-types.md>), [examples](<https://devfeed.tech/tags/examples.md>), [features](<https://devfeed.tech/tags/features.md>), [files](<https://devfeed.tech/tags/files.md>), [https](<https://devfeed.tech/tags/https.md>), [inference](<https://devfeed.tech/tags/inference.md>), [java](<https://devfeed.tech/tags/java.md>), [literals](<https://devfeed.tech/tags/literals.md>), [localdate](<https://devfeed.tech/tags/localdate.md>), [pattern](<https://devfeed.tech/tags/pattern.md>), [processing](<https://devfeed.tech/tags/processing.md>), [project-amber](<https://devfeed.tech/tags/project-amber.md>), [raw](<https://devfeed.tech/tags/raw.md>), [regex](<https://devfeed.tech/tags/regex.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [time](<https://devfeed.tech/tags/time.md>), [user](<https://devfeed.tech/tags/user.md>)

### AI overview

The excerpt proposes Java user-defined literals: a class could convert literal text into values such as currencies, dates, regex patterns, and URIs. The suggested design requires type inference (including with `var` and method parameters), access to raw text to avoid Java escaping, and compile-time parsing and validation--for example, rejecting an invalid date. Raw input has no escape mechanism, which the author considers acceptable for the constrained formats these literals usually use, while acknowledging edge cases. The implementation is left open, but would require a class factory invoked by the compiler; ideally, parsed results would be stored in the constant pool rather than reparsed at runtime. This is a proposal, not a description of an implemented Java feature.

### Source excerpt

Java has a number of literals for creating values, but wouldn't it be nice if we had more? Current literals These are some of the literals we can write in Java today: integer - 123, 12s, 1234L, 0xB8E817, 077, 0b1011_1010 floating point - 45.6f, 56.7d, 7.656e6 string - "Hello world" char - 'a' boolean - true, false null - null Project Amber is also considering adding multi-line and/or raw string literals. But there are many other data types that would benefit from literals, such as dates, regex and URIs. User-defined literals In my ideal future, I'd like to see Java extended to support some form of user-defined literals. This would allow the author of a class to provide a mechanism to convert a sequence of characters into an instance of that class. It may be clearer to see some examples using one possible syntax (using backticks): Currency currency = `GBP`; LocalDate date = `2019-03-29`; Pattern pattern = `strata\.\w+`; URI uri = `https://blog.joda.org/`; A number of semantic features would be required: Type inference Raw processing Validated at compile-time Type inference Type inference is of course a key aspect of literals. It would have to work in a similar way to the existing literals, but with a tweak to handle the new var keyword. ie. these two would be equivalent: LocalDate date = `2019-03-29`; var date = LocalDate`2019-03-29`; The type inference would also work with methods (compile error if ambiguous): boolean inferior = isShortMonth(`2019-04-12`); public boolean isShortMonth(LocalDate date) { return date.lengthOfMonth() < 31; } Raw processing Processing of the literal should not be limited by Java's escape mechanisms. User-defined literals need access to the raw string. Note that this is especially useful for regex, but would also be useful for files on Windows: // user-defined literals var pattern = Pattern`strata\.\w+`; // today var pattern = Pattern.compile("strata\\.\\w+"); Today, the `\` needs to be escaped, making the regex difficult to read. Clearly,

## Commercial support for Joda and ThreeTen projects

DevFeed: [Commercial support for Joda and ThreeTen projects](<https://devfeed.tech/articles/commercial-support-for-joda-and-threeten-projects-22007.md>)

Original publisher: [Read original article](<http://blog.joda.org/2019/01/commercial-support-joda-threeten.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2019-01-09T12:23:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Open Source](<https://devfeed.tech/topics/open-source.md>), [open source maintenance](<https://devfeed.tech/topics/open-source-maintenance.md>), [Maintainers](<https://devfeed.tech/topics/maintainers.md>)

Tags: [joda](<https://devfeed.tech/tags/joda.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [subscription](<https://devfeed.tech/tags/subscription.md>), [support](<https://devfeed.tech/tags/support.md>), [threeten](<https://devfeed.tech/tags/threeten.md>)

### AI overview

The author offers commercial support for Joda-Time, Joda-Money, Joda-Beans, Joda-Convert, Joda-Collect, ThreeTen-Extra and ThreeTen-backport through Tidelift. Companies pay a monthly subscription for their open-source usage, with some proceeds going to project maintainers. In return, maintainers are expected to keep projects maintained, follow responsible security disclosure and check licensing. Tidelift does not control project roadmaps, and the arrangement does not require maintainers to provide a helpdesk or consulting. The author presents this as a way for companies to support small projects where direct gifts or conventional support contracts may be impractical, while stating that the projects remain free under permissive licences.

### Source excerpt

The Java ecosystem is made up of many individuals, organisations and companies producing many different libraries. Some of the largest projects have long had support options where users of the project, typically corporates, can pay for an enhanced warranty, guaranteed approach to bug fixes and more. Small projects, run by a single individual or a team, have been unable to offer this service, even if they wanted to. In addition, there is a more subtle problem. The amount a small project could charge is too low for a corporate to pay. This sounds odd, but was brought home to me by this thread on twitter: As the thread indicates, it is basically impossible for a corporate to gift money to a small project, and it is not viable for small projects to meaningfully offer a support contract. The problem is that not paying the maintainers has negative consequences. Take the recent case where a developer handed his open source project on to another person, who then used it to steal bitcoins. Pay the maintainers I believe there is now a solution to the problem. Tidelift. Tidelift offers companies a monthly subscription to support their open source usage. And they pay some of that income directly to the maintainers of the projects that the company uses. Maintainers are expected to continue maintaining the project, follow a responsible disclosure process for security issues and check their licensing. Tidelift does not get to control the project roadmap, and maintainers do not have to provide an active helpdesk or consulting. See here for more details. As such, I'm now offering commercial support for Joda-Time, Joda-Money, Joda-Beans, Joda-Convert, Joda-Collect, ThreeTen-Extra, ThreeTen-backport via the Tidelift subscription. This is an extra option for those that want to support the maintainers of open source but haven't been able to find a way to do so until now. The Joda and ThreeTen projects will always be free and available under a permissive licence, so there is no need to w

## Should you adopt Java 12 or stick on Java 11?

DevFeed: [Should you adopt Java 12 or stick on Java 11?](<https://devfeed.tech/articles/should-you-adopt-java-12-or-stick-on-java-11-22006.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/10/adopt-java-12-or-stick-on-11.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-10-31T07:02:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [openjdk](<https://devfeed.tech/topics/openjdk.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Spring Framework](<https://devfeed.tech/topics/spring-framework.md>)

Tags: [amazon-aws](<https://devfeed.tech/tags/amazon-aws.md>), [api](<https://devfeed.tech/tags/api.md>), [bug-fixes](<https://devfeed.tech/tags/bug-fixes.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [lts](<https://devfeed.tech/tags/lts.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [production](<https://devfeed.tech/tags/production.md>), [releases](<https://devfeed.tech/tags/releases.md>), [risks](<https://devfeed.tech/tags/risks.md>), [security](<https://devfeed.tech/tags/security.md>), [security-patches](<https://devfeed.tech/tags/security-patches.md>), [train](<https://devfeed.tech/tags/train.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>)

### AI overview

Java 12 adoption requires readiness to upgrade continuously: the excerpt says each six-month release receives only about six months of security patches and becomes obsolete after seven months, leaving roughly one month to test and deploy the next version. Moving through Java 12-17 may disrupt code through bytecode, specification and API changes; the author argues this risk is greater than routine Java 8 updates. Teams should check whether development resources, IDEs, build and analysis tools, dependencies, frameworks, CI and hosting can keep pace. AWS Lambda is cited as a blocker because it had not adopted Java 9, 10 or 11 at the time described; Spring and Liferay are cited as focusing official support or certification on LTS releases. Skipping interim releases until Java 17 may miss deprecations before APIs are removed. The author recommends inventorying current and likely dependencies and weighing new features or possible performance gains against upgrade risk. The excerpt presents a Java 12 development/production-on-later-releases middle ground, but says it still carries compatibility uncertainty.

### Source excerpt

Should you adopt Java 12 or stick on Java 11 for the next 3 years? Seems like an innocuous question, but it is one of the most important decisions out there for those running on the JVM. I'll try to cover the key aspects of the decision, with the assumption that you care about running with the latest set of security patches in production. TL;DR, It is vital to fully understand and accept the risks before adopting Java 12. The Java release train There is now a new release of Java every six months, so Java 12 is less than five months away despite Java 11 having just been released. As part of the process of moving to more frequent releases, certain releases are designated to be LTS (long term support) and as such will have security patches available for four years or more. This makes them "major" releases, not because they have a bigger feature set but because they have multi year support. It is expected that Java 11 patches (11.0.1, 11.0.2, 11.0.3, etc.) will be smaller and simpler than Java 8 updates (8u20, 8u40, 8u60, etc.) - Java 11 updates will be more focused on security patches, without the internal enhancements of Java 8 updates. Instead, Oracle want us to think of Java 12, 13, 14 etc. as small upgrades, similar to an imaginary Java 11u20, 11u40 etc. To be blunt, I find this nonsensical. Senior Oracle employees have repeatedly argued that updates such as 8u20 and 8u40 often broke code. This was not my experience. In fact my experience was that update releases primarily contained bug fixes. The only break I can remember was the addition of --allow-script-in-comments to Javadoc, which isn't a core part of Java. As a result, I have never feared picking up the latest update release - and this has been a core benefit of the Java platform. Drilling down into why update releases tend to cause no problems, lets examine the differences between release types: Model Old model New model Upgrade Java major releases Java update releases Java release train Java patches Freque

## Oracle's Java 11 trap - Use OpenJDK instead!

DevFeed: [Oracle's Java 11 trap - Use OpenJDK instead!](<https://devfeed.tech/articles/oracle-s-java-11-trap-use-openjdk-instead-22002.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/09/do-not-fall-into-oracles-java-11-trap.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-09-26T10:57:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [openjdk](<https://devfeed.tech/topics/openjdk.md>), [.NET](<https://devfeed.tech/topics/net.md>)

Tags: [2018](<https://devfeed.tech/tags/2018.md>), [adoptium](<https://devfeed.tech/tags/adoptium.md>), [download](<https://devfeed.tech/tags/download.md>), [java](<https://devfeed.tech/tags/java.md>), [license](<https://devfeed.tech/tags/license.md>), [lts](<https://devfeed.tech/tags/lts.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [oracle](<https://devfeed.tech/tags/oracle.md>)

### AI overview

The article warns that Oracle JDK 11 is subject to commercial-use restrictions, while OpenJDK builds remain available for commercial use under the GPL with the Classpath exception. It recommends choosing an OpenJDK build: Adoptium (formerly AdoptOpenJDK) is described as vendor-neutral and intended to receive four or more years of security patches; Oracle's OpenJDK build is free but has six months of security patches, after which Oracle intends users to upgrade to Java 12. The article notes other builds, including package-manager options, and advises against using Oracle JDK in production unless you intend to pay for it.

### Source excerpt

TL:DR; Java is still available at zero-cost, you just need to stop using Oracle JDK and start using an OpenJDK build, such as this one or this one. The trap Java 11 has been released. It is a major release because it has long-term support (LTS). But Oracle have also set it up to be a trap (either deliberately or accidentally). For 23 years, developers have downloaded the JDK from Oracle and used it for $free. Type "JDK" into your favourite search engine, and the top link will be to an Oracle Java SE download page (I'm deliberately not providing a link). But that search and that link is now a trap. Oracle JDK, the one all web searches take you to, is now commercial not $free. The key part of the terms is as follows: You may not: use the Programs for any data processing or any commercial, production, or internal business purposes other than developing, testing, prototyping, and demonstrating your Application; The trap is as follows: Download Oracle JDK (because that is what you've always done, and it is what the web-search tells you) Use it in production (because you didn't realise the license changed) Get a nasty phone call from Oracle's license enforcement teams demanding lots of money In other words, Oracle can rely on inertia from Java developers to cause them to download the wrong (commercial) release of Java. Unless you read the text/warnings/legalese very carefully you might not even realise Oracle JDK is now commercial, and that you are therefore liable to pay Oracle for using this particular JDK in production. (Update, 2018-10-03: Searches for Java 11 and JDK 11 now seem to be resolving to OpenJDK builds, not commercial ones!) Is this trap malicious behaviour on the part of Oracle? Readers will have their own opinions. I do suggest bearing in mind that Oracle invests huge amounts in developing Java, so it is reasonable to have a commercial plan available for those that want it. And they do provide a $free alternative completely valid for commercial use... The

## Java release chains - Splitting features from security

DevFeed: [Java release chains - Splitting features from security](<https://devfeed.tech/articles/java-release-chains-splitting-features-from-security-22004.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/09/java-release-chains-features-and-security.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-09-20T10:10:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [openjdk](<https://devfeed.tech/topics/openjdk.md>), [Security](<https://devfeed.tech/topics/security.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [adopting](<https://devfeed.tech/tags/adopting.md>), [database](<https://devfeed.tech/tags/database.md>), [deprecations](<https://devfeed.tech/tags/deprecations.md>), [feature](<https://devfeed.tech/tags/feature.md>), [features](<https://devfeed.tech/tags/features.md>), [ibm](<https://devfeed.tech/tags/ibm.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [java-se](<https://devfeed.tech/tags/java-se.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [language](<https://devfeed.tech/tags/language.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [patch](<https://devfeed.tech/tags/patch.md>), [release](<https://devfeed.tech/tags/release.md>), [security](<https://devfeed.tech/tags/security.md>), [security-patch](<https://devfeed.tech/tags/security-patch.md>), [split](<https://devfeed.tech/tags/split.md>), [train](<https://devfeed.tech/tags/train.md>)

### AI overview

From Java 9 onward, six-month feature releases can include changes to the JVM, libraries, and language and each has a new Java SE specification; security updates arrive between them. This differs from Java 8, where feature updates were limited to changes that did not affect the Java SE specification, and security patches followed a separate quarterly cadence. The article describes two post-Java-9 paths: the release train combines new features and security fixes, while an LTS chain continues security updates for an LTS version. It says Oracle focused its free efforts on the release train and that OpenJDK was expected to maintain the longer LTS patch chain after 11.0.2. The author argues Java 11 is significant because it has LTS, which many large organizations may prefer for support or to manage churn; the excerpt cautions that non-LTS releases are not thereby less tested or unsuitable for general use. Choosing a chain therefore depends on whether adopting frequent features or staying on an LTS security-patch line better fits the user.

### Source excerpt

There is now a Java release every 6 months - March and September. It started with Java 9 and we're about to get Java 11. But should you jump on the release train? To answer that, we need to look at how Java's release chains are being split. Looking back at Java 8 In the olden days life was simple. There was a "major" Java release every few years and it contained lots of new features, for example Java 5, 6, 7 and 8. Each major release included new JDK methods, new JDK classes, deprecations, new JVM features and new language features. However, life wasn't actually as simple as it seemed. Looking at Java 8, once it was released there was a regular frequency of "update" releases. The most well-known of these were 8u20, 8u40 and 8u60. But there were also many others - 8u5, 8u11, 8u25, 8u31, 8u45, 8u51, 8u65, 8u66, 8u71, 8u73, 8u74, 8u77, etc. So, what was going on? Well the plan was quite simple, just not that widely known. 8u20, 8u40, 8u60 and so on were "feature" releases, while all the rest were security patch releases. See the full table. 8u20, 8u40, 8u60 and so on were "feature" releases - every six months 8u5, 8u11, 8u25, 8u31 and so on were "security" releases - every three months, plus additional emergency releases If you look closely, you can see a pattern. The first security release after a feature release had a number 5 greater (8u25 is 5 greater than 8u20). The second security release after a feature release had a number 11 greater (8u31 is 11 greater than 8u20). This left space for emergency security releases like 8u66. So what was a Java 8 feature release? Well a feature release was allowed to contain anything that didn't impact the Java SE specification. So, JVM or tool enhancements might be allowed, particularly if covered by a flag that was disabled by default. For example, the "endorsed-standards override mechanism and the extension mechanism" was deprecated in 8u40, 8u60 added a new IBM character set, and 8u181 removed the Derby database from the JDK b

## From Java 8 to Java 11

DevFeed: [From Java 8 to Java 11](<https://devfeed.tech/articles/from-java-8-to-java-11-22003.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/09/from-java-8-to-java-11.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-09-06T10:01:00Z

Content type: tutorial

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [upgrade](<https://devfeed.tech/topics/upgrade.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [advice](<https://devfeed.tech/tags/advice.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [library](<https://devfeed.tech/tags/library.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>)

### AI overview

This article offers notes and advice for upgrading applications from Java 8 to Java 11. It explains that applications can usually continue running on the classpath without adopting modules, discusses removed Java EE, CORBA, and Java WebStart components, and describes warnings for restricted JDK APIs such as sun.misc.Unsafe.

### Source excerpt

Moving from Java 8 to Java 11 is trickier than most upgrades. Here are a few of my notes on the process. (And here are a couple of other blogs - Benjamin Winterberg and Leonardo Zanivan.) Modules Java 9 introduced one of the largest changes in the history of Java - modules. Much has been said on the topic, by me and others. A key point is sometimes forgotten however: You do not have to modularise your code to upgrade to Java 11. In most cases, code running on the classpath will continue to run on Java 9 and later where modules are completely ignored. This is terrible for library authors, but great for application developers. So my advice is to ignore modules as much as you can when upgrading to Java 11. Turning your application into Java modules may be a useful thing to consider in a few years time when open source dependencies really start to adopt modules. Right now, attempting to modularise is just painful as few dependencies are modules. (The main reason I've found to modularise your application is to be able to use jlink to shrink the size of the JDK. But in my opinion, you don't need to fully modularise to do this - just create a single jar-with-dependencies with a simple no-requires no-exports module-info.) Deleted parts of the JDK Some parts of the JDK have been removed. These were parts of Java EE and Corba that no longer fitted well with the JDK, or could be maintained elsewhere. If you use Corba then there is little anyone can do to help you. However, if you use the Java EE modules then the fix for the deleted code should be simple in most cases. Just add the appropriate Maven jars. On the Java client side, things are more tricky with the removal of Java WebStart. Consider using Getdown or Update4J instead. Unsafe and friends Sun and Oracle have been telling developers for years not to use sun.misc.Unsafe and other sharp-edge JDK APIs. For a long time, Java 9 was to be the release where those classes disappeared. But this never actually happened. What you

## Time to look beyond Oracle's JDK

DevFeed: [Time to look beyond Oracle's JDK](<https://devfeed.tech/articles/time-to-look-beyond-oracle-s-jdk-22005.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/09/time-to-look-beyond-oracles-jdk.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-09-03T08:38:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [openjdk](<https://devfeed.tech/topics/openjdk.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Adoptium](<https://devfeed.tech/topics/adoptium.md>)

Tags: [2023](<https://devfeed.tech/tags/2023.md>), [adoptium](<https://devfeed.tech/tags/adoptium.md>), [amazon](<https://devfeed.tech/tags/amazon.md>), [api](<https://devfeed.tech/tags/api.md>), [branding](<https://devfeed.tech/tags/branding.md>), [certification](<https://devfeed.tech/tags/certification.md>), [cost](<https://devfeed.tech/tags/cost.md>), [ecosystem](<https://devfeed.tech/tags/ecosystem.md>), [java](<https://devfeed.tech/tags/java.md>), [jck](<https://devfeed.tech/tags/jck.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [license](<https://devfeed.tech/tags/license.md>), [mercurial](<https://devfeed.tech/tags/mercurial.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [production](<https://devfeed.tech/tags/production.md>), [source-code](<https://devfeed.tech/tags/source-code.md>), [specification](<https://devfeed.tech/tags/specification.md>), [support](<https://devfeed.tech/tags/support.md>), [tck](<https://devfeed.tech/tags/tck.md>)

### AI overview

The article explains that vendors build from the shared OpenJDK source, while TCK certification supports describing a build as "Java SE compatible"; use of "Java SE" requires an Oracle commercial license. It compares options in the Java 11 era: Oracle's branded JDK is free only for development and requires payment for production use, while Oracle's unbranded OpenJDK builds offer security patches for six months. Adoptium's unbranded builds are described as continuing for four years; Amazon Corretto as a zero-cost, TCK-passing build with long-term support; and Red Hat's RHEL build as OS-integrated with paid support. Other entries include commercially supported Azul Zulu, IBM OpenJ9 builds, and free TCK-verified Liberica. The article's suggested "standard" choices are Oracle OpenJDK builds, Adoptium, or a Linux distribution's build.

### Source excerpt

From Java 11 its time to think beyond Oracle's JDK. Time to appreciate the depth of the ecosystem built on OpenJDK. Here is a list of some key OpenJDK builds. This is a quick follow up to my recent zero-cost Java post OpenJDK builds In practical terms, there is only one set of source code for the JDK. The source code is hosted in Mercurial at OpenJDK. Anyone can take that source code, produce a build and publish it on a URL. But there is a distinct certification process that should be used to ensure the build is valid. Certification is run by the Java Community Process, which provides a Technology Compatibility Kit (TCK, sometimes referred to as the JCK). If an organization produces an OpenJDK build that passes the TCK then that build can be described as "Java SE compatible". Note that the build cannot be referred to as "Java SE" without the vendor getting a commercial license from Oracle. For example, builds from AdoptOpenJDK that pass the TCK are not "Java SE", but "Java SE compatible" or "compatible with the Java SE specification". Note also that certification is currently on a trust-basis - the results are not submitted to the JCP/Oracle for checking and cannot be made public. See Volker's excellent comment for more details. To summarise, the OpenJDK + Vendor process turns one sourcebase into many different builds. In the process of turning the OpenJDK sourcebase into a build, the vendor may, or may not, add some additional branding or utilities, provided these do not prevent certification. For example, a vendor cannot add a new public method to an API, or a new language feature. Oracle JDK http://www.oracle.com/technetwork/java/javase/downloads/ From Java 11 this is a branded commercial build with paid-for support. It can be downloaded and used without cost only for development use. It cannot be used in production without paying Oracle (so it is a bit of a trap for the unwary). Oracle intends to provide full paid support until 2026 or later (details). Note that

## Java is still available at zero-cost

DevFeed: [Java is still available at zero-cost](<https://devfeed.tech/articles/java-is-still-available-at-zero-cost-22001.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/08/java-is-still-available-at-zero-cost.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-08-28T06:53:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [openjdk](<https://devfeed.tech/topics/openjdk.md>), [Adoptium](<https://devfeed.tech/topics/adoptium.md>)

Tags: [2018](<https://devfeed.tech/tags/2018.md>), [2019](<https://devfeed.tech/tags/2019.md>), [2023](<https://devfeed.tech/tags/2023.md>), [cost](<https://devfeed.tech/tags/cost.md>), [free](<https://devfeed.tech/tags/free.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [lts](<https://devfeed.tech/tags/lts.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [release](<https://devfeed.tech/tags/release.md>), [releases](<https://devfeed.tech/tags/releases.md>), [support](<https://devfeed.tech/tags/support.md>), [version](<https://devfeed.tech/tags/version.md>)

### AI overview

Oracle's six-month Java release cycle shortens its free security-update window: the article says Java 11 would receive at least six months of Oracle updates, with longer-term maintenance expected from other OpenJDK community members. Oracle JDK and OpenJDK builds are described as equivalent from Java 11, but licensing differs: the free Oracle JDK download excludes production use, while the article points to OpenJDK binaries such as AdoptOpenJDK/Adoptium or jdk.java.net. For Java 8, options after Oracle's free updates include OS-vendor updates, paid support, community builds, or maintaining a build from source. The cited Red Hat and community timelines are plans, not guarantees; community builds lack warranty or formal support. The article advises choosing a JDK based on patch availability, support duration, vendor guarantees, and platform coverage.

### Source excerpt

The Java ecosystem has always been built on a high quality $free (zero-cost) JDK available from Oracle, and previously Sun. This is as true today as it always has been - but the new six-monthly release cycle does mean some big changes are happening. Six-monthly releases Java now has a release every six months, something which greatly impacts how each version is supported. By support, I mean the provision of update releases with security patches and important bug fixes. Up to and including Java 8, $free security updates were provided for many years. Certainly up to and beyond the launch of the next version. With Java 9 and the six-monthly release cycle, this $free support is now much more tightly controlled. In fact, Oracle will not be providing $free long-term support (LTS) for any single Java version at all from Java 11 onwards. VersionRelease dateEnd of $free updates from Oracle Java 8March 2014January 2019 (for commercial use) Java 9Sept 2017March 2018 Java 10March 2018Sept 2018 Java 11Sept 2018March 2019 (might be extended, see below) Java 12March 2019Sept 2019 The idea here is simple. Oracle wants to focus its energy on moving Java forward with the cost of long-term support directly paid for by customers (instead of giving it away for $free). To do this, they need developers to continually upgrade their version of Java, moving version every six months (and picking up the patch releases in-between). Of course, for most development shops, such rapid upgrade is not feasible. But Java is now developed as OpenJDK, which means that Oracle's support dates are not the only ones to consider. OpenJDK A key point to grasp is that most JDK builds in the world are based on the open source OpenJDK project. The Oracle JDK is merely one of many builds that are based on the OpenJDK codebase. While it used to be the case that Oracle had additional extras in their JDK, as of Java 11 this is no longer the case. Many other vendors also provide builds based on the OpenJDK codebase.

## Upgrading to Eclipse Photon

DevFeed: [Upgrading to Eclipse Photon](<https://devfeed.tech/articles/upgrading-to-eclipse-photon-22000.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/07/upgrading-to-eclipse-photon.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-07-09T09:51:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Tool](<https://devfeed.tech/topics/tool.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Java](<https://devfeed.tech/topics/java.md>), [maven-plugin](<https://devfeed.tech/topics/maven-plugin.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Stack Overflow](<https://devfeed.tech/topics/stackoverflow.md>)

Tags: [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [code-quality](<https://devfeed.tech/tags/code-quality.md>), [eclipse](<https://devfeed.tech/tags/eclipse.md>), [github](<https://devfeed.tech/tags/github.md>), [java](<https://devfeed.tech/tags/java.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [junit](<https://devfeed.tech/tags/junit.md>), [maven](<https://devfeed.tech/tags/maven.md>), [maven-plugin](<https://devfeed.tech/tags/maven-plugin.md>), [modules](<https://devfeed.tech/tags/modules.md>), [new-features](<https://devfeed.tech/tags/new-features.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

Eclipse Photon separates test and main classpaths, with M2E configuring them correctly, and adds support for Java 9 modules, Java 10 local variable type inference, and JUnit 5. The author reports a smooth upgrade and suggests either installing a clean IDE or updating through Photon's update site. One compatibility issue affected the M2E-to-Checkstyle plugin m2e-code-quality: GEBIT maintains a fork but does not provide it as a binary release, so the author built it locally and shared a binary ZIP that can be added as an update site.

### Source excerpt

I use Eclipse as my Java IDE. And the new release, Photon is now out. Photon is a large release, with lots of new features. The most important is the separation of the test and main classpaths, which has always been a point of pain in the IDE. Now it just works as you would expect, and the Maven plugin M2E correctly sets it up: Note the darker colour of the src/test classpath elements. Support for Java 9 (modules) and Java 10 (local variable type inferenece) is also present, ready for Java 11 in September. You can also use JUnit 5. It even tries to help you reach 100% code coverage! All in all, I feel this is a release where upgrading will make a difference to everyday coding. I've upgraded my own Eclipse installations, and it all went pretty well. You can either start from a clean install (I prefer the basic IDE without plugins so I can choose which ones to add). Or you can add Photon as an update site, and let Eclipse update itself. One problem I had was the plugin that connects Maven (M2E) to Checkstyle (Eclipse-CS), known as m2e-code-quality. Fortunately, the team at GEBIT have been maintaining a fork of the original plugin. However, they don't release it in binary form. As such, I had to build the plugin locally (no big deal - its a simple build). To simplify the process however, I've created a repository on GitHub with my Eclipse setup files, and a binary zip of the GEBIT forked plugin. To use just the m2e-code-quality GEBIT fork, download the zip file and add it as an update site. Here are some instructions. Thank you Eclipse team for a great release! PS. I won't be answering "how to" questions about upgrading Eclipse or the eclipse-setup repository. There are plenty of other places to ask questions, such as Stack Overflow or the Eclipse Forums.

## JPMS modules for library developers - negative benefits

DevFeed: [JPMS modules for library developers - negative benefits](<https://devfeed.tech/articles/jpms-modules-for-library-developers-negative-benefits-21999.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/03/jpms-negative-benefits.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-03-22T10:52:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Library](<https://devfeed.tech/topics/library.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [developers](<https://devfeed.tech/tags/developers.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [java9](<https://devfeed.tech/tags/java9.md>), [library](<https://devfeed.tech/tags/library.md>), [modules](<https://devfeed.tech/tags/modules.md>)

### AI overview

The author argues that JPMS imposes extra testing and build complexity on open source library developers while failing to guarantee reliable configuration or strong encapsulation, because modular JARs can still run on the class-path. Libraries often need to retain Java 8 compatibility, and class-path and module-path behavior can differ, including for service loading and resource lookup, so the author says both must be tested. Doing nothing still requires checking module-path compatibility; adding `Automatic-Module-Name` reserves a name but can cause Maven to use the module-path and expose failures; adding `module-info.java` requires substantial build work and can break older tools and Android compatibility. The author sees full modularization as too costly until Java 11 or later is widely adopted, and proposes a way to prevent modular JARs from running on the class-path as a fix.

### Source excerpt

Java 9 introduced a major new feature - JPMS, the Java Platform Module System. After six months I've come to the conclusion that JPMS currently offers "negative benefits" to open source library developers. Read on to understand why. Modules for library developers Java 8 is probably the most successful Java release ever. It is widely used and widely liked. As such, almost all open source libraries run on Java 8 (as library authors want their code to be used!). Some libraries with a long history also still run on older versions. Joda-Convert has a Java 6 baseline, while Joda-Time has a Java 5 baseline. Others have a Java 8 baseline, such as ThreeTen-Extra. Java 9 was released in September 2017, but it is not a release that will be supported for a number of years. Instead, it had a lifetime of six months and is now obsolete because Java 10 is out. And in six months time Java 11 will be out making Java 10 obsolete, and so on. While most releases last six months, some are luckier. Java 11 will be a "long term support" (LTS) release with security and bug support for a few years (Java 8 is also an LTS release). Thus, even though Java 10 is out, Java 8 is still the sensible Java version for open source library developers to target right now because it is the current LTS release. But what happens when Java 11 comes out? Since Java 8 will be unsupported relatively soon after Java 11 is released, you'd think that the sensible baseline would be 11. Unfortunately I believe many companies will be sticking with Java 8 for a long time. An aggressive open source project might move quickly to a Java 11 baseline, but doing so would be a risky strategy for adoption. The module-path Before discussing the JPMS options for open source library developers, it is important to cover the distinction between the class-path and the module-path. The class-path that we all know and love is still present in Java 9+, and it mostly works in the same way. The module-path is new. When a jar file is on

## Java 9 has six weeks to live

DevFeed: [Java 9 has six weeks to live](<https://devfeed.tech/articles/java-9-has-six-weeks-to-live-21998.md>)

Original publisher: [Read original article](<http://blog.joda.org/2018/02/java-9-has-six-weeks-to-live.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2018-02-05T13:10:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [upgrade](<https://devfeed.tech/topics/upgrade.md>), [openjdk](<https://devfeed.tech/topics/openjdk.md>), [version](<https://devfeed.tech/topics/version.md>), [Build tool](<https://devfeed.tech/topics/build-tool.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>)

Tags: [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [ide](<https://devfeed.tech/tags/ide.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [java9](<https://devfeed.tech/tags/java9.md>), [lts](<https://devfeed.tech/tags/lts.md>), [maven](<https://devfeed.tech/tags/maven.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [pre-release](<https://devfeed.tech/tags/pre-release.md>), [security-updates](<https://devfeed.tech/tags/security-updates.md>), [testing](<https://devfeed.tech/tags/testing.md>), [toolchain](<https://devfeed.tech/tags/toolchain.md>), [tools](<https://devfeed.tech/tags/tools.md>), [train](<https://devfeed.tech/tags/train.md>)

### AI overview

Java's six-month release cycle means a release becomes obsolete when the next arrives, with no further Oracle security updates. The text outlines three choices: stay on Java 8 LTS until Java 11, keep pace from Java 9 through Java 10 to Java 11 for security updates, or remain on an obsolete release without those updates. For teams choosing rapid upgrades, it recommends testing Java pre-releases with dependencies, IDEs, build tools such as Maven or Gradle, and other tools before each release. If that pace is impractical, it suggests considering a return to Java 8 LTS.

### Source excerpt

Java 9 is obsolete in just six weeks (20th March 2018). What? You haven't upgraded yet? Well, Java 10 is only going to last six months before it is obsolete too. Update 2018-03-20: Java 10 is released. Java 9 is obsolete. Release train impact The new Java release train means that there will be a new release of Java every six months. And when the next release comes out, the previous release is obsolete. What do I mean by obsolete? In practical terms it means that there are no more security updates from Oracle. (Theoretically, the OpenJDK community could release security updates, but there is no sign of this yet). And since you don't want to run your software without the latest security updates, you are expected to upgrade to Java 10 as soon as it is released. As a user of Java, here are three possible ways to approach the release train: Stay on Java 8, the current LTS (long term support) release, until the next LTS release occurs (Java 11) Move from Java 9 to Java 10 to Java 11, making sure you update rapidly to get the security updates Stay on Java 9 (or Java 10) and don't worry about security updates If you have already moved to Java 9, you have effectively committed to option 2 or 3. If you care about security updates, you need to be prepared to switch to Java 10 shortly after it is release on 20th March. To do this, you probably should be testing with a Java 10 pre-release now. If you find that to be a challenge, you have to stop caring about security, or consider going back to Java 8 LTS. However you look at it, being on the release train is a big commitment. Will your dependencies work on the next version? Will your IDE be ready? Will your build tool (Maven, Gradle etc.) be ready? Will your other tools (spotbugs, checkstyle, PMD etc.) be ready? How fast are you going to be able to update when the release you are on is obsolete? Lots to consider. And given the number of external tools/dependencies to consider, I think its fair to say that its a bold choice to us

## Java SE 9 - JPMS automatic modules

DevFeed: [Java SE 9 - JPMS automatic modules](<https://devfeed.tech/articles/java-se-9-jpms-automatic-modules-21997.md>)

Original publisher: [Read original article](<http://blog.joda.org/2017/05/java-se-9-jpms-automatic-modules.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2017-05-09T07:14:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Code Modularity](<https://devfeed.tech/topics/code-modularity.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Java](<https://devfeed.tech/topics/java.md>), [Maven Central](<https://devfeed.tech/topics/maven-central.md>)

Tags: [artifacts](<https://devfeed.tech/tags/artifacts.md>), [automatic](<https://devfeed.tech/tags/automatic.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [java](<https://devfeed.tech/tags/java.md>), [java-se](<https://devfeed.tech/tags/java-se.md>), [java9](<https://devfeed.tech/tags/java9.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [migration](<https://devfeed.tech/tags/migration.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [open-source-projects](<https://devfeed.tech/tags/open-source-projects.md>)

### AI overview

JPMS automatic modules let a modular Java application use ordinary JARs on the module path before those dependencies have module descriptors. Such a JAR exports all its packages and is treated as depending on everything on the module path and classpath; without an `Automatic-Module-Name` manifest entry, its module name comes from its filename. The article argues this creates migration problems: published modules may require the filename, then break when the dependency gains a different formal module name, forcing dependent projects to update together. It recommends avoiding published module descriptors that require automatic modules by filename. Projects can publish an `Automatic-Module-Name` manifest entry early to stabilize their future module name; full modularization still proceeds bottom-up. The excerpt presents these as the author's assessment and recommendations.

### Source excerpt

This article in my series on the Java Platform Module System (JPMS) is focussed on automatic modules. JPMS was previously known as Project Jigsaw and is the module system in Java SE 9. See also Module basics, Module naming and Modules & Artifacts. Automatic modules Lets say you are in charge of Java, and after 20 years you want to add a module system to the platform. As well as the problems of designing the module system itself, you have to consider migration of all the existing code written in Java (and to a degree, other JVM languages). The solution to this that JPMS has chosen is automatic modules. Unfortunately, my opinion is that it is the wrong solution. To understand automatic modules, we have to start by looking at how jar files will be specified in future. In addition to the classpath, Java SE 9 will also have a modulepath. The basic idea is that modules (jar files containing module-info.class) will be placed on the modulepath, not the classpath. In fact, placing a module on the classpath will cause the module declaration (module-info.class) to be completely ignored, which is usually not what you want. As a basic rule, the modulepath cannot see the classpath. If you create a module and put it on the modulepath, all its dependencies must also be on the modulepath. Thus, in order to write a module at all, all the dependencies must also have been converted to be modules. And many of those dependencies are likely to be open source projects, with varying release schedules. Clearly, this is a bit of a problem. Essentially, it would mean that an application would need to wait until every dependency had become a module before it could add module-info.java. The "solution" to this is automatic modules. An automatic module is a normal jar file - one without a module-info.class file - that is placed on the modulepath. Thus the modulepath will contain two types of module - "real" and "automatic". Since there is no module-info.class, an automatic module is missing the me

## Java SE 9 - JPMS modules are not artifacts

DevFeed: [Java SE 9 - JPMS modules are not artifacts](<https://devfeed.tech/articles/java-se-9-jpms-modules-are-not-artifacts-21996.md>)

Original publisher: [Read original article](<http://blog.joda.org/2017/04/java-se-9-jpms-modules-are-not-artifacts.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2017-04-24T08:12:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [modules](<https://devfeed.tech/topics/modules.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Java](<https://devfeed.tech/topics/java.md>), [Maven Central](<https://devfeed.tech/topics/maven-central.md>), [version](<https://devfeed.tech/topics/version.md>)

Tags: [apache](<https://devfeed.tech/tags/apache.md>), [api](<https://devfeed.tech/tags/api.md>), [application](<https://devfeed.tech/tags/application.md>), [artifacts](<https://devfeed.tech/tags/artifacts.md>), [build-tool](<https://devfeed.tech/tags/build-tool.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [graph](<https://devfeed.tech/tags/graph.md>), [java](<https://devfeed.tech/tags/java.md>), [java9](<https://devfeed.tech/tags/java9.md>), [joda](<https://devfeed.tech/tags/joda.md>), [maven](<https://devfeed.tech/tags/maven.md>), [maven-central](<https://devfeed.tech/tags/maven-central.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [name](<https://devfeed.tech/tags/name.md>), [org](<https://devfeed.tech/tags/org.md>), [package](<https://devfeed.tech/tags/package.md>), [platform](<https://devfeed.tech/tags/platform.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [tool](<https://devfeed.tech/tags/tool.md>), [version](<https://devfeed.tech/tags/version.md>)

### AI overview

JPMS module names identify code and its packages, while Maven coordinates identify individual artifacts; they are not interchangeable. Each release can be a different JAR artifact with the same module name, and JPMS does not select versions, so a build tool such as Maven must choose which artifact enters the module graph. A JPMS module path refuses to start when modules contain the same package, including when two versions of one module are present. The same distinction applies to patched libraries and license-driven duplicate API JARs: replacements keep the original package and module name, while the build tool selects the desired artifact. The article's practical guidance is to name modules for their super-package, not derive names from groupId:artifactId.

### Source excerpt

This is the next article in a series I'm writing to help make sense of the Java Platform Module System (JPMS) in Java SE 9. JPMS was developed as Project Jigsaw. Other articles in the series are Module basics and Module naming. Module != Artifact If you want to grasp what JPMS modules are all about, it turns out that it is critical to understand what they are not. In particular, they are not artifacts. Firstly, lets define an artifact. An artifact is a file produced when developing software. For a project on Maven Central, this includes jar files of bytecode, jar files of sources and jar files of Javadoc. We are interested primarily in the bytecode for this discussion. Secondly, lets assume that a project is going to have the same module name over time. This is just like package names - projects don't change package name with every release. Given this, what is the mapping between an artifact and a module? Versions Each version of a project will consist of a different artifact (jar file), perhaps released on Maven Central. Each version will have the same module name. But, we also know that the Java platform (JPMS) does not know about versions or version-selection. Therefore, when assembling a modulepath for Java SE 9, something else is going to have to choose the correct version of the module. This will typically be the build tool, eg. Maven. But while the classpath will tolerate having two versions of the artifact (typically with bad consequences at runtime), the JPMS modulepath will refuse to start if there two modules contain the same package, as would happen if two versions of the same module are found. Maven already manages versions of course, picking one version from a set of versions, where all with the same groupId:artifactId. With Java SE 9 we can say that Maven is picking one artifact from a set of artifacts to use in the runtime JPMS module graph. Artifacts JPMS runtime module org.joda : joda-convert : 1.2 Build tool must pick one of these artifacts for th

## Java SE 9 - JPMS module naming

DevFeed: [Java SE 9 - JPMS module naming](<https://devfeed.tech/articles/java-se-9-jpms-module-naming-21995.md>)

Original publisher: [Read original article](<http://blog.joda.org/2017/04/java-se-9-jpms-module-naming.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2017-04-20T14:01:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [modules](<https://devfeed.tech/topics/modules.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [bestpractice](<https://devfeed.tech/tags/bestpractice.md>), [dns](<https://devfeed.tech/tags/dns.md>), [it](<https://devfeed.tech/tags/it.md>), [java](<https://devfeed.tech/tags/java.md>), [java9](<https://devfeed.tech/tags/java9.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [name](<https://devfeed.tech/tags/name.md>), [ownership](<https://devfeed.tech/tags/ownership.md>), [package](<https://devfeed.tech/tags/package.md>), [packages](<https://devfeed.tech/tags/packages.md>)

### AI overview

The author recommends reverse-DNS JPMS names matching a module's super-package, so module names signal namespace ownership and reduce global name collisions. JPMS requires each package, including hidden packages, to belong to only one module; keeping a module's packages beneath its name helps avoid clashes that may be hard to detect. The article advises splitting jars with unrelated package roots into separate modules, or shading hidden packages beneath the module namespace, and says projects may need incompatible changes to meet these guidelines. It distinguishes JPMS module names from Maven artifact IDs, which are only unique as part of a groupId/artifactId/classifier combination. Automatic module names derived from jar filenames make dependencies harder to predict, while JPMS offers no metadata override to resolve clashes; the author notes that rewriting module declarations or avoiding JPMS may be necessary.

### Source excerpt

The Java Platform Module System (JPMS) is soon to arrive, developed as Project Jigsaw. This article follows the introduction and looks at how modules should be named. As with all "best practices", they are ultimately the opinion of the person writing them. I hope however to convince you that my opinion is right ;-). And as a community, we will certainly benefit if everyone follows the same rules, just like we benefited from everyone using reverse-DNS for package names. TL;DR - My best practices These are my recommendations for module naming: Module names must be reverse-DNS, just like package names, e.g. org.joda.time. Modules are a group of packages. As such, the module name must be related to the package names. Module names are strongly recommended to be the same as the name of the super-package. Creating a module with a particular name takes ownership of that package name and everything beneath it. As the owner of that namespace, any sub-packages may be grouped into sub-modules as desired so long as no package is in two modules. Thus the following is a well-named module: module org.joda.time { requires org.joda.convert; exports org.joda.time; exports org.joda.time.chrono; exports org.joda.time.format; // not exported: org.joda.time.base; // not exported: org.joda.time.tz; } As can be seen, the module contains a set of packages (exported and hidden), all under one super-package. The module name is the same as the super-package name. The author of the module is asserting control over all names below org.joda.time, and could create a module org.joda.time.18n in the future if desired. To understand why this approach makes sense, and the finer details, read on. JPMS naming Naming anything in software is hard. Unsurprisingly then, agreeing an approach to naming modules has also turned out to be hard. The naming rules allow dots, but prohibit dashes, thus lots of name options are closed off. As a side note, module names in the JVM are more flexible, but we are only cons

## Java 9 modules - JPMS basics

DevFeed: [Java 9 modules - JPMS basics](<https://devfeed.tech/articles/java-9-modules-jpms-basics-21994.md>)

Original publisher: [Read original article](<http://blog.joda.org/2017/04/java-9-modules-jpms-basics.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2017-04-17T05:17:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Code Modularity](<https://devfeed.tech/topics/code-modularity.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Java](<https://devfeed.tech/topics/java.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [access-control](<https://devfeed.tech/tags/access-control.md>), [application](<https://devfeed.tech/tags/application.md>), [article](<https://devfeed.tech/tags/article.md>), [basics](<https://devfeed.tech/tags/basics.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [container](<https://devfeed.tech/tags/container.md>), [design](<https://devfeed.tech/tags/design.md>), [developer](<https://devfeed.tech/tags/developer.md>), [devices](<https://devfeed.tech/tags/devices.md>), [goals](<https://devfeed.tech/tags/goals.md>), [java](<https://devfeed.tech/tags/java.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [java9](<https://devfeed.tech/tags/java9.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [major](<https://devfeed.tech/tags/major.md>), [make](<https://devfeed.tech/tags/make.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [new-feature](<https://devfeed.tech/tags/new-feature.md>), [package](<https://devfeed.tech/tags/package.md>)

### AI overview

JPMS adds modules as a JVM-level container for packages, with module declarations specifying dependencies and exported packages. A modular JAR enforces those visibility rules only on the module path; on the classpath its descriptor is ignored, and legacy classpath code receives broad access. In `module-info.java`, `requires transitive` exposes a dependency to downstream modules, while `requires static` makes a dependency optional at runtime. The article also identifies migration limits: module versions are not managed, package clashes and dependency cycles are prohibited, reflective access changes, and large projects may rely on controversial automatic modules. It cautions that these constraints can complicate migration of existing libraries and applications.

### Source excerpt

The Java Platform Module System (JPMS) is the major new feature of Java SE 9. In this article, I will introduce it, leaving most of my opinions to a follow up article. This is based on these slides. Java Platform Module System (JPMS) The new module system, developed as Project Jigsaw, is intended to raise the abstraction level of coding in Java as follows: The primary goals of this Project are to: * Make the Java SE Platform, and the JDK, more easily scalable down to small computing devices; * Improve the security and maintainability of Java SE Platform Implementations in general, and the JDK in particular; * Enable improved application performance; and * Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms. To achieve these goals we propose to design and implement a standard module system for the Java SE Platform and to apply that system to the Platform itself, and to the JDK. The module system should be powerful enough to modularize the JDK and other large legacy code bases, yet still be approachable by all developers. However as we shall see, project goals are not always met. What is a JPMS Module? JPMS is a change to the Java libraries, language and runtime. This means that it affects the whole stack that developers code with day-to-day, and as such JPMS could have a big impact. For compatibility reasons, most existing code can ignore JPMS in Java SE 9, something that may prove to be very useful. The key conceptual point to grasp is that JPMS adds new a concept to the JVM - modules. Where previously, code was organized into fields, methods, classes, interfaces and packages, with Java SE 9 there is a new structural element - modules. a class is a container of fields and methods a package is a container of classes and interfaces a module is a container of packages Because this is a new JVM element, it means the runtime can apply strong access control. With Java 8, a developer can express th

## Java Time (JSR-310) enhancements in Java SE 9

DevFeed: [Java Time (JSR-310) enhancements in Java SE 9](<https://devfeed.tech/articles/java-time-jsr-310-enhancements-in-java-se-9-21993.md>)

Original publisher: [Read original article](<http://blog.joda.org/2017/02/java-time-jsr-310-enhancements-java-9.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2017-02-07T14:47:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [jsr310](<https://devfeed.tech/topics/jsr310.md>)

Tags: [added](<https://devfeed.tech/tags/added.md>), [api](<https://devfeed.tech/tags/api.md>), [clock](<https://devfeed.tech/tags/clock.md>), [conversion](<https://devfeed.tech/tags/conversion.md>), [days](<https://devfeed.tech/tags/days.md>), [enhancement](<https://devfeed.tech/tags/enhancement.md>), [instant](<https://devfeed.tech/tags/instant.md>), [java](<https://devfeed.tech/tags/java.md>), [java-se](<https://devfeed.tech/tags/java-se.md>), [java9](<https://devfeed.tech/tags/java9.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jsr310](<https://devfeed.tech/tags/jsr310.md>), [localdate](<https://devfeed.tech/tags/localdate.md>), [minutes](<https://devfeed.tech/tags/minutes.md>), [optimize](<https://devfeed.tech/tags/optimize.md>), [optimized](<https://devfeed.tech/tags/optimized.md>), [performance](<https://devfeed.tech/tags/performance.md>), [precision](<https://devfeed.tech/tags/precision.md>), [returning](<https://devfeed.tech/tags/returning.md>), [stream](<https://devfeed.tech/tags/stream.md>), [time](<https://devfeed.tech/tags/time.md>), [use-cases](<https://devfeed.tech/tags/use-cases.md>)

### AI overview

Java SE 9's java.time updates add date streaming, duration operations, and more direct conversions to epoch seconds. Clock.systemUTC() gains precision according to the operating system clock; Clock.tickMillis(ZoneId) preserves Java SE 8-style millisecond ticks when needed. DateTimeFormatter gains modified Julian day and generic time-zone patterns, supports more offset forms, and improves adjacent-value parsing. The excerpt also describes performance optimizations for clocks, zone lookups, and LocalDate.plusDays. It identifies these as selected enhancements among 117 targeted issues, many of which were Javadoc fixes.

### Source excerpt

The java.time.* API (JSR-310) was added to Java SE 8, but what has been going on since then? Java Time in Java SE 9 There are currently 117 java time issues targetted into Java SE 9. Most of these are not especially interesting, with a lot of mistakes in the Javadoc that needed fixing. What follows are some of the interesting ones: Main enhancements: JDK-8146218 - Add LocalDate.datesUntil method producing Stream. Adds two new methods - LocalDate.datesUntil(LocalDate) and LocalDate.datesUntil(LocalDate,Period) - returning a stream of dates. JDK-8068730 - Increase precision of Clock.systemUTC(). The clock in Java - System.currentTimeMillis() - has ticked in milliseconds since Java was first released. With Java SE 9, users of Clock will see higher precision, depending on the available clock of the operating system. JDK-8071919 - Clock.tickMillis(ZoneId zone) method. With the system clock now returning higher precision, a new method was added - Clock.tickMillis(ZoneId) - that chops off the extra precision to restrore the millisecond ticking behaviour of Java SE 8. JDK-8030864 - Add efficient getDateTimeMillis method to java.time. This adds two methods named epochSecond to Chronology that have no object creation to convert date-time fields to an epoch-second. JDK-8142936 - Duration methods for days, hours, minutes, seconds, etc. The Java SE 8 API of Duration turned out to be incomplete for certain use cases. This change adds a slew of new methods that allow parts of the duration to be reliably returned. JDK-8148849 - Truncating Duration. Adds a method Duration.truncatedTo(TemporalUnit) to allow truncation, similar to the existing method on Instant. JDK-8032510 - Add Duration.dividedBy(Duration). A new method to allow a duration to be divided by another duration. JDK-8133079 - LocalDate and LocalTime ofInstant() factory methods. Add new factory methods in LocalDate and LocalTime to simplify conversion from Instant. JDK-8143413 - Add toEpochSecond methods for efficient acc

## Code generating beans - mutable and immutable

DevFeed: [Code generating beans - mutable and immutable](<https://devfeed.tech/articles/code-generating-beans-mutable-and-immutable-21991.md>)

Original publisher: [Read original article](<http://blog.joda.org/2016/09/code-generating-beans.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2016-09-26T01:36:00Z

Content type: comparison

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Boilerplate](<https://devfeed.tech/topics/boilerplate.md>), [annotation-processor](<https://devfeed.tech/topics/annotation-processor.md>), [source generators](<https://devfeed.tech/topics/source-generators.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [2016](<https://devfeed.tech/tags/2016.md>), [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [annotation](<https://devfeed.tech/tags/annotation.md>), [code](<https://devfeed.tech/tags/code.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [data](<https://devfeed.tech/tags/data.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [equals](<https://devfeed.tech/tags/equals.md>), [has](<https://devfeed.tech/tags/has.md>), [hashcode](<https://devfeed.tech/tags/hashcode.md>), [hibernate](<https://devfeed.tech/tags/hibernate.md>), [interface](<https://devfeed.tech/tags/interface.md>), [jackson](<https://devfeed.tech/tags/jackson.md>), [java](<https://devfeed.tech/tags/java.md>), [javaone](<https://devfeed.tech/tags/javaone.md>), [jodabeans](<https://devfeed.tech/tags/jodabeans.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [pain](<https://devfeed.tech/tags/pain.md>), [projects](<https://devfeed.tech/tags/projects.md>), [properties](<https://devfeed.tech/tags/properties.md>), [serialization](<https://devfeed.tech/tags/serialization.md>)

### AI overview

The article argues that immutable beans are practical when generated, since manually maintaining bean methods and builders is tedious and error-prone. IDE generation can become stale as classes change. AutoValue, Immutables, and VALJOGen generate implementations at compile time from abstract methods; they focus on immutable beans, with Immutables offering the most options and AutoValue requiring a builder outline. Lombok lets developers use fields and generates within the class by hooking into compiler and Eclipse internals, but brings IDE limitations and prevents debugging generated code. Joda-Beans regenerates code in the source file, so it compiles without IDE setup, and adds runtime property support and serialization; that support requires a runtime dependency. The author recommends Joda-Beans when its properties are useful, otherwise Immutables. The article also points to a comparison project for trying the tools.

### Source excerpt

Java has long suffered from the pain of beans. To declare a simple data class takes far too much code. At JavaOne 2016, I talked about code generation options - see the slides. Code generation of mutable and immutable beans The Java ecosystem is massive. So many libraries releasd as open source and beyond, which naturally leads to the question as to how those libraries communicate. And it is the basic concept of beans that is the essential glue, despite the ancient specification. How do ORMs (Hibernate etc.), Serialization (Jackson etc.) and Bean Mappers (Dozer etc.) communicate? Via getters and setters. The essential features of beans have moved beyond the JavaBeans spec, and are sometimes referred to as POJOs. The features are: Mutable No-args constructor Getters and Setters equals() / hashCode() / toString() But writing these manually is slow, tedious and error-prone. Code generation should be able to help us here. But should we be using mutable beans in 2016? No, no, no! It is time to be writing immutable data structure (immutable beans). But the only practical way to do so is code generation, especially if you want to have builders. In my talk at JavaOne 2016, I considered various code generation approaches: IDE code generation This is fine as far as it goes, but while the code is likely to be correct immediately after generation, there is still no guarantee that the generated code will stay correct as the class is maintained over time. AutoValue, Immutables and VALJOGen These three projects - AutoValue, Immutables, VALJOGen - use annotation processors to generate code during compilation. The idea is simple - the developer writes an abstract class or interface, and the tool code generates the implementation at compile time. However, these tool all focus on immutable beans, not mutable (Immutables can generate a modifiable bean, but it doesn't match the JavaBeans spec, so many tools will reject it). On the up side, there is no chance to mess up the equals / hash

## Private methods in interfaces in Java 9

DevFeed: [Private methods in interfaces in Java 9](<https://devfeed.tech/articles/private-methods-in-interfaces-in-java-9-21992.md>)

Original publisher: [Read original article](<http://blog.joda.org/2016/09/private-methods-in-interfaces-in-java-9.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2016-09-20T06:26:00Z

Content type: article

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [interface](<https://devfeed.tech/topics/interface.md>), [openjdk](<https://devfeed.tech/topics/openjdk.md>), [LocalDate](<https://devfeed.tech/topics/localdate.md>)

Tags: [interfaces](<https://devfeed.tech/tags/interfaces.md>), [java](<https://devfeed.tech/tags/java.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [java9](<https://devfeed.tech/tags/java9.md>), [private](<https://devfeed.tech/tags/private.md>)

### AI overview

Java 9 adds private methods to interfaces, complementing Java 8's public static and default methods. Private methods can be static or instance methods and are not inherited by subinterfaces or implementing classes. The excerpt lists public static, public abstract, public default, private static, and private methods as supported; private abstract and private default are compile errors. The author presents private methods as a way to round out the interface functionality added in Java 8.

### Source excerpt

Java SE 9 is slowly moving towards the finishing line. One new feature is private methods on interfaces. Private methods on interfaces in Java 9 In Java 7 and all earlier versions, interfaces were simple. They could only contain public abstract methods. Java 8 changed this. From Java 8, you can have public static methods and public default methods. public interface HolidayCalendar { // static method, to get the calendar by identifier public static HolidayCalendar of(String id) { return Util.holidayCalendar(id); } // abstract method, to find if the date is a holiday public abstract boolean isHoliday(LocalDate date); // default method, using isHoliday() public default boolean isBusinessDay(LocalDate date) { return !isHoliday(date); } } Note that I have chosen to use the full declaration, with "public" on all three methods even though it is not required. I have argued that this is best practice for Java SE 8, because it makes the code clearer (now there are three types of method) and prepares for a time when there will be non-public methods. And that time is very soon, as Java 9 is adding private methods on interfaces. public interface HolidayCalendar { // example of a private interface method private void validateDate(LocalDate date) { if (date.isBefore(LocalDate.of(1970, 1, 1))) { throw new IllegalArgumentException(); } } } Thus, methods can be public or private (with the default being public if not specified). Private methods can be static or instance. In both cases, the private method is not inherited by sub-interfaces or implementations. The valid combinations of modifiers in Java 9 will be as follow: public static - supported public abstract - supported public default - supported private static - supported private abstract - compile error private default - compile error private - supported Private methods on interfaces will be very useful in rounding out the functionality added in Java 8.

[Next page](<https://devfeed.tech/sources/stephen-colebourne.md?cursor=WyIyMDE2LTA5LTIwVDA2OjI2OjAwKzAwOjAwIiwgIjdhNThkNTFkLTkzM2UtNDczMi1iYThhLTYxNWU2NjU2ZjkxOSJd>)