Skip to content

Commit 5ff997c

Browse files
authored
[MSHARED-848] deprecate XmlStreamReader (#59)
* deprecate XmlStreamReader * deprecate newXmlReader methods in favor of apache commons
1 parent 914d975 commit 5ff997c

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

src/main/java/org/apache/maven/shared/utils/ReaderFactory.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ public class ReaderFactory
110110
* @param in not null input stream
111111
* @return an XML reader instance for the input stream
112112
* @throws IOException if any
113-
* @see XmlStreamReader
113+
* @deprecated use org.apache.commons.io.input.XmlStreamReader instead
114114
*/
115+
@Deprecated
115116
public static Reader newXmlReader( @Nonnull InputStream in )
116117
throws IOException
117118
{
@@ -124,8 +125,9 @@ public static Reader newXmlReader( @Nonnull InputStream in )
124125
* @param file not null file
125126
* @return an XML reader instance for the input file
126127
* @throws IOException if any
127-
* @see XmlStreamReader
128+
* @deprecated use org.apache.commons.io.input.XmlStreamReader instead
128129
*/
130+
@Deprecated
129131
public static Reader newXmlReader( @Nonnull File file )
130132
throws IOException
131133
{
@@ -135,11 +137,12 @@ public static Reader newXmlReader( @Nonnull File file )
135137
/**
136138
* Create a new Reader with XML encoding detection rules.
137139
*
138-
* @param url not null url
140+
* @param url not null URL
139141
* @return an XML reader instance for the input URL
140142
* @throws IOException if any
141-
* @see XmlStreamReader
143+
* @deprecated use {@code org.apache.commons.io.input.XmlStreamReader} instead
142144
*/
145+
@Deprecated
143146
public static Reader newXmlReader( @Nonnull URL url )
144147
throws IOException
145148
{

src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReader.java

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
import java.util.regex.Pattern;
3030

3131
/**
32-
*
32+
* @deprecated use org.apache.commons.io.input.XmlStreamReader instead
3333
*/
34+
@Deprecated
3435
public class XmlStreamReader
3536
extends Reader
3637
{
@@ -56,7 +57,7 @@ public static String getDefaultEncoding()
5657

5758
/**
5859
* @param file The file to create it from.
59-
* @throws IOException in case of an error.
60+
* @throws IOException in case of an error
6061
*/
6162
public XmlStreamReader( File file )
6263
throws IOException
@@ -66,7 +67,7 @@ public XmlStreamReader( File file )
6667

6768
/**
6869
* @param is {@link InputStream}
69-
* @throws IOException in case of an error.
70+
* @throws IOException in case of an error
7071
*/
7172
public XmlStreamReader( InputStream is )
7273
throws IOException
@@ -77,8 +78,8 @@ public XmlStreamReader( InputStream is )
7778
/**
7879
* @param is {@link InputStream}
7980
* @param lenient yes/no
80-
* @throws IOException in case of an error.
81-
* @throws XmlStreamReaderException in case of an error.
81+
* @throws IOException in case of an error
82+
* @throws XmlStreamReaderException in case of an error
8283
*/
8384
public XmlStreamReader( InputStream is, boolean lenient )
8485
throws IOException, XmlStreamReaderException
@@ -88,7 +89,7 @@ public XmlStreamReader( InputStream is, boolean lenient )
8889

8990
/**
9091
* @param url {@link URL}
91-
* @throws IOException in case of error.
92+
* @throws IOException in case of error
9293
*/
9394
public XmlStreamReader( URL url )
9495
throws IOException
@@ -97,8 +98,8 @@ public XmlStreamReader( URL url )
9798
}
9899

99100
/**
100-
* @param conn The URL connection {@link URLConnection}.
101-
* @throws IOException in case of error.
101+
* @param conn The URL connection {@link URLConnection}
102+
* @throws IOException in case of error
102103
*/
103104
public XmlStreamReader( URLConnection conn )
104105
throws IOException
@@ -108,8 +109,8 @@ public XmlStreamReader( URLConnection conn )
108109

109110
/**
110111
* @param is {@link InputStream}
111-
* @param httpContentType content type.
112-
* @throws IOException in case of error.
112+
* @param httpContentType content type
113+
* @throws IOException in case of error
113114
*/
114115
public XmlStreamReader( InputStream is, String httpContentType )
115116
throws IOException
@@ -119,11 +120,11 @@ public XmlStreamReader( InputStream is, String httpContentType )
119120

120121
/**
121122
* @param is {@link InputStream}
122-
* @param httpContentType content type.
123-
* @param lenient yes/no.
124-
* @param defaultEncoding The default encoding.
125-
* @throws IOException in case of error.
126-
* @throws XmlStreamReaderException in case of error.
123+
* @param httpContentType content type
124+
* @param lenient yes/no
125+
* @param defaultEncoding the default encoding
126+
* @throws IOException in case of error
127+
* @throws XmlStreamReaderException in case of error
127128
*/
128129
public XmlStreamReader( InputStream is, String httpContentType, boolean lenient, String defaultEncoding )
129130
throws IOException, XmlStreamReaderException
@@ -136,10 +137,10 @@ public XmlStreamReader( InputStream is, String httpContentType, boolean lenient,
136137

137138
/**
138139
* @param is {@link InputStream}
139-
* @param httpContentType content type.
140-
* @param lenient yes/no.
141-
* @throws IOException in case of error.
142-
* @throws XmlStreamReaderException in case of error.
140+
* @param httpContentType content type
141+
* @param lenient yes/no
142+
* @throws IOException in case of error
143+
* @throws XmlStreamReaderException in case of error
143144
*/
144145
public XmlStreamReader( InputStream is, String httpContentType, boolean lenient )
145146
throws IOException, XmlStreamReaderException
@@ -148,7 +149,7 @@ public XmlStreamReader( InputStream is, String httpContentType, boolean lenient
148149
}
149150

150151
/**
151-
* @return The current encoding.
152+
* @return the current encoding
152153
*/
153154
public String getEncoding()
154155
{

0 commit comments

Comments
 (0)