Skip to content

Commit eb90d8e

Browse files
committed
#192: Update to Java 25.
Signed-off-by: Franz Wilhelmstötter <franz.wilhelmstoetter@gmail.com>
1 parent 0ce640a commit eb90d8e

File tree

8 files changed

+22
-35
lines changed

8 files changed

+22
-35
lines changed

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ gradle.projectsEvaluated {
7272

7373
plugins.withType<JavaPlugin> {
7474
configure<JavaPluginExtension> {
75-
sourceCompatibility = JavaVersion.VERSION_21
76-
targetCompatibility = JavaVersion.VERSION_21
75+
sourceCompatibility = JavaVersion.VERSION_25
76+
targetCompatibility = JavaVersion.VERSION_25
7777
}
7878

7979
configure<JavaPluginExtension> {
@@ -170,7 +170,7 @@ fun setupJavadoc(project: Project) {
170170
doclet.charSet = "UTF-8"
171171
doclet.linkSource(true)
172172
doclet.linksOffline(
173-
"https://docs.oracle.com/en/java/javase/21/docs/api/",
173+
"https://docs.oracle.com/en/java/javase/25/docs/api/",
174174
"${project.rootDir}/buildSrc/resources/javadoc/java.se"
175175
)
176176
doclet.windowTitle = "JPX ${project.version}"

buildSrc/resources/javadoc/java.se/element-list

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ module:java.base
22
java.io
33
java.lang
44
java.lang.annotation
5+
java.lang.classfile
6+
java.lang.classfile.attribute
7+
java.lang.classfile.constantpool
8+
java.lang.classfile.instruction
59
java.lang.constant
610
java.lang.foreign
711
java.lang.invoke
@@ -91,6 +95,7 @@ javax.print
9195
javax.print.attribute
9296
javax.print.attribute.standard
9397
javax.print.event
98+
javax.sound
9499
javax.sound.midi
95100
javax.sound.midi.spi
96101
javax.sound.sampled
@@ -210,7 +215,6 @@ com.sun.source.tree
210215
com.sun.source.util
211216
com.sun.tools.javac
212217
module:jdk.crypto.cryptoki
213-
module:jdk.crypto.ec
214218
module:jdk.dynalink
215219
jdk.dynalink
216220
jdk.dynalink.beans
@@ -255,6 +259,7 @@ module:jdk.jstatd
255259
module:jdk.localedata
256260
module:jdk.management
257261
com.sun.management
262+
jdk.management
258263
module:jdk.management.agent
259264
module:jdk.management.jfr
260265
jdk.management.jfr
@@ -279,4 +284,4 @@ org.w3c.dom.css
279284
org.w3c.dom.html
280285
org.w3c.dom.stylesheets
281286
org.w3c.dom.xpath
282-
module:jdk.zipfs
287+
module:jdk.zipfs

jpx/src/main/java/io/jenetics/jpx/Degrees.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public final class Degrees
7676
* range of {@code [0..360]}
7777
*/
7878
private Degrees(final double value) {
79-
if (value < MIN_VALUE || value >= MAX_VALUE) {
79+
if (Double.compare(value, MIN_VALUE) < 0 ||
80+
Double.compare(value, MAX_VALUE) >= 0)
81+
{
8082
throw new IllegalArgumentException(format(
8183
"%f not in the range [0, 360).", value
8284
));
@@ -140,8 +142,7 @@ public int hashCode() {
140142

141143
@Override
142144
public boolean equals(final Object obj) {
143-
return obj == this ||
144-
obj instanceof Degrees deg &&
145+
return obj instanceof Degrees deg &&
145146
Double.compare(deg._value, _value) == 0;
146147
}
147148

jpx/src/main/java/io/jenetics/jpx/Latitude.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ public final class Latitude extends Number implements Serializable {
8484
* range of {@code [-90..90]}
8585
*/
8686
private Latitude(final double value) {
87-
if (value < MIN_DEGREES || value > MAX_DEGREES) {
87+
if (Double.compare(value, MIN_DEGREES) < 0 ||
88+
Double.compare(value, MAX_DEGREES) > 0)
89+
{
8890
throw new IllegalArgumentException(format(
8991
"%f is not in range [-90, 90].", value
9092
));
@@ -143,8 +145,7 @@ public int hashCode() {
143145

144146
@Override
145147
public boolean equals(final Object obj) {
146-
return obj == this ||
147-
obj instanceof Latitude lat &&
148+
return obj instanceof Latitude lat &&
148149
Double.compare(lat._value, _value) == 0;
149150
}
150151

jpx/src/main/java/io/jenetics/jpx/Longitude.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ public final class Longitude extends Number implements Serializable {
8484
* range of {@code [-180..180]}
8585
*/
8686
private Longitude(final double value) {
87-
if (value < MIN_DEGREES || value > MAX_DEGREES) {
87+
if (Double.compare(value, MIN_DEGREES) < 0 ||
88+
Double.compare(value, MAX_DEGREES) > 0)
89+
{
8890
throw new IllegalArgumentException(format(
8991
"%f is not in range [-180, 180).", value
9092
));
@@ -143,8 +145,7 @@ public int hashCode() {
143145

144146
@Override
145147
public boolean equals(final Object obj) {
146-
return obj == this ||
147-
obj instanceof Longitude lng &&
148+
return obj instanceof Longitude lng &&
148149
Double.compare(lng._value, _value) == 0;
149150
}
150151

jpx/src/test/java/io/jenetics/jpx/DegreesTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
*/
2020
package io.jenetics.jpx;
2121

22-
import nl.jqno.equalsverifier.EqualsVerifier;
23-
2422
import java.util.Random;
2523
import java.util.function.Supplier;
2624

@@ -68,9 +66,4 @@ public void ofDegrees() {
6866
);
6967
}
7068

71-
@Test
72-
public void equalsVerifier() {
73-
EqualsVerifier.forClass(Degrees.class).verify();
74-
}
75-
7669
}

jpx/src/test/java/io/jenetics/jpx/LatitudeTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
*/
2020
package io.jenetics.jpx;
2121

22-
import nl.jqno.equalsverifier.EqualsVerifier;
23-
2422
import java.util.Random;
2523
import java.util.function.Supplier;
2624

@@ -64,9 +62,4 @@ public void ofDegrees() {
6462
);
6563
}
6664

67-
@Test
68-
public void equalsVerifier() {
69-
EqualsVerifier.forClass(Latitude.class).verify();
70-
}
71-
7265
}

jpx/src/test/java/io/jenetics/jpx/LongitudeTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import static java.lang.Double.doubleToLongBits;
2323
import static java.lang.Double.longBitsToDouble;
2424

25-
import nl.jqno.equalsverifier.EqualsVerifier;
26-
2725
import java.util.Random;
2826
import java.util.function.Supplier;
2927

@@ -76,9 +74,4 @@ public void ofDegrees() {
7674
);
7775
}
7876

79-
@Test
80-
public void equalsVerifier() {
81-
EqualsVerifier.forClass(Longitude.class).verify();
82-
}
83-
8477
}

0 commit comments

Comments
 (0)