]> source.dussan.org Git - archiva.git/commitdiff
start fixing issues reported by modernizer maven plugin
authorOlivier Lamy <olamy@apache.org>
Wed, 15 Oct 2014 03:10:04 +0000 (14:10 +1100)
committerOlivier Lamy <olamy@apache.org>
Wed, 15 Oct 2014 03:10:04 +0000 (14:10 +1100)
archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java
archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/archiva/xml/LatinEntityResolutionReaderTest.java

index 603fc884e275e4b32d38621fb3be241d62f3a1cd..d889e92d8e5d8d7a75dab98f702e6be61350a614 100644 (file)
@@ -36,6 +36,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -99,7 +100,7 @@ public class XMLReader
 
         try (InputStream in = url.openStream())
         {
-            InputStreamReader inReader = new InputStreamReader( in, "UTF-8" );
+            InputStreamReader inReader = new InputStreamReader( in, Charset.forName( "UTF-8" ) );
             LatinEntityResolutionReader latinReader = new LatinEntityResolutionReader( inReader );
             this.document = reader.read( latinReader );
         }
index 188b3b1b31091ad7d4a0ee8c33defeff488ebf53..b97e828fba247496fadd18b9d4c0795a388ec60b 100644 (file)
@@ -22,6 +22,7 @@ package org.apache.archiva.xml;
 import org.dom4j.DocumentException;
 import org.dom4j.io.SAXReader;
 import org.junit.Assert;
+import org.junit.Test;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -32,12 +33,10 @@ import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.StringWriter;
 import java.net.URL;
-import org.junit.Test;
+import java.nio.charset.Charset;
 
 /**
  * LatinEntityResolutionReaderTest
- *
- *
  */
 public class LatinEntityResolutionReaderTest
     extends AbstractArchivaXmlTestCase
@@ -140,7 +139,7 @@ public class LatinEntityResolutionReaderTest
             fail( "IOException: " + e.getMessage() );
         }
     }
-    
+
     @Test
     public void testReaderNormalBufsize()
         throws IOException
@@ -215,7 +214,7 @@ public class LatinEntityResolutionReaderTest
         SAXReader reader = new SAXReader();
         URL url = inputFile.toURL();
         in = url.openStream();
-        InputStreamReader inReader = new InputStreamReader( in, "UTF-8" );
+        InputStreamReader inReader = new InputStreamReader( in, Charset.forName( "UTF-8" ) );
         LatinEntityResolutionReader latinReader = new LatinEntityResolutionReader( inReader );
         try
         {