Skip to content

Commit 1f36365

Browse files
authored
Modernize build tooling and tuple string hashing support (#99)
1 parent 4a69691 commit 1f36365

40 files changed

Lines changed: 2753 additions & 2771 deletions

.github/workflows/build.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,31 @@ on:
55
- ea
66
- develop
77
pull_request:
8-
types: [opened, synchronize, reopened]
8+
types: [ opened, synchronize, reopened ]
9+
env:
10+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
11+
912
jobs:
1013
build:
1114
name: Build
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1518
with:
1619
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17-
- name: Set up JDK 11
18-
uses: actions/setup-java@v1
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
1922
with:
20-
java-version: 11
23+
distribution: temurin
24+
java-version: 17
2125
- name: Cache SonarCloud packages
22-
uses: actions/cache@v1
26+
uses: actions/cache@v4
2327
with:
2428
path: ~/.sonar/cache
2529
key: ${{ runner.os }}-sonar
2630
restore-keys: ${{ runner.os }}-sonar
2731
- name: Cache Maven packages
28-
uses: actions/cache@v1
32+
uses: actions/cache@v4
2933
with:
3034
path: ~/.m2
3135
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
import java.net.*;
1718
import java.io.*;
1819
import java.nio.channels.*;
@@ -25,7 +26,7 @@ public class MavenWrapperDownloader {
2526
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
2627
*/
2728
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28-
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
2930

3031
/**
3132
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
@@ -54,7 +55,7 @@ public static void main(String args[]) {
5455
// wrapperUrl parameter.
5556
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
5657
String url = DEFAULT_DOWNLOAD_URL;
57-
if(mavenWrapperPropertyFile.exists()) {
58+
if (mavenWrapperPropertyFile.exists()) {
5859
FileInputStream mavenWrapperPropertyFileInputStream = null;
5960
try {
6061
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
@@ -65,7 +66,7 @@ public static void main(String args[]) {
6566
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
6667
} finally {
6768
try {
68-
if(mavenWrapperPropertyFileInputStream != null) {
69+
if (mavenWrapperPropertyFileInputStream != null) {
6970
mavenWrapperPropertyFileInputStream.close();
7071
}
7172
} catch (IOException e) {
@@ -76,8 +77,8 @@ public static void main(String args[]) {
7677
System.out.println("- Downloading from: " + url);
7778

7879
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79-
if(!outputFile.getParentFile().exists()) {
80-
if(!outputFile.getParentFile().mkdirs()) {
80+
if (!outputFile.getParentFile().exists()) {
81+
if (!outputFile.getParentFile().mkdirs()) {
8182
System.out.println(
8283
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
8384
}

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ jobs:
3232
- arch: s390x
3333
jdk: openjdk7 # target release on big-endian machine
3434
install:
35-
- wget -O ibmjdk7.bin -q -T 10 -t 5 https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.1.4.85/linux/s390x/ibm-java-sdk-7.1-4.85-s390x-archive.bin
36-
- echo "6a901bc0b713582a323481d5b41d0c289cbd6fbb265eefb4962080240fe59ff2 ibmjdk7.bin" | sha256sum -c -
37-
- chmod +x ibmjdk7.bin
38-
- echo "INSTALLER_UI=silent" > response.properties
39-
- echo "USER_INSTALL_DIR=$PWD/ibmjdk7" >> response.properties
40-
- echo "LICENSE_ACCEPTED=TRUE" >> response.properties
41-
- ./ibmjdk7.bin -i silent -f response.properties
42-
- export PATH="$PWD/ibmjdk7/bin:$PATH"
43-
- export JAVA_HOME="$PWD/ibmjdk7"
44-
- java -version
35+
- wget -O ibmjdk7.bin -q -T 10 -t 5 https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.1.4.85/linux/s390x/ibm-java-sdk-7.1-4.85-s390x-archive.bin
36+
- echo "6a901bc0b713582a323481d5b41d0c289cbd6fbb265eefb4962080240fe59ff2 ibmjdk7.bin" | sha256sum -c -
37+
- chmod +x ibmjdk7.bin
38+
- echo "INSTALLER_UI=silent" > response.properties
39+
- echo "USER_INSTALL_DIR=$PWD/ibmjdk7" >> response.properties
40+
- echo "LICENSE_ACCEPTED=TRUE" >> response.properties
41+
- ./ibmjdk7.bin -i silent -f response.properties
42+
- export PATH="$PWD/ibmjdk7/bin:$PATH"
43+
- export JAVA_HOME="$PWD/ibmjdk7"
44+
- java -version
4545

4646
cache:
4747
directories:

pom.xml

Lines changed: 4 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
99

10-
<parent>
10+
<parent>
1111
<groupId>net.openhft</groupId>
1212
<artifactId>java-parent-pom</artifactId>
1313
<version>2026.0</version>
@@ -239,7 +239,7 @@
239239
<dependency>
240240
<groupId>org.apache.maven.scm</groupId>
241241
<artifactId>maven-scm-provider-gitexe</artifactId>
242-
<version>1.11.2</version> <!-- this version should be sync with the scmVersion of maven-release-plugin -->
242+
<version>1.11.2</version> <!-- this version should be sync with the scmVersion of maven-release-plugin -->
243243
</dependency>
244244
</dependencies>
245245
</plugin>
@@ -258,7 +258,7 @@
258258
</configuration>
259259
</plugin>
260260

261-
<plugin>
261+
<plugin>
262262
<groupId>org.apache.felix</groupId>
263263
<artifactId>maven-bundle-plugin</artifactId>
264264
<extensions>true</extensions>
@@ -309,7 +309,7 @@
309309
<properties>
310310
<project.jdk.min-version>1.${project.target.release}</project.jdk.min-version>
311311
<maven.bundle.plugin.version>3.5.1</maven.bundle.plugin.version>
312-
<doclint />
312+
<doclint/>
313313
</properties>
314314
</profile>
315315
<profile>
@@ -381,77 +381,5 @@
381381
</plugins>
382382
</build>
383383
</profile>
384-
<profile>
385-
<id>quality</id>
386-
<build>
387-
<plugins>
388-
<plugin>
389-
<groupId>org.apache.maven.plugins</groupId>
390-
<artifactId>maven-checkstyle-plugin</artifactId>
391-
<version>3.6.0</version>
392-
<executions>
393-
<execution>
394-
<id>validate</id>
395-
<phase>validate</phase>
396-
<goals>
397-
<goal>check</goal>
398-
</goals>
399-
</execution>
400-
</executions>
401-
<configuration>
402-
<configLocation>${checkstyle.config.location}</configLocation>
403-
<failOnViolation>true</failOnViolation>
404-
<logViolationsToConsole>true</logViolationsToConsole>
405-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
406-
<violationSeverity>${checkstyle.violationSeverity}</violationSeverity>
407-
</configuration>
408-
<dependencies>
409-
<dependency>
410-
<groupId>com.puppycrawl.tools</groupId>
411-
<artifactId>checkstyle</artifactId>
412-
<version>10.26.1</version>
413-
</dependency>
414-
<dependency>
415-
<groupId>net.openhft</groupId>
416-
<artifactId>chronicle-quality-rules</artifactId>
417-
<version>1.27.0-SNAPSHOT</version>
418-
</dependency>
419-
</dependencies>
420-
</plugin>
421-
<plugin>
422-
<groupId>com.github.spotbugs</groupId>
423-
<artifactId>spotbugs-maven-plugin</artifactId>
424-
<!-- SpotBugs 4.x line that requires Java 11+ -->
425-
<version>4.9.8.1</version>
426-
<configuration>
427-
<effort>Max</effort>
428-
<threshold>Low</threshold>
429-
<includeTests>true</includeTests>
430-
<failOnError>true</failOnError>
431-
<!-- Shared SpotBugs filters from chronicle-quality-rules -->
432-
<includeFilterFile>net/openhft/quality/spotbugs27/chronicle-spotbugs-include.xml</includeFilterFile>
433-
<excludeFilterFile>net/openhft/quality/spotbugs27/chronicle-spotbugs-exclude.xml</excludeFilterFile>
434-
</configuration>
435-
<dependencies>
436-
<dependency>
437-
<groupId>net.openhft</groupId>
438-
<artifactId>chronicle-quality-rules</artifactId>
439-
<version>1.27.0-SNAPSHOT</version>
440-
</dependency>
441-
</dependencies>
442-
<executions>
443-
<execution>
444-
<id>spotbugs-main</id>
445-
<!-- Run after compilation of main classes, before tests execute, and gate on findings -->
446-
<phase>process-test-classes</phase>
447-
<goals>
448-
<goal>check</goal>
449-
</goals>
450-
</execution>
451-
</executions>
452-
</plugin>
453-
</plugins>
454-
</build>
455-
</profile>
456384
</profiles>
457385
</project>

src/main/java-stub/java/lang/Math.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
/**
77
* Stub for JDK internal ckass java.lang.Math.
8-
*
8+
* <p>
99
* - When crossing compiling for Java SE 7 and 8, this stub class can be used for detecting
10-
* Math#multiplyHigh() method at runtime.
10+
* Math#multiplyHigh() method at runtime.
1111
* - Only used methods are exported.
1212
* - In test and production runtime, the real class is loaded from boot classpath.
1313
*/
1414

1515
public class Math {
16-
public static long multiplyHigh(long x, long y) { throw new UnsupportedOperationException(); }
16+
public static long multiplyHigh(long x, long y) {
17+
throw new UnsupportedOperationException();
18+
}
1719
}

src/main/java-stub/sun/misc/Unsafe.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,29 @@
55

66
/**
77
* Stub for JDK internal ckass sun.misc.Unsafe.
8-
*
8+
* <p>
99
* - When crossing compiling for Java SE 7 and 8, this stub class can bypass compiler sun-api
10-
* warnings.
10+
* warnings.
1111
* - Only used methods are exported.
1212
* - In test and production runtime, the real class is loaded from boot classpath.
1313
*/
1414

1515
public final class Unsafe {
16-
public native Object getObject( Object o, long offset);
17-
public native int getInt( Object o, long offset);
16+
public native Object getObject(Object o, long offset);
17+
18+
public native int getInt(Object o, long offset);
19+
1820
public native boolean getBoolean(Object o, long offset);
19-
public native byte getByte( Object o, long offset);
20-
public native short getShort( Object o, long offset);
21-
public native char getChar( Object o, long offset);
22-
public native long getLong( Object o, long offset);
21+
22+
public native byte getByte(Object o, long offset);
23+
24+
public native short getShort(Object o, long offset);
25+
26+
public native char getChar(Object o, long offset);
27+
28+
public native long getLong(Object o, long offset);
2329

2430
public native long objectFieldOffset(java.lang.reflect.Field f);
31+
2532
public native int arrayBaseOffset(Class arrayClass);
2633
}

0 commit comments

Comments
 (0)