This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 0dd9ebc12 restore src/mdo/reader.vm (#1034)
0dd9ebc12 is described below
commit 0dd9ebc1264d26dbb22893421faac8c40b574daf
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Sun Mar 5 07:43:42 2023 -0500
restore src/mdo/reader.vm (#1034)
---
src/mdo/reader.vm | 51 ++++++++++++++++++++++++++++-----------------------
1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/src/mdo/reader.vm b/src/mdo/reader.vm
index a163d78d0..f43847aaf 100644
--- a/src/mdo/reader.vm
+++ b/src/mdo/reader.vm
@@ -52,6 +52,7 @@ import org.apache.maven.internal.xml.XmlNodeBuilder;
#foreach ( $class in $model.allClasses )
import ${packageModelV4}.${class.name};
#end
+import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
import org.codehaus.plexus.util.xml.pull.MXParser;
import org.codehaus.plexus.util.xml.pull.XmlPullParser;
@@ -564,11 +565,13 @@ public class ${className}
} //-- int nextTag( XmlPullParser )
/**
+ * @see ReaderFactory#newXmlReader
*
- * @param reader a reader object
- * @param strict a strict object
- * @throws IOException IOException if any
- * @throws XmlPullParserException XmlPullParserException if any
+ * @param reader a reader object.
+ * @param strict a strict object.
+ * @throws IOException IOException if any.
+ * @throws XmlPullParserException XmlPullParserException if
+ * any.
* @return ${root.name}
*/
public ${root.name} read( Reader reader, boolean strict )
@@ -578,14 +581,17 @@ public class ${className}
parser.setInput( reader );
+
return read( parser, strict );
} //-- ${root.name} read( Reader, boolean )
/**
+ * @see ReaderFactory#newXmlReader
*
- * @param reader a reader object
+ * @param reader a reader object.
* @throws IOException IOException if any.
- * @throws XmlPullParserException XmlPullParserException if any
+ * @throws XmlPullParserException XmlPullParserException if
+ * any.
* @return ${root.name}
*/
public ${root.name} read( Reader reader )
@@ -597,43 +603,42 @@ public class ${className}
/**
* Method read.
*
- * @param in a in object
- * @param strict a strict object
- * @throws IOException IOException if any
- * @throws XmlPullParserException XmlPullParserException if any
+ * @param in a in object.
+ * @param strict a strict object.
+ * @throws IOException IOException if any.
+ * @throws XmlPullParserException XmlPullParserException if
+ * any.
* @return ${root.name}
*/
public ${root.name} read( InputStream in, boolean strict )
throws IOException, XmlPullParserException
{
- XmlPullParser parser = addDefaultEntities ? new
MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( );
-
- parser.setInput( in, null );
-
- return read( in, strict );
+ return read( ReaderFactory.newXmlReader( in ), strict );
} //-- ${root.name} read( InputStream, boolean )
/**
* Method read.
*
- * @param in a in object
- * @throws IOException IOException if any
- * @throws XmlPullParserException XmlPullParserException if any
+ * @param in a in object.
+ * @throws IOException IOException if any.
+ * @throws XmlPullParserException XmlPullParserException if
+ * any.
* @return ${root.name}
*/
public ${root.name} read( InputStream in )
throws IOException, XmlPullParserException
{
- return read( in, true );
+ return read( ReaderFactory.newXmlReader( in ) );
} //-- ${root.name} read( InputStream )
/**
* Method read.
*
- * @param parser a parser object
- * @param strict a strict object
- * @throws IOException IOException if any
- * @throws XmlPullParserException XmlPullParserException if any
+ * @param parser a parser object.
+ * @param strict a strict object.
+ * @throws IOException IOException if any.
+ * @throws XmlPullParserException XmlPullParserException if
+ * any.
* @return ${root.name}
*/
public ${root.name} read( XmlPullParser parser, boolean strict )