Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump commons-io:commons-io from 2.11.0 to 2.15.1 #983

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<!-- Project Dependencies Configuration -->
<jmh.version>1.37</jmh.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.io.version>2.15.1</commons.io.version>
<commons.digester.version>3.2</commons.digester.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<commons.text.version>1.11.0</commons.text.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String detectPackageName(final String fileName, final Charset charset) {

@VisibleForTesting
String detectPackageName(final InputStream stream, final Charset charset) throws IOException {
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(new BOMInputStream(stream), charset))) {
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(BOMInputStream.builder().setInputStream(stream).get(), charset))) {
return detectPackageName(buffer.lines());
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/edu/hm/hafner/analysis/FileReaderFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ public Reader create() {
if (isCharsetUndetected) {
charset = detectCharset(Files.newInputStream(file));
}
InputStream inputStream = Files.newInputStream(file);

return new InputStreamReader(new BOMInputStream(inputStream), getCharset());
var inputStream = Files.newInputStream(file);
var bomInputStream = BOMInputStream.builder().setInputStream(inputStream).get();
return new InputStreamReader(bomInputStream, getCharset());
}
catch (FileNotFoundException | InvalidPathException exception) {
throw new ParsingException(exception, "Can't find file '%s'", fileName);
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/edu/hm/hafner/analysis/RevApiInfoExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import java.util.Objects;

import edu.umd.cs.findbugs.annotations.CheckForNull;

Expand Down Expand Up @@ -34,7 +33,7 @@ public final class RevApiInfoExtension implements Serializable {
*/
public RevApiInfoExtension(@CheckForNull final String code, final String oldFile,
final String newFile, final Map<String, String> severities) {
this.issueName = StringUtils.defaultString(code, "-");
this.issueName = Objects.toString(code, "-");
this.oldFile = oldFile;
this.newFile = newFile;
this.severities.putAll(severities);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/edu/hm/hafner/analysis/parser/JavacParser.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package edu.hm.hafner.analysis.parser;

import java.util.Objects;
import java.util.Optional;
import java.util.regex.Matcher;

import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.StringUtils;

import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.IssueBuilder;
Expand Down Expand Up @@ -77,7 +77,7 @@ protected Optional<Issue> createIssue(final Matcher matcher, final LookaheadStre
// get rid of leading / from windows compiler output JENKINS-66738
return builder.setFileName(RegExUtils.replaceAll(matcher.group(2), "^/([a-zA-Z]):", "$1:"))
.setLineStart(matcher.group(7))
.setType(StringUtils.defaultString(getGoal(), DEFAULT_GOAL))
.setType(Objects.toString(getGoal(), DEFAULT_GOAL))
.setColumnStart(matcher.group(8))
.setCategory(category)
.setMessage(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SimulinkCheckParser extends IssueParser {
public Report parse(final ReaderFactory readerFactory) throws ParsingException {
try (IssueBuilder issueBuilder = new IssueBuilder();
Reader reader = readerFactory.create();
InputStream targetStream = new ReaderInputStream(reader, readerFactory.getCharset())) {
InputStream targetStream = ReaderInputStream.builder().setReader(reader).setCharset(readerFactory.getCharset()).get()) {
Document document = Jsoup.parse(targetStream, readerFactory.getCharset().name(), EMPTY_BASE_URI);

Elements systemElements = document.select(REPORT_CONTENT);
Expand Down
Loading