Fix some raw types
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@829537 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5ca6b02849
commit
14cde02867
|
@ -82,7 +82,7 @@ public class StrLookupTest extends TestCase {
|
|||
}
|
||||
|
||||
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 class StrLookupTest extends TestCase {
|
|||
}
|
||||
|
||||
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"));
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.commons.lang.mutable.MutableObject;
|
|||
*/
|
||||
public class StrSubstitutorTest extends TestCase {
|
||||
|
||||
private Map values;
|
||||
private Map<String, String> values;
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
|
@ -60,7 +60,7 @@ public class StrSubstitutorTest extends TestCase {
|
|||
@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 @@ public class StrSubstitutorTest extends TestCase {
|
|||
* 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 class StrSubstitutorTest extends TestCase {
|
|||
*/
|
||||
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 @@ public class StrSubstitutorTest extends TestCase {
|
|||
* 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 @@ public class StrSubstitutorTest extends TestCase {
|
|||
* 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 @@ public class StrSubstitutorTest extends TestCase {
|
|||
* 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 @@ public class StrSubstitutorTest extends TestCase {
|
|||
* 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 @@ public class StrSubstitutorTest extends TestCase {
|
|||
}
|
||||
|
||||
// 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
|
||||
|
|
|
@ -491,7 +491,7 @@ public class StrTokenizerTest extends TestCase {
|
|||
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 class StrTokenizerTest extends TestCase {
|
|||
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 class StrTokenizerTest extends TestCase {
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue