Skip to content

FindJavaVersion (et al) -- normalize version numbers #968

@nmck257

Description

@nmck257

The JavaVersion marker has a private normalize method, which helps with consolidating Java "1.8" and "8" into just "8". It also has public methods like getMajorVersion which call that normalize method.

The FindJavaVersion recipe instead directly accesses the underlying fields sourceCompatibility and targetCompatibility, and therefore gets non-normalized values. That's pesky in the resultant data table, where a user might expect the normalized forms.

Adding new column(s) for the normalized values is probably the most backwards-compatible "fix", but I could also argue for normalizing the existing columns in-place.

Maybe the JavaVersion marker itself should also get a slight refactor to its public methods to make it more obvious whether you're getting a raw or normalized value. It would probably be good to navigate around to various see if others would benefit from a tweak.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions