summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-10-15 14:10:04 +1100
committerOlivier Lamy <olamy@apache.org>2014-10-15 14:10:04 +1100
commitdce9401cd3e28d1b4e9a629f45d66c16b019e028 (patch)
treefbcbd8d0ff884ac46a0593037e3bb93a1321740f
parentd2fcfdd21fa3ef6490cc73bd6ee7057572206660 (diff)
downloadarchiva-dce9401cd3e28d1b4e9a629f45d66c16b019e028.tar.gz
archiva-dce9401cd3e28d1b4e9a629f45d66c16b019e028.zip
start fixing issues reported by modernizer maven plugin
-rw-r--r--archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java3
-rw-r--r--archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/archiva/xml/LatinEntityResolutionReaderTest.java9
2 files changed, 6 insertions, 6 deletions
diff --git a/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java b/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java
index 603fc884e..d889e92d8 100644
--- a/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java
+++ b/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java
@@ -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 );
}
diff --git a/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/archiva/xml/LatinEntityResolutionReaderTest.java b/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/archiva/xml/LatinEntityResolutionReaderTest.java
index 188b3b1b3..b97e828fb 100644
--- a/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/archiva/xml/LatinEntityResolutionReaderTest.java
+++ b/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/archiva/xml/LatinEntityResolutionReaderTest.java
@@ -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
{