[BUG] Let's hope this is the last newline issue fix
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
version_base=1.0
|
version_base=1.0
|
||||||
version_patch=5
|
version_patch=6
|
@@ -598,27 +598,18 @@ public class JarMergeAction {
|
|||||||
* @throws IOException - Thrown if an IO error occurs
|
* @throws IOException - Thrown if an IO error occurs
|
||||||
*/
|
*/
|
||||||
public void removeDuplicateResources(File mergedTemps) throws IOException {
|
public void removeDuplicateResources(File mergedTemps) throws IOException {
|
||||||
|
|
||||||
if (ignoredPackages != null) {
|
if (ignoredPackages != null) {
|
||||||
for (File file : getTextFiles(mergedTemps)) {
|
for (File file : getTextFiles(mergedTemps)) {
|
||||||
FileInputStream fis = new FileInputStream(file);
|
List<String> lines = FileUtils.readLines(file, StandardCharsets.UTF_8);
|
||||||
Scanner scanner = new Scanner(fis);
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
while (scanner.hasNext()) {
|
for (String line : lines) {
|
||||||
String line = scanner.nextLine();
|
for (HashMap.Entry<String, String> entry : removeDuplicateRelocationResources.entrySet()) {
|
||||||
for (Map.Entry<String, String> entry : removeDuplicateRelocationResources.entrySet()) {
|
|
||||||
line = line.replace(entry.getKey(), entry.getValue());
|
line = line.replace(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
sb.append(line).append("\n");
|
sb.append(line).append("\n");
|
||||||
}
|
}
|
||||||
|
FileUtils.write(file, sb.toString().trim(), StandardCharsets.UTF_8);
|
||||||
scanner.close();
|
|
||||||
fis.close();
|
|
||||||
FileOutputStream fos = new FileOutputStream(file);
|
|
||||||
fos.write(sb.toString().getBytes());
|
|
||||||
fos.flush();
|
|
||||||
fos.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user