update to OpenJDK 21, Gradle 8.4-rc-1

This commit is contained in:
Jörg Prante 2023-09-30 22:22:33 +02:00
parent 344e234fc3
commit ad6cd526fa
15 changed files with 62 additions and 82 deletions

View file

@ -4,10 +4,10 @@ plugins {
id "pmd"
id 'maven-publish'
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "com.github.spotbugs" version "5.0.14"
id "org.cyclonedx.bom" version "1.7.2"
id "org.xbib.gradle.plugin.asciidoctor" version "2.5.2.2"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0-rc-1"
id "com.github.spotbugs" version "6.0.0-beta.3"
id "org.cyclonedx.bom" version "1.7.4"
id "org.xbib.gradle.plugin.asciidoctor" version "3.0.0"
}
wrapper {
@ -38,7 +38,7 @@ subprojects {
apply from: rootProject.file('gradle/documentation/asciidoc.gradle')
apply from: rootProject.file('gradle/quality/checkstyle.gradle')
apply from: rootProject.file('gradle/quality/pmd.gradle')
apply from: rootProject.file('gradle/quality/spotbugs.gradle')
//apply from: rootProject.file('gradle/quality/spotbugs.gradle')
apply from: rootProject.file('gradle/publish/maven.gradle')
}
apply from: rootProject.file('gradle/publish/sonatype.gradle')

View file

@ -1,5 +1,5 @@
group = org.xbib
name = net
version = 3.3.4
version = 4.0.0
org.gradle.warning.mode = ALL

Binary file not shown.

View file

@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-rc-1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

22
gradlew vendored
View file

@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \

View file

@ -23,10 +23,10 @@ public class PathDecoder {
this.path = PathNormalizer.normalize(path);
this.params = Parameter.builder().domain(Parameter.Domain.PATH).enablePercentDecoding();
if (query != null) {
parse(query);
this.params.add(query);
}
if (queryString != null) {
parse(queryString);
this.params.add(queryString);
}
}

View file

@ -30,11 +30,16 @@ public class PathMatcher {
}
public PathMatcher(String pathSeparator) {
setPathSeparator(pathSeparator);
this.pathSeparator = pathSeparator;
update();
}
public void setPathSeparator(String pathSeparator) {
this.pathSeparator = pathSeparator != null ? pathSeparator : DEFAULT_PATH_SEPARATOR;
this.pathSeparator = pathSeparator;
update();
}
private void update() {
this.endsOnWildCard = this.pathSeparator + "*";
this.endsOnDoubleWildCard = this.pathSeparator + "**";
this.caseSensitive = true;

View file

@ -38,8 +38,7 @@ public class RegexPathElement extends PathElement {
this.pattern = buildPattern(regex, completePattern);
}
public Pattern buildPattern(char[] regex, char[] completePattern) {
private Pattern buildPattern(char[] regex, char[] completePattern) {
StringBuilder patternBuilder = new StringBuilder();
String text = new String(regex);
Matcher matcher = GLOB_PATTERN.matcher(text);

View file

@ -52,7 +52,7 @@ public class Path {
return new Path(pathSpec);
}
public void init(String pathSpec, String pathSeparator, boolean trimTokens, boolean caseSensitive) {
protected final void init(String pathSpec, String pathSeparator, boolean trimTokens, boolean caseSensitive) {
this.pathSpec = PathNormalizer.normalize(pathSpec);
this.pathSeparator = pathSeparator;
this.trimTokens = trimTokens;
@ -140,11 +140,11 @@ public class Path {
return Objects.hash(pathSpec, parameterCount, singleWildcards, doubleWildcards, catchAllPattern, prefixPattern, length);
}
public List<PathSegment> tokenize(String string) {
protected final List<PathSegment> tokenize(String string) {
return tokenize(string, pathSeparator, trimTokens, caseSensitive);
}
public static List<PathSegment> tokenize(String string, String pathSeparator, boolean trimTokens, boolean caseSensitive) {
protected static List<PathSegment> tokenize(String string, String pathSeparator, boolean trimTokens, boolean caseSensitive) {
List<PathSegment> pathSegments = new ArrayList<>();
if (string == null) {
return pathSegments;
@ -155,7 +155,7 @@ public class Path {
if (trimTokens) {
token = token.trim();
}
if (token.length() > 0) {
if (!token.isEmpty()) {
if (!caseSensitive) {
token = token.toLowerCase(Locale.ROOT);
}

View file

@ -1538,43 +1538,29 @@ public final class IRI extends ResourceIdentifier
* or if some other error occurred while constructing the URL
*/
public URL toURL() throws MalformedURLException {
return fromURI(this);
}
/**
* Creates a URL from an IRI, as if by invoking {@code iri.toURL()}.
*
*/
static URL fromURI(IRI uri) throws MalformedURLException {
if (!uri.isAbsolute()) {
if (!isAbsolute()) {
throw new IllegalArgumentException("URI is not absolute");
}
String protocol = uri.getScheme();
String protocol = getScheme();
// In general we need to go via Handler.parseURL, but for the jrt
// protocol we enforce that the Handler is not overrideable and can
// optimize URI to URL conversion.
//
// Case-sensitive comparison for performance; malformed protocols will
// be handled correctly by the slow path.
if (protocol.equals("jrt") && !uri.isOpaque()
&& uri.getRawFragment() == null) {
String query = uri.getRawQuery();
String path = uri.getRawPath();
if (protocol.equals("jrt") && !isOpaque()
&& getRawFragment() == null) {
String query = getRawQuery();
String path = getRawPath();
String file = (query == null) ? path : path + "?" + query;
// URL represent undefined host as empty string while URI use null
String host = uri.getHost();
String host = getHost();
if (host == null) {
host = "";
}
int port = uri.getPort();
return new URL("jrt", host, port, file, null);
int port = getPort();
return URI.create("jrt://" + host + ":" + port + "/" + file).toURL();
} else {
return new URL((URL)null, uri.toString(), null);
return URI.create(toString()).toURL();
}
}

View file

@ -1180,44 +1180,30 @@ public final class URI extends ResourceIdentifier
* or if some other error occurred while constructing the URL
*/
public URL toURL() throws MalformedURLException {
return fromURI(this);
}
/**
* Creates a URL from a URI, as if by invoking {@code uri.toURL()}.
*
* @see java.net.URI#toURL()
*/
static URL fromURI(URI uri) throws MalformedURLException {
if (!uri.isAbsolute()) {
if (!isAbsolute()) {
throw new IllegalArgumentException("URI is not absolute");
}
String protocol = uri.getScheme();
String protocol = getScheme();
// In general we need to go via Handler.parseURL, but for the jrt
// protocol we enforce that the Handler is not overrideable and can
// optimize URI to URL conversion.
//
// Case-sensitive comparison for performance; malformed protocols will
// be handled correctly by the slow path.
if (protocol.equals("jrt") && !uri.isOpaque()
&& uri.getRawFragment() == null) {
String query = uri.getRawQuery();
String path = uri.getRawPath();
if (protocol.equals("jrt") && !isOpaque()
&& getRawFragment() == null) {
String query = getRawQuery();
String path = getRawPath();
String file = (query == null) ? path : path + "?" + query;
// URL represent undefined host as empty string while URI use null
String host = uri.getHost();
String host = getHost();
if (host == null) {
host = "";
}
int port = uri.getPort();
return new URL("jrt", host, port, file, null);
int port = getPort();
return URI.create("jrt://" + host + ":" + port + "/" + file).toURL();
} else {
return new URL((URL)null, uri.toString(), null);
return URI.create(toString()).toURL();
}
}

View file

@ -438,14 +438,14 @@ public class URL implements Comparable<URL> {
return externalStringRepresentation;
}
public java.net.URL toURL() throws MalformedURLException {
return new java.net.URL(toString());
}
public URI toURI() {
return URI.create(toString());
}
public java.net.URL toURL() throws MalformedURLException {
return toURI().toURL();
}
public Path toPath() {
return Paths.get(toURI());
}

View file

@ -34,12 +34,11 @@ public class JsonFileStore implements Store<Map<String, Object>> {
private final Path path;
public JsonFileStore(String name, Path path, long expireAfterSeconds) throws IOException {
public JsonFileStore(String name, Path path) throws IOException {
this.name = name;
this.path = path;
this.lock = new ReentrantReadWriteLock();
Files.createDirectories(path);
purge(expireAfterSeconds);
}
@Override

View file

@ -22,7 +22,7 @@ public class JsonFileStoreTest {
@BeforeAll
public static void before() throws IOException {
Path path = Files.createTempDirectory("jsonstore");
jsonFileStore = new JsonFileStore("test", path, 3600L);
jsonFileStore = new JsonFileStore("test", path);
}
@AfterAll

View file

@ -15,7 +15,7 @@ pluginManagement {
dependencyResolutionManagement {
versionCatalogs {
libs {
version('gradle', '8.1.1')
version('gradle', '8.4-rc-1')
version('junit', '5.10.0')
library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')
library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit')