Author: markt
Date: Mon Feb 1 09:35:47 2016
New Revision: 1727904
URL: http://svn.apache.org/viewvc?rev=1727904&view=rev
Log:
Align with 7.0.x implementation
- add generics
- add @Override
- fix Javadoc typos
- improve whitespace
Modified:
tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/ParameterMap.java
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/ParameterMap.java
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/ParameterMap.java?rev=1727904&r1=1727903&r2=1727904&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/ParameterMap.java
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/ParameterMap.java Mon
Feb 1 09:35:47 2016
@@ -14,14 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
package org.apache.catalina.util;
-
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
+import org.apache.tomcat.util.res.StringManager;
/**
* Extended implementation of <strong>HashMap</strong> that includes a
@@ -31,15 +29,13 @@ import java.util.Map;
* <code>ParmaeterMap</code> instance is not locked.
*
* @author Craig R. McClanahan
- *
*/
+public final class ParameterMap<K,V> extends LinkedHashMap<K,V> {
-public final class ParameterMap extends HashMap {
+ private static final long serialVersionUID = 1L;
// ----------------------------------------------------------- Constructors
-
-
/**
* Construct a new, empty map with the default initial capacity and
* load factor.
@@ -81,9 +77,9 @@ public final class ParameterMap extends
/**
* Construct a new map with the same mappings as the given map.
*
- * @param map Map whose contents are dupliated in the new map
+ * @param map Map whose contents are duplicated in the new map
*/
- public ParameterMap(Map map) {
+ public ParameterMap(Map<K,V> map) {
super(map);
@@ -137,6 +133,7 @@ public final class ParameterMap extends
*
* @exception IllegalStateException if this map is currently locked
*/
+ @Override
public void clear() {
if (locked)
@@ -160,7 +157,8 @@ public final class ParameterMap extends
*
* @exception IllegalStateException if this map is currently locked
*/
- public Object put(Object key, Object value) {
+ @Override
+ public V put(K key, V value) {
if (locked)
throw new IllegalStateException
@@ -179,7 +177,8 @@ public final class ParameterMap extends
*
* @exception IllegalStateException if this map is currently locked
*/
- public void putAll(Map map) {
+ @Override
+ public void putAll(Map<? extends K,? extends V> map) {
if (locked)
throw new IllegalStateException
@@ -199,7 +198,8 @@ public final class ParameterMap extends
*
* @exception IllegalStateException if this map is currently locked
*/
- public Object remove(Object key) {
+ @Override
+ public V remove(Object key) {
if (locked)
throw new IllegalStateException
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]