Author: bimargulies Date: Tue Jun 14 00:28:58 2011 New Revision: 1135348 URL: http://svn.apache.org/viewvc?rev=1135348&view=rev Log: Add FastMap to the picture
Added: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/src/main/java/org/codehaus/plexus/util/FastMap.java (with props) maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/FastMapTest.java (with props) Modified: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/pom.xml Modified: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/pom.xml?rev=1135348&r1=1135347&r2=1135348&view=diff ============================================================================== --- maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/pom.xml (original) +++ maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/pom.xml Tue Jun 14 00:28:58 2011 @@ -42,6 +42,11 @@ <version>r09</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.javolution</groupId> + <artifactId>javolution</artifactId> + <version>5.2.6</version> + </dependency> </dependencies> <build> Added: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/src/main/java/org/codehaus/plexus/util/FastMap.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/src/main/java/org/codehaus/plexus/util/FastMap.java?rev=1135348&view=auto ============================================================================== --- maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/src/main/java/org/codehaus/plexus/util/FastMap.java (added) +++ maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/src/main/java/org/codehaus/plexus/util/FastMap.java Tue Jun 14 00:28:58 2011 @@ -0,0 +1,49 @@ +/* + * 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 + * + * 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, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.codehaus.plexus.util; + +import java.util.Map; + +/** + * Plexus-utils contained a copy of an old version of javolution.util.FastMap. + * This class provides compability. Callers who really need a Map other than + * java.util should add their own dependency to javolution instead of using this. + * + */ +@Deprecated +@SuppressWarnings( { "rawtypes", "serial" } ) +public class FastMap extends javolution.util.FastMap +{ + + public FastMap() + { + } + + public FastMap( int capacity ) + { + super( capacity ); + } + + @SuppressWarnings( "unchecked" ) + public FastMap( Map mapToCopy ) + { + super( mapToCopy ); + } +} Propchange: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/src/main/java/org/codehaus/plexus/util/FastMap.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-commons-bridge/src/main/java/org/codehaus/plexus/util/FastMap.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/FastMapTest.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/FastMapTest.java?rev=1135348&view=auto ============================================================================== --- maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/FastMapTest.java (added) +++ maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/FastMapTest.java Tue Jun 14 00:28:58 2011 @@ -0,0 +1,52 @@ +package org.codehaus.plexus.util; + +import java.util.Iterator; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Test; + +/* + * 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 + * + * 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, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * This is a stub test that demonstrates that something is here. It's not + * worthwhile to build a complex test to prove that the current javolution + * is identical in behavior with the copy captured in plexus-utils. + * + */ +public class FastMapTest extends Assert +{ + @SuppressWarnings( "rawtypes" ) + @Test + public void simpleTest() { + FastMap map = new FastMap(); + map.put( "red", "green" ); + map.put( "braised", "roasted" ); + assertEquals( 2, map.size() ); + Iterator it = map.entrySet().iterator(); + Object meo1 = it.next(); + Object meo2 = it.next(); + Map.Entry me = (Map.Entry)meo1; + assertEquals( "red", me.getKey() ); + me = (Map.Entry)meo2; + assertEquals( "braised", me.getKey() ); + } + +} Propchange: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/FastMapTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/FastMapTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain