Skip to content

Commit a45475c

Browse files
committed
Migration to Java 25
1 parent 42a79a7 commit a45475c

10 files changed

Lines changed: 17 additions & 18 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Features in development:
1616

1717
## Building
1818

19-
You need Java 21 and [Gradle](https://gradle.org/)
19+
You need Java 25 and [Gradle](https://gradle.org/)
2020

2121
- Clone this repository
22-
- Point your JAVA_HOME variable to JDK 21
22+
- Point your JAVA_HOME variable to JDK 25
2323
- Run `gradle` to compile the source code
2424

2525
``` text

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
java {
66
toolchain {
7-
languageVersion = JavaLanguageVersion.of(21)
7+
languageVersion = JavaLanguageVersion.of(25)
88
}
99
}
1010

lib/xmljava.jar

-62 Bytes
Binary file not shown.

sonar-project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
sonar.projectKey=XMLJava
33
# this is the name displayed in the SonarQube UI
44
sonar.projectName=XMLJava
5-
sonar.projectVersion=4.1.0
5+
sonar.projectVersion=5.0.0
66

77
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
88
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
99
# If not set, SonarQube starts looking for source code from the directory containing
1010
# the sonar-project.properties file.
1111
sonar.sources=src
12-
sonar.java.source=21
12+
sonar.java.source=25
1313
sonar.java.binaries=bin
1414
sonar.java.libraries=lib
1515
sonar.scm.provider=git

src/com/maxprograms/xml/Catalog.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public InputSource resolveEntity(String name, String publicId, String baseURI, S
442442
return new InputSource(uri.toURL().openStream());
443443
}
444444
return new InputSource(new FileInputStream(uri.toURL().toString()));
445-
} catch (URISyntaxException | IllegalArgumentException | NullPointerException e) {
445+
} catch (URISyntaxException | IllegalArgumentException | NullPointerException _) {
446446
// ignore
447447
}
448448
if (dtdPublicEntities != null && publicId != null && dtdPublicEntities.containsKey(publicId)) {
@@ -578,7 +578,7 @@ public String matchSystem(String baseURI, String systemId) {
578578
if (file.exists()) {
579579
return file.getAbsolutePath();
580580
}
581-
} catch (MalformedURLException | URISyntaxException | IllegalArgumentException e) {
581+
} catch (MalformedURLException | URISyntaxException | IllegalArgumentException _) {
582582
// ignore
583583
}
584584
}
@@ -628,7 +628,7 @@ public String matchURI(String uri) {
628628
if (u.isAbsolute() && u.toURL().getProtocol().startsWith("file")) {
629629
return u.toString();
630630
}
631-
} catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) {
631+
} catch (URISyntaxException | MalformedURLException | IllegalArgumentException _) {
632632
// ignore
633633
}
634634
}
@@ -681,7 +681,7 @@ public void parseDTD(String publicId) {
681681
EntityDecl entity = it.next();
682682
addDtdSystemEntity(entity.getValue(), entity.getSystemId());
683683
}
684-
} catch (IOException | SAXException e) {
684+
} catch (IOException | SAXException _) {
685685
// do nothing
686686
MessageFormat mf = new MessageFormat(Messages.getString("Catalog.0"));
687687
logger.log(Level.WARNING, mf.format(new String[] { publicId }));

src/com/maxprograms/xml/Constants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
public class Constants {
1414

15-
public static final String VERSION = "4.2.0";
16-
public static final String BUILD = "20260601_1626";
15+
public static final String VERSION = "5.0.0";
16+
public static final String BUILD = "20260609_1150";
1717

1818
private Constants() {
1919
// private for security

src/com/maxprograms/xml/CustomContentHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc
100100
}
101101
}
102102
current = stack.pop();
103-
} catch (EmptyStackException es) {
103+
} catch (EmptyStackException _) {
104104
throw new SAXException(Messages.getString("CustomContentHandler.0"));
105105
}
106106
}
@@ -215,7 +215,7 @@ public void setDocumentLocator(Locator locator) {
215215
}
216216
try {
217217
documentBase = new File(new URI(sysId)).getParentFile();
218-
} catch (Exception e) {
218+
} catch (Exception _) {
219219
documentBase = new File(sysId).getParentFile();
220220
}
221221
}

src/com/maxprograms/xml/DTDResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws IOExce
2828
if (file.exists()) {
2929
return new InputSource(new FileInputStream(file));
3030
}
31-
} catch (URISyntaxException e) {
31+
} catch (URISyntaxException _) {
3232
// ignore
3333
}
3434
return null;

src/com/maxprograms/xml/Messages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static String getString(String key) {
4848
}
4949
}
5050
return props.getProperty(key, '!' + key + '!');
51-
} catch (IOException | NullPointerException e) {
51+
} catch (IOException | NullPointerException _) {
5252
return '!' + key + '!';
5353
}
5454
}

src/com/maxprograms/xml/RelaxNGParser.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private void nameAttribute(Element e, Map<String, String> context) {
187187
nameEl.setAttribute("ns", e.getAttributeValue("ns"));
188188
e.removeAttribute("ns");
189189
} else {
190-
String resolvedNs = resolveNamespaceBinding(value, currentContext, isElementPattern, isAttributePattern);
190+
String resolvedNs = resolveNamespaceBinding(value, currentContext, isElementPattern);
191191
if (resolvedNs != null && !resolvedNs.isEmpty()) {
192192
nameEl.setAttribute("ns", resolvedNs);
193193
}
@@ -216,8 +216,7 @@ private Map<String, String> augmentNamespaceContext(Map<String, String> base, El
216216
return updated;
217217
}
218218

219-
private String resolveNamespaceBinding(String lexicalName, Map<String, String> context, boolean isElementPattern,
220-
boolean isAttributePattern) {
219+
private String resolveNamespaceBinding(String lexicalName, Map<String, String> context, boolean isElementPattern) {
221220
int separatorIndex = lexicalName.indexOf(':');
222221
if (separatorIndex == -1) {
223222
if (isElementPattern) {

0 commit comments

Comments
 (0)