diff options
Diffstat (limited to 'src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java')
-rw-r--r-- | src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java b/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java index 25da0c6..27b1e5c 100644 --- a/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java +++ b/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java @@ -1,15 +1,15 @@ /* - * reserved comment block - * DO NOT REMOVE OR ALTER! + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -24,9 +24,11 @@ package com.sun.org.apache.xml.internal.serialize; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import java.io.OutputStream; -import java.io.Writer; import java.io.UnsupportedEncodingException; -import java.util.Hashtable; +import java.io.Writer; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import java.util.StringTokenizer; /** @@ -43,7 +45,7 @@ public abstract class SerializerFactory public static final String FactoriesProperty = "com.sun.org.apache.xml.internal.serialize.factories"; - private static Hashtable _factories = new Hashtable(); + private static final Map<String, SerializerFactory> _factories = Collections.synchronizedMap(new HashMap()); static @@ -89,9 +91,9 @@ public abstract class SerializerFactory String method; synchronized ( _factories ) { - method = factory.getSupportedMethod(); - _factories.put( method, factory ); - } + method = factory.getSupportedMethod(); + _factories.put( method, factory ); + } } @@ -101,7 +103,7 @@ public abstract class SerializerFactory */ public static SerializerFactory getSerializerFactory( String method ) { - return (SerializerFactory) _factories.get( method ); + return _factories.get( method ); } |