Skip to content

Commit 31b574f

Browse files
authored
Merge branch 'main' into release
2 parents 18ba575 + 55c0e6c commit 31b574f

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
3636
- name: Update dependency graph
37-
uses: advanced-security/maven-dependency-submission-action@49866fead7de0b0083b89f5f653f9620548ccddf
37+
uses: advanced-security/maven-dependency-submission-action@4b6fc92adc1df4c41b470e692a1688a448907248
3838

3939
- name: Coveralls GitHub Action
4040
uses: coverallsapp/github-action@v2.3.6

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.4.3</version>
8+
<version>3.4.5</version>
99
<relativePath /> <!-- lookup parent from repository -->
1010
</parent>
1111

@@ -44,7 +44,7 @@
4444
<maven.compiler.release>21</maven.compiler.release>
4545
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4646
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
47-
<jackson.version>2.18.2</jackson.version>
47+
<jackson.version>2.19.0</jackson.version>
4848
<jacoco.version>0.8.12</jacoco.version>
4949
</properties>
5050

@@ -105,7 +105,7 @@
105105
<dependency>
106106
<groupId>net.sf.saxon</groupId>
107107
<artifactId>Saxon-HE</artifactId>
108-
<version>12.5</version>
108+
<version>12.7</version>
109109
</dependency>
110110
<dependency>
111111
<groupId>org.apache.commons</groupId>

src/main/java/fr/insee/bpm/metadata/reader/ddi/DDIReader.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import javax.xml.parsers.DocumentBuilder;
2424
import javax.xml.parsers.DocumentBuilderFactory;
2525
import javax.xml.parsers.ParserConfigurationException;
26-
import java.io.File;
2726
import java.io.IOException;
2827
import java.io.InputStream;
2928
import java.net.MalformedURLException;
@@ -49,24 +48,23 @@ private DDIReader() {
4948
* @param ddiUrlString : Path to the DDI file.
5049
*
5150
* @return The variables found in the DDI.
52-
* @throws MetadataParserException
51+
* @throws MetadataParserException when metadata can't be read
5352
*/
5453
public static MetadataModel getMetadataFromDDI(String ddiUrlString, InputStream ddiInputStream) throws MetadataParserException {
5554

5655
try {
5756
// Path of the output 'variables.xml' temp file
58-
File variablesFile = File.createTempFile("variables", ".xml");
59-
variablesFile.deleteOnExit();
60-
Path variablesTempFilePath = variablesFile.toPath();
57+
Path variablesFile = Files.createTempFile("variables", ".xml");
58+
variablesFile.toFile().deleteOnExit();
6159

62-
transformDDI(ddiUrlString, ddiInputStream, variablesTempFilePath);
63-
MetadataModel metadataModel = readVariables(variablesTempFilePath);
64-
Files.delete(variablesFile.toPath());
60+
transformDDI(ddiUrlString, ddiInputStream, variablesFile);
61+
MetadataModel metadataModel = readVariables(variablesFile);
62+
Files.delete(variablesFile);
6563
return metadataModel;
6664
}
6765

6866
catch (MalformedURLException e) {
69-
log.error(String.format("Error when converting file path '%s' to an URL.", ddiUrlString), e);
67+
log.error("Error when converting file path '{}' to an URL.", ddiUrlString, e);
7068
return null;
7169
} catch (IOException e) {
7270
log.error("Unable to write temp file.", e);
@@ -94,7 +92,7 @@ private static void transformDDI(String ddiUrlString, InputStream ddiInputStream
9492
*
9593
* @param variablesFilePath Path to the transformed xml file.
9694
* @return The variables described in the file.
97-
* @throws MetadataParserException
95+
* @throws MetadataParserException when metadata can't be read
9896
* @throws IOException
9997
* @throws SAXException
10098
* @throws ParserConfigurationException
@@ -144,8 +142,7 @@ private static MetadataModel readVariables(Path variablesFilePath)
144142

145143
}
146144
} catch (NullPointerException e) {
147-
log.error(String.format("Missing field in mandatory information for variable %s",
148-
((Element) groupElements.item(i)).getAttribute("name")));
145+
log.error("Missing field in mandatory information for variable {}", ((Element) groupElements.item(i)).getAttribute("name"));
149146
}
150147

151148
String finalRootGroupName = rootGroupName;

0 commit comments

Comments
 (0)