Permalink
Browse files

Add revised version of the JDOMStreamReader together with some implem…

…entation details for JDOM integration, and a round-trip test
  • Loading branch information...
1 parent c67fdb2 commit 9b019b13ed0d6c7839dc23911d940ef0d5736dc2 @rolfl rolfl committed Jan 7, 2013
@@ -62,6 +62,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
import org.jdom2.JDOMConstants;
import org.jdom2.Namespace;
+import org.jdom2.internal.ArrayCopy;
/**
* A Read-Only {@link NamespaceContext} that describes namespaces found
@@ -76,11 +77,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* Create a read-only representation of the input namespace list.
* @param namespaces the Namespace instances to represent.
*/
- public JDOMNamespaceContext(final List<Namespace> namespaces){
+ public JDOMNamespaceContext(final Namespace[] namespaces){
if (namespaces == null) {
throw new IllegalArgumentException("Cannot process a null Namespace list");
}
- this.namespacearray = namespaces.toArray(new Namespace[0]);
+ this.namespacearray = ArrayCopy.copyOf(namespaces, namespaces.length);
for (int i = 1; i < namespacearray.length; i++) {
final Namespace n = namespacearray[i];
if (n == null) {
Oops, something went wrong.

0 comments on commit 9b019b1

Please sign in to comment.