From d48a591c15dd76ced40d3e7e75ea32b2feecabe1 Mon Sep 17 00:00:00 2001 From: Mark Raynsford Date: Sat, 4 May 2024 15:08:07 +0000 Subject: [PATCH] Eliminate jstructural Affects: https://github.com/io7m-com/.github/issues/2 --- README.in | 41 ++++ README.md | 42 ++++ .../pom.xml | 201 ------------------ .../src/main/assembly/documentation.xml | 21 -- .../documentation/Documentation.java | 29 --- .../documentation/package-info.java | 22 -- .../src/main/java/module-info.java | 29 --- .../timehack6435126/documentation/brand.xml | 9 - .../documentation/documentation.css | 68 ------ .../documentation/documentation.xml | 180 ---------------- pom.xml | 12 +- 11 files changed, 87 insertions(+), 567 deletions(-) create mode 100644 README.in delete mode 100644 com.io7m.timehack6435126.documentation/pom.xml delete mode 100644 com.io7m.timehack6435126.documentation/src/main/assembly/documentation.xml delete mode 100644 com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/Documentation.java delete mode 100644 com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/package-info.java delete mode 100644 com.io7m.timehack6435126.documentation/src/main/java/module-info.java delete mode 100644 com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/brand.xml delete mode 100644 com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.css delete mode 100644 com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.xml diff --git a/README.in b/README.in new file mode 100644 index 0000000..55d82c7 --- /dev/null +++ b/README.in @@ -0,0 +1,41 @@ + +## timehack6435126 + +A high-resolutiom timer JVM bug workaround. + +## Features + +* Enables high-resolution timers in the JVM. +* [OSGi-ready](https://www.osgi.org/) +* [JPMS-ready](https://en.wikipedia.org/wiki/Java_Platform_Module_System) +* ISC license. + +## Motivation + +The `com.io7m.timehack6435126` package implements the workaround for the +comedy of errors described by `JDK-6435126`. + +1. Oracle introduce a JVM option ForceTimeHighResolution intended to force + Windows based operating systems into using a high resolution timer instead + of the usual low precision one. +2. Due to a mistake in the implementation, the ForceTimeHighResolution option + actually ends up forcing the OS not to use the high resolution timer. +3. Years pass, and someone files a bug on the broken behaviour. +4. An anonymous developer at the company states that the behaviour has been + broken for years, nobody has complained, and reasons that this means that + users that are specifically asking for high resolution timers are satisfied + with instead receiving low resolution timers. +5. Someone suggests a workaround that can be used at run-time to enable the + high resolution timer. +6. Years pass. +7. An anonymous developer at the company states that the behaviour has been + broken for so long, that there's no reason to fix it now. +8. The bug is rejected as "WONTFIX". + +## Usage + +Call `TimeHack6435126.enableHighResolutionTimer()` in your program's main +function prior to doing anything else. + +All timer-related functions in the JVM will be significantly more precise +from that point onwards. diff --git a/README.md b/README.md index 605fe1d..2e5403a 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,45 @@ timehack6435126 | OpenJDK (Temurin) LTS | Linux | [![Build (OpenJDK (Temurin) LTS, Linux)](https://img.shields.io/github/actions/workflow/status/io7m-com/timehack6435126/main.linux.temurin.lts.yml)](https://www.github.com/io7m-com/timehack6435126/actions?query=workflow%3Amain.linux.temurin.lts)| | OpenJDK (Temurin) Current | Windows | [![Build (OpenJDK (Temurin) Current, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/timehack6435126/main.windows.temurin.current.yml)](https://www.github.com/io7m-com/timehack6435126/actions?query=workflow%3Amain.windows.temurin.current)| | OpenJDK (Temurin) LTS | Windows | [![Build (OpenJDK (Temurin) LTS, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/timehack6435126/main.windows.temurin.lts.yml)](https://www.github.com/io7m-com/timehack6435126/actions?query=workflow%3Amain.windows.temurin.lts)| + +## timehack6435126 + +A high-resolutiom timer JVM bug workaround. + +## Features + +* Enables high-resolution timers in the JVM. +* [OSGi-ready](https://www.osgi.org/) +* [JPMS-ready](https://en.wikipedia.org/wiki/Java_Platform_Module_System) +* ISC license. + +## Motivation + +The `com.io7m.timehack6435126` package implements the workaround for the +comedy of errors described by `JDK-6435126`. + +1. Oracle introduce a JVM option ForceTimeHighResolution intended to force + Windows based operating systems into using a high resolution timer instead + of the usual low precision one. +2. Due to a mistake in the implementation, the ForceTimeHighResolution option + actually ends up forcing the OS not to use the high resolution timer. +3. Years pass, and someone files a bug on the broken behaviour. +4. An anonymous developer at the company states that the behaviour has been + broken for years, nobody has complained, and reasons that this means that + users that are specifically asking for high resolution timers are satisfied + with instead receiving low resolution timers. +5. Someone suggests a workaround that can be used at run-time to enable the + high resolution timer. +6. Years pass. +7. An anonymous developer at the company states that the behaviour has been + broken for so long, that there's no reason to fix it now. +8. The bug is rejected as "WONTFIX". + +## Usage + +Call `TimeHack6435126.enableHighResolutionTimer()` in your program's main +function prior to doing anything else. + +All timer-related functions in the JVM will be significantly more precise +from that point onwards. + diff --git a/com.io7m.timehack6435126.documentation/pom.xml b/com.io7m.timehack6435126.documentation/pom.xml deleted file mode 100644 index d5039b1..0000000 --- a/com.io7m.timehack6435126.documentation/pom.xml +++ /dev/null @@ -1,201 +0,0 @@ - - - - - 4.0.0 - - com.io7m.timehack6435126 - com.io7m.timehack6435126 - 3.0.1-SNAPSHOT - - com.io7m.timehack6435126.documentation - - jar - com.io7m.timehack6435126.documentation - Java high-resolution timer bug workaround (Documentation) - https://www.io7m.com/software/timehack6435126 - - - true - - - - - ${project.groupId} - com.io7m.timehack6435126.core - ${project.version} - - - - org.osgi - org.osgi.annotation.versioning - provided - - - org.osgi - org.osgi.annotation.bundle - provided - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-documentation-resources - - copy-resources - - generate-resources - - ${project.build.directory}/documentation/ - - - src/main/resources/com/io7m/timehack6435126/documentation/ - true - - - - - - - - - - com.io7m.jstructural - io7m-jstructural-maven-plugin - - - make-documentation-single - prepare-package - - transform - - - ${project.build.directory}/documentation/documentation.xml - ${project.build.directory}/documentation/ - ${project.build.directory}/documentation/brand.xml - XHTML_SINGLE - - - - make-documentation-multi - prepare-package - - transform - - - ${project.build.directory}/documentation/documentation.xml - ${project.build.directory}/documentation/ - ${project.build.directory}/documentation/brand.xml - XHTML_MULTI - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - attach-javadocs - package - - jar - - - - - - ${project.name} - ${project.version} - io7m.com - ${project.name} - ${project.version} - io7m.com - ${project.groupId} - io7m - - - - - - - javadoc-aggregate - package - - javadoc-no-fork - - - - ${project.build.directory}/apidocs - true - true - - com.io7m.timehack6435126* - - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - src/main/assembly/documentation.xml - - - - - make-assembly - package - - single - - - false - - - - - - - - - org.codehaus.mojo - truezip-maven-plugin - false - - - copy-site-documentation - - copy - - site - - true - - ${project.build.directory}/${project.name}-${project.version}.zip/${project.name}-${project.version}/ - ${project.parent.build.directory}/minisite/documentation/ - - - - - - - - - diff --git a/com.io7m.timehack6435126.documentation/src/main/assembly/documentation.xml b/com.io7m.timehack6435126.documentation/src/main/assembly/documentation.xml deleted file mode 100644 index 0b5d459..0000000 --- a/com.io7m.timehack6435126.documentation/src/main/assembly/documentation.xml +++ /dev/null @@ -1,21 +0,0 @@ - - documentation - ${project.name}-${project.version} - - zip - - - - ${project.build.directory}/documentation - / - - - ${project.build.directory}/site/apidocs - /apidocs - - - - diff --git a/com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/Documentation.java b/com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/Documentation.java deleted file mode 100644 index 88fc738..0000000 --- a/com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/Documentation.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright © 2014 Mark Raynsford https://www.io7m.com - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR - * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package com.io7m.timehack6435126.documentation; - -/** - * Functions for retrieving the documentation. - */ - -public final class Documentation -{ - private Documentation() - { - - } -} diff --git a/com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/package-info.java b/com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/package-info.java deleted file mode 100644 index 36d0c4c..0000000 --- a/com.io7m.timehack6435126.documentation/src/main/java/com/io7m/timehack6435126/documentation/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright © 2014 Mark Raynsford https://www.io7m.com - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR - * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/** - * Documentation. - */ - -package com.io7m.timehack6435126.documentation; - diff --git a/com.io7m.timehack6435126.documentation/src/main/java/module-info.java b/com.io7m.timehack6435126.documentation/src/main/java/module-info.java deleted file mode 100644 index eb8524a..0000000 --- a/com.io7m.timehack6435126.documentation/src/main/java/module-info.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright © 2014 Mark Raynsford https://www.io7m.com - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR - * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/** - * Java high-resolution timer bug workaround (Documentation) - */ - -module com.io7m.timehack6435126.documentation -{ - requires static org.osgi.annotation.bundle; - requires static org.osgi.annotation.versioning; - - requires com.io7m.timehack6435126.core; - - exports com.io7m.timehack6435126.documentation; -} \ No newline at end of file diff --git a/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/brand.xml b/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/brand.xml deleted file mode 100644 index 61f9658..0000000 --- a/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/brand.xml +++ /dev/null @@ -1,9 +0,0 @@ - -
-
- io7m -
-
- ${project.parent.name} ${project.version} -
-
\ No newline at end of file diff --git a/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.css b/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.css deleted file mode 100644 index 048757e..0000000 --- a/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.css +++ /dev/null @@ -1,68 +0,0 @@ -.brand -{ - font-size: 75%; - font-family: monospace; -} - -.brand_left -{ - float: left; -} - -.brand_right -{ - text-align: right; -} - -.package -{ - font-family: monospace; - font-weight: bold; -} - -.emphasis -{ - font-style: italic; -} - -.attribute, -.class, -.command, -.constant, -.element, -.file, -.function, -.keyword, -.type -{ - font-family: monospace; -} - -.example, .license, .terminal -{ - font-family: monospace; - border: 1px solid #ccc; - padding-top: 1.0em; - padding-left: 1.0em; - padding-bottom: 1.0em; - margin-top: 1.2em; - overflow: auto; -} - -.dependencies table td -{ - padding-right: 3.0em; - font-family: monospace; - font-size: 9pt; -} - -.platforms table td -{ - padding-right: 2.0em; -} -.platforms table tbody, -.platforms table thead -{ - font-size: 8pt; - font-family: monospace; -} diff --git a/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.xml b/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.xml deleted file mode 100644 index 73fa583..0000000 --- a/com.io7m.timehack6435126.documentation/src/main/resources/com/io7m/timehack6435126/documentation/documentation.xml +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - ${project.parent.name} ${project.version} Documentation - documentation.css - - - - Package Information - - - Orientation - - Overview - - The ${project.parent.name} package - implements the workaround for the comedy of errors described by - JDK-6435126. - - - Specifically: - - - Sequence of accidents - - - Oracle introduce a JVM option ForceTimeHighResolution - intended to force Windows based operating systems into using a high resolution - timer instead of the usual low precision one. - - - Due to a mistake in the implementation, the - ForceTimeHighResolution option actually - ends up forcing the OS not to use - the high resolution timer. - - - Years pass, and someone files a bug on the broken behaviour. - - - An anonymous developer at the company states that the behaviour - has been broken for years, nobody has complained, and reasons that - this means that users that are specifically asking for high resolution - timers are satisfied with instead receiving low resolution timers. - - - Someone suggests a workaround that can be used at run-time to - enable the high resolution timer. - - - Years pass. - - - An anonymous developer at the company states that the behaviour - has been broken for so long, that there's no reason to fix it - now. - - - The bug is rejected as "WONTFIX". - - - - - - - - Installation - - Source compilation - - The project can be compiled and installed with - Maven: - - - - - - - - Maven - - Regular releases are made to the - Central Repository, - so it's possible to use the ${project.parent.name} - package in your projects with the following Maven dependency: - - - - ${project.groupId} - ${project.parent.artifactId}-core - ${project.version} -]]> - - - All io7m.com - packages use Semantic Versioning - - http://semver.org - , which implies that it is always safe to use version ranges - with an exclusive upper bound equal to the next major version - the API of - the package will not change in a backwards-incompatible manner before the - next major version. - - - - - - Platform Specific Issues - - Ironically, there are currently no known platform-specific issues. - - - - - License - - All files distributed with the ${project.parent.name} - package are placed under the following license: - https://www.io7m.com - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.]]> - - - - - - - Usage - - - Usage - - Call TimeHack6435126.enableHighResolutionTimer() - in your program's main function prior to doing - anything else. - - - - - - API Reference - - - Javadoc - - API documentation for the package is provided via the - included Javadoc. - - - - - diff --git a/pom.xml b/pom.xml index b3342e7..4618fc3 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,6 @@ com.io7m.timehack6435126.core - com.io7m.timehack6435126.documentation @@ -67,6 +66,10 @@ sonatype-nexus-staging https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + sonatype-nexus-snapshots + https://s01.oss.sonatype.org/content/repositories/snapshots/ + @@ -118,13 +121,6 @@ - - - com.io7m.jstructural - io7m-jstructural-maven-plugin - 5.0.0 - - com.github.spotbugs