File tree Expand file tree Collapse file tree 4 files changed +13
-16
lines changed
src/main/java/io/github/fvarrui/javapackager Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 11package io .github .fvarrui .javapackager .model ;
22
3- import static io . github . fvarrui . javapackager . utils . NumberUtils .defaultIfNull ;
3+ import static org . apache . commons . lang3 . ObjectUtils .defaultIfNull ;
44
55import java .io .File ;
66
Original file line number Diff line number Diff line change 33public class JavaUtils {
44
55 public static int getJavaMajorVersion () {
6- String version = System .getProperty ("java.version" );
7-
8- int major = Integer .parseInt (version .split ("\\ ." )[0 ]);
6+ String [] version = System .getProperty ("java.version" ).split ("\\ ." );
7+ int major = Integer .parseInt (version [0 ]);
98 if (major >= 2 ) return major ;
10-
11- return Integer .parseInt (version .split ("\\ ." )[1 ]);
9+ return Integer .parseInt (version [1 ]);
1210 }
1311
1412}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1717
1818public class XMLUtils {
1919
20+ /**
21+ * Pretiffy an XML file
22+ * @param file Xml file
23+ * @throws MojoExecutionException Something went wrong
24+ */
2025 public static final void prettify (File file ) throws MojoExecutionException {
2126 try {
2227
@@ -39,6 +44,10 @@ public static final void prettify(File file) throws MojoExecutionException {
3944 }
4045 }
4146
47+ /**
48+ * Removes whitespaces from nodes
49+ * @param node Root node
50+ */
4251 public static void trimWhitespace (Node node ) {
4352 NodeList children = node .getChildNodes ();
4453 for (int i = 0 ; i < children .getLength (); ++i ) {
You can’t perform that action at this time.
0 commit comments