commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r829537 - in /commons/proper/lang/trunk/src/test/org/apache/commons/lang/text: StrLookupTest.java StrSubstitutorTest.java StrTokenizerTest.java
Date Sun, 25 Oct 2009 11:08:56 GMT
Author: sebb
Date: Sun Oct 25 11:08:55 2009
New Revision: 829537

URL: http://svn.apache.org/viewvc?rev=829537&view=rev
Log:
Fix some raw types

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrLookupTest.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrSubstitutorTest.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrLookupTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrLookupTest.java?rev=829537&r1=829536&r2=829537&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrLookupTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrLookupTest.java Sun
Oct 25 11:08:55 2009
@@ -82,7 +82,7 @@
     }
 
     public void testMapLookup() {
-        Map map = new HashMap();
+        Map<String, Object> map = new HashMap<String, Object>();
         map.put("key", "value");
         map.put("number", new Integer(2));
         assertEquals("value", StrLookup.mapLookup(map).lookup("key"));
@@ -93,7 +93,7 @@
     }
 
     public void testMapLookup_nullMap() {
-        Map map = null;
+        Map<String, ?> map = null;
         assertEquals(null, StrLookup.mapLookup(map).lookup(null));
         assertEquals(null, StrLookup.mapLookup(map).lookup(""));
         assertEquals(null, StrLookup.mapLookup(map).lookup("any"));

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrSubstitutorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrSubstitutorTest.java?rev=829537&r1=829536&r2=829537&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrSubstitutorTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrSubstitutorTest.java
Sun Oct 25 11:08:55 2009
@@ -35,7 +35,7 @@
  */
 public class StrSubstitutorTest extends TestCase {
 
-    private Map values;
+    private Map<String, String> values;
 
     /**
      * Main method.
@@ -60,7 +60,7 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        values = new HashMap();
+        values = new HashMap<String, String>();
         values.put("animal", "quick brown fox");
         values.put("target", "lazy dog");
     }
@@ -228,7 +228,7 @@
      * The cycle should be detected and cause an exception to be thrown.
      */
     public void testCyclicReplacement() {
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("animal", "${critter}");
         map.put("target", "${pet}");
         map.put("pet", "${petCharacteristic} dog");
@@ -283,7 +283,7 @@
      */
     public void testResolveVariable() {
         final StrBuilder builder = new StrBuilder("Hi ${name}!");
-        Map map = new HashMap();
+        Map<String, Object> map = new HashMap<String, Object>();
         map.put("name", "commons");
         StrSubstitutor sub = new StrSubstitutor(map) {
             @Override
@@ -312,7 +312,7 @@
      * Tests constructor.
      */
     public void testConstructorMapPrefixSuffix() {
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("name", "commons");
         StrSubstitutor sub = new StrSubstitutor(map, "<", ">");
         assertEquals("Hi < commons", sub.replace("Hi $< <name>"));
@@ -322,7 +322,7 @@
      * Tests constructor.
      */
     public void testConstructorMapFull() {
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("name", "commons");
         StrSubstitutor sub = new StrSubstitutor(map, "<", ">", '!');
         assertEquals("Hi < commons", sub.replace("Hi !< <name>"));
@@ -406,7 +406,7 @@
      * Tests static.
      */
     public void testStaticReplace() {
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("name", "commons");
         assertEquals("Hi commons!", StrSubstitutor.replace("Hi ${name}!", map));
     }
@@ -415,7 +415,7 @@
      * Tests static.
      */
     public void testStaticReplacePrefixSuffix() {
-        Map map = new HashMap();
+        Map<String, String> map = new HashMap<String, String>();
         map.put("name", "commons");
         assertEquals("Hi commons!", StrSubstitutor.replace("Hi <name>!", map, "<",
">"));
     }
@@ -468,7 +468,7 @@
         }
         
         // replace using object
-        MutableObject obj = new MutableObject(replaceTemplate);  // toString returns template
+        MutableObject<String> obj = new MutableObject<String>(replaceTemplate);
 // toString returns template
         assertEquals(expectedResult, sub.replace(obj));
         
         // replace in StringBuffer

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java?rev=829537&r1=829536&r2=829537&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java
Sun Oct 25 11:08:55 2009
@@ -491,7 +491,7 @@
         String input = "a  b c";
         StrTokenizer tok = new StrTokenizer(input);
         String[] array = tok.getTokenArray();
-        List list = tok.getTokenList();
+        List<?> list = tok.getTokenList();
         
         assertEquals(Arrays.asList(array), list);
         assertEquals(3, list.size());
@@ -813,7 +813,7 @@
     public void testTokenizeSubclassInputChange() {
         StrTokenizer tkn = new StrTokenizer("a b c d e") {
             @Override
-            protected List tokenize(char[] chars, int offset, int count) {
+            protected List<String> tokenize(char[] chars, int offset, int count) {
                 return super.tokenize("w x y z".toCharArray(), 2, 5);
             }
         };
@@ -825,8 +825,8 @@
     public void testTokenizeSubclassOutputChange() {
         StrTokenizer tkn = new StrTokenizer("a b c") {
             @Override
-            protected List tokenize(char[] chars, int offset, int count) {
-                List list = super.tokenize(chars, offset, count);
+            protected List<String> tokenize(char[] chars, int offset, int count) {
+                List<String> list = super.tokenize(chars, offset, count);
                 Collections.reverse(list);
                 return list;
             }



Mime
View raw message