|
29 | 29 | import java.net.URISyntaxException;
|
30 | 30 | import java.net.URL;
|
31 | 31 | import java.net.URLClassLoader;
|
| 32 | +import java.nio.charset.Charset; |
| 33 | +import java.nio.charset.StandardCharsets; |
| 34 | +import java.nio.file.Files; |
32 | 35 | import java.nio.file.Paths;
|
33 | 36 | import java.util.ArrayList;
|
34 | 37 | import java.util.Arrays;
|
|
82 | 85 | import org.codehaus.plexus.components.interactivity.InputHandler;
|
83 | 86 | import org.codehaus.plexus.languages.java.version.JavaVersion;
|
84 | 87 | import org.codehaus.plexus.util.FileUtils;
|
85 |
| -import org.codehaus.plexus.util.ReaderFactory; |
86 | 88 | import org.codehaus.plexus.util.StringUtils;
|
87 | 89 |
|
88 | 90 | /**
|
@@ -532,10 +534,10 @@ private void init() {
|
532 | 534 | // encoding
|
533 | 535 | if (encoding == null || encoding.isEmpty()) {
|
534 | 536 | if (getLog().isWarnEnabled()) {
|
535 |
| - getLog().warn("File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING |
| 537 | + getLog().warn("File encoding has not been set, using platform encoding " + Charset.defaultCharset() |
536 | 538 | + ", i.e. build is platform dependent!");
|
537 | 539 | }
|
538 |
| - encoding = ReaderFactory.FILE_ENCODING; |
| 540 | + encoding = Charset.defaultCharset().name(); |
539 | 541 | }
|
540 | 542 |
|
541 | 543 | // level
|
@@ -689,13 +691,13 @@ private void parseClirrTextOutputFile(File clirrTextOutputFile) throws IOExcepti
|
689 | 691 | clirrNewClasses = new LinkedList<>();
|
690 | 692 | clirrNewMethods = new LinkedHashMap<>();
|
691 | 693 |
|
692 |
| - try (BufferedReader reader = new BufferedReader(ReaderFactory.newReader(clirrTextOutputFile, "UTF-8"))) { |
| 694 | + try (BufferedReader reader = Files.newBufferedReader(clirrTextOutputFile.toPath(), StandardCharsets.UTF_8)) { |
693 | 695 |
|
694 | 696 | for (String line = reader.readLine(); line != null; line = reader.readLine()) {
|
695 | 697 | String[] split = StringUtils.split(line, ":");
|
696 | 698 | if (split.length != 4) {
|
697 | 699 | if (getLog().isDebugEnabled()) {
|
698 |
| - getLog().debug("Unable to parse the clirr line: " + line); |
| 700 | + getLog().debug("Unable to parse the Clirr line: " + line); |
699 | 701 | }
|
700 | 702 | continue;
|
701 | 703 | }
|
@@ -2098,26 +2100,6 @@ private void appendDefaultSinceTag(final StringBuilder sb, final String indent)
|
2098 | 2100 | sb.append(EOL);
|
2099 | 2101 | }
|
2100 | 2102 |
|
2101 |
| - /** |
2102 |
| - * @param sb not null |
2103 |
| - * @param indent not null |
2104 |
| - * @param separatorAdded |
2105 |
| - * @return true if separator has been added. |
2106 |
| - */ |
2107 |
| - private boolean appendDefaultVersionTag(final StringBuilder sb, final String indent, boolean separatorAdded) { |
2108 |
| - if (!fixTag(VERSION_TAG) || StringUtils.isEmpty(defaultVersion)) { |
2109 |
| - return separatorAdded; |
2110 |
| - } |
2111 |
| - |
2112 |
| - if (!separatorAdded) { |
2113 |
| - appendSeparator(sb, indent); |
2114 |
| - separatorAdded = true; |
2115 |
| - } |
2116 |
| - |
2117 |
| - appendDefaultVersionTag(sb, indent); |
2118 |
| - return separatorAdded; |
2119 |
| - } |
2120 |
| - |
2121 | 2103 | /**
|
2122 | 2104 | * @param sb not null
|
2123 | 2105 | * @param indent not null
|
|
0 commit comments