diff --git a/nb-configuration.xml b/nb-configuration.xml index f4848a4..ff2e804 100644 --- a/nb-configuration.xml +++ b/nb-configuration.xml @@ -1,29 +1,21 @@ - - - - project - 2 - 2 - 2 - true - 80 - none - 2 - 2 - 2 - true - 80 - none - WRAP_IF_LONG - true - true - true - - - false - false - false - true - JDK_1.7 - - + + + + project + 2 + 2 + 2 + true + 80 + none + 2 + 2 + 2 + true + 80 + none + WRAP_IF_LONG + true + true + + diff --git a/pom.xml b/pom.xml index b767fc4..fe99f35 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.welovecoding.netbeans.plugin editorconfig - 0.10.0-SNAPSHOT + 0.1.0 nbm welovecoding | EditorConfig Plugin @@ -217,6 +217,12 @@ antlr4-runtime 4.5 + + commons-io + commons-io + 2.4 + jar + diff --git a/src/main/java/com/welovecoding/nbeditorconfig/io/reader/FileInfoReader.java b/src/main/java/com/welovecoding/nbeditorconfig/io/reader/FileInfoReader.java index b1745ec..4c027f3 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/io/reader/FileInfoReader.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/io/reader/FileInfoReader.java @@ -17,6 +17,7 @@ import org.mozilla.universalchardet.UniversalDetector; import org.openide.filesystems.FileObject; import org.openide.util.Exceptions; +import org.apache.commons.io.IOUtils; /** * @see @@ -194,19 +195,13 @@ public static String replaceLineEndings(String text, String lineEnding) { public static List readLines(String text) { List lines = new ArrayList<>(); - try (BufferedReader reader = new BufferedReader(new StringReader(text))) { - try { - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - lines.add(line); - } - reader.close(); - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - } + try { + lines = IOUtils.readLines(new StringReader(text)); } catch (IOException ex) { Exceptions.printStackTrace(ex); } + return lines; } }