Skip to content

Commit 01e814b

Browse files
author
Dennis Labordus
authored
Merge pull request #200 from com-pas/develop
New release
2 parents bd204ad + 978d6fa commit 01e814b

File tree

21 files changed

+102
-143
lines changed

21 files changed

+102
-143
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ updates:
2828
interval: "daily"
2929
open-pull-requests-limit: 5
3030
ignore:
31-
# Next two dependencies shouldn't be upgrade, because Quarkus isn't using newer version of EL.
32-
- dependency-name: org.hibernate.validator:hibernate-validator
33-
versions: [ "[7.0,)" ]
34-
- dependency-name: org.glassfish:jakarta.el
35-
versions: [ "[4.0,)" ]
36-
# Next two dependencies shouldn't be upgrade, because RestEasy isn't using newer version. (2.3.X)
37-
- dependency-name: jakarta.xml.bind:jakarta.xml.bind-api
38-
versions: [ "[3.0,)" ]
31+
# Next dependencies shouldn't be upgrade, because RestEasy isn't using newer version. (2.3.X)
3932
- dependency-name: com.sun.xml.bind:jaxb-impl
4033
versions: [ "[3.0,)" ]

.github/workflows/build-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v3
2525

26-
- name: Set up JDK 1.11
26+
- name: Set up JDK 17
2727
uses: actions/setup-java@v3
2828
with:
2929
distribution: 'zulu'
30-
java-version: '11'
30+
java-version: '17'
3131

3232
- name: Create custom Maven Settings.xml
3333
uses: whelk-io/maven-settings-xml-action@v21

.github/workflows/release-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
# Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
2525
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
2626

27-
- name: Set up JDK 1.11
27+
- name: Set up JDK 17
2828
uses: actions/setup-java@v3
2929
with:
3030
distribution: 'zulu'
31-
java-version: '11'
31+
java-version: '17'
3232

3333
- name: Create custom Maven Settings.xml
3434
uses: whelk-io/maven-settings-xml-action@v21

.github/workflows/sonarcloud-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4444
restore-keys: ${{ runner.os }}-m2
4545

46-
- name: Set up JDK 1.11
46+
- name: Set up JDK 17
4747
uses: actions/setup-java@v3
4848
with:
4949
distribution: 'zulu'
50-
java-version: '11'
50+
java-version: '17'
5151

5252
- name: Set Common Sonar Variables
5353
id: sonar_env
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
2-
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

commons/pom.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ SPDX-License-Identifier: Apache-2.0
4747
<scope>provided</scope>
4848
</dependency>
4949

50+
<dependency>
51+
<groupId>com.sun.xml.bind</groupId>
52+
<artifactId>jaxb-impl</artifactId>
53+
<scope>provided</scope>
54+
</dependency>
55+
5056
<dependency>
5157
<groupId>org.junit.jupiter</groupId>
5258
<artifactId>junit-jupiter-api</artifactId>
@@ -67,11 +73,6 @@ SPDX-License-Identifier: Apache-2.0
6773
<artifactId>jakarta.el</artifactId>
6874
<scope>test</scope>
6975
</dependency>
70-
<dependency>
71-
<groupId>com.sun.xml.bind</groupId>
72-
<artifactId>jaxb-impl</artifactId>
73-
<scope>test</scope>
74-
</dependency>
7576
<dependency>
7677
<groupId>com.openpojo</groupId>
7778
<artifactId>openpojo</artifactId>

commons/src/main/java/org/lfenergy/compas/core/commons/MarshallerWrapper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ public T unmarshall(final InputStream xml) {
7171
}
7272
}
7373

74-
@SuppressWarnings("unchecked")
7574
private T cast(Object result) {
7675
if (!result.getClass().isAssignableFrom(getResultClass())) {
7776
throw new CompasException(UNMARSHAL_ERROR_CODE, "Error unmarshalling to the Class. Invalid class");
7877
}
79-
return (T) result;
78+
return getResultClass().cast(result);
8079
}
8180

8281
public abstract static class Builder<W extends MarshallerWrapper<T>, T> {
@@ -145,7 +144,7 @@ private List<String> getContextPaths(List<SchemaConfig> schemaConfigs) {
145144
// Convert the SchemaConfig List to a List containing only the ContextPaths.
146145
return schemaConfigs.stream()
147146
.map(SchemaConfig::getContextPath)
148-
.collect(Collectors.toList());
147+
.toList();
149148
}
150149

151150
private String getImportStatements(List<SchemaConfig> schemaConfigs) {

commons/src/main/java/org/lfenergy/compas/core/commons/Resources.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private static ClassLoader getClassLoader() {
2828
classLoader = Resources.class.getClassLoader();
2929
}
3030
if (classLoader == null) {
31-
throw new CompasException(NO_CLASS_LOADER_ERROR_CODE, "Unable to get ClassLoader for loading resouces");
31+
throw new CompasException(NO_CLASS_LOADER_ERROR_CODE, "Unable to get ClassLoader for loading resources");
3232
}
3333
return classLoader;
3434
}

commons/src/main/java/org/lfenergy/compas/core/commons/constraint/impl/FilenameConstraintValidator.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@
1616
public class FilenameConstraintValidator implements ConstraintValidator<FilenameValid, String> {
1717
// Used a RegEx from Internet to check the strict one (Old Windows) to see if all matches.
1818
private final Pattern pattern = Pattern.compile(
19-
"# Match a valid Windows filename (unspecified file system).\n" +
20-
"^ # Anchor to start of string.\n" +
21-
"(?! # Assert filename is not: CON, PRN,\n" +
22-
" (?: # AUX, NUL, COM1, COM2, COM3, COM4,\n" +
23-
" CON|PRN|AUX|NUL| # COM5, COM6, COM7, COM8, COM9,\n" +
24-
" COM[1-9]|LPT[1-9] # LPT1, LPT2, LPT3, LPT4, LPT5,\n" +
25-
" ) # LPT6, LPT7, LPT8, and LPT9...\n" +
26-
" (?:\\.[^.]*)? # followed by optional extension\n" +
27-
" $ # and end of string\n" +
28-
") # End negative lookahead assertion.\n" +
29-
"[^<>:\"/\\\\|?*\\x00-\\x1F]* # Zero or more valid filename chars.\n" +
30-
"[^<>:\"/\\\\|?*\\x00-\\x1F\\ .] # Last char is not a space or dot.\n" +
31-
"$ # Anchor to end of string.",
19+
"""
20+
# Match a valid Windows filename (unspecified file system).
21+
^# Anchor to start of string.
22+
(?!# Assert filename is not:
23+
(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])# CON,PRN,AUX,NUL,COM1-9,LPT1-9
24+
(?:\\.[^.]*)?# followed by optional extension
25+
$)# End negative lookahead assertion.
26+
[^<>:"/\\\\|?*\\x00-\\x1F]*# Zero or more valid filename chars.
27+
[^<>:"/\\\\|?*\\x00-\\x1F .]$# Last char is not a space or dot.
28+
""",
3229
Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.COMMENTS);
3330

3431
@Override

commons/src/test/java/org/lfenergy/compas/core/commons/ElementConverterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ElementConverterTest {
2222
"<SCL xmlns=\"" + SIMPLE_SCL_NS + "\" version=\"2007\" revision=\"B\" release=\"4\">" +
2323
"</SCL>";
2424

25-
private ElementConverter converter = new ElementConverter();
25+
private final ElementConverter converter = new ElementConverter();
2626

2727
@Test
2828
void convertToString_WhenCalledWithXMLElementWithoutDeclaration_ThenElementConvertedToAString() throws ParserConfigurationException {

0 commit comments

Comments
 (0)