11/*
2- * Copyright 2002-2013 the original author or authors.
2+ * Copyright 2002-2014 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -97,9 +97,20 @@ public void testUtilities() throws ParseException {
9797
9898 @ Test
9999 public void testTypedValue () {
100- TypedValue tValue = new TypedValue ("hello" );
101- assertEquals (String .class ,tValue .getTypeDescriptor ().getType ());
102- assertEquals ("TypedValue: 'hello' of [java.lang.String]" ,tValue .toString ());
100+ TypedValue tv1 = new TypedValue ("hello" );
101+ TypedValue tv2 = new TypedValue ("hello" );
102+ TypedValue tv3 = new TypedValue ("bye" );
103+ assertEquals (String .class , tv1 .getTypeDescriptor ().getType ());
104+ assertEquals ("TypedValue: 'hello' of [java.lang.String]" , tv1 .toString ());
105+ assertEquals (tv1 , tv2 );
106+ assertEquals (tv2 , tv1 );
107+ assertNotEquals (tv1 , tv3 );
108+ assertNotEquals (tv2 , tv3 );
109+ assertNotEquals (tv3 , tv1 );
110+ assertNotEquals (tv3 , tv2 );
111+ assertEquals (tv1 .hashCode (), tv2 .hashCode ());
112+ assertNotEquals (tv1 .hashCode (), tv3 .hashCode ());
113+ assertNotEquals (tv2 .hashCode (), tv3 .hashCode ());
103114 }
104115
105116 @ Test
@@ -481,7 +492,7 @@ static class Unconvertable {}
481492 /**
482493 * Used to validate the match returned from a compareArguments call.
483494 */
484- private void checkMatch (Class [] inputTypes , Class [] expectedTypes , StandardTypeConverter typeConverter , ArgumentsMatchKind expectedMatchKind ) {
495+ private void checkMatch (Class <?> [] inputTypes , Class <?> [] expectedTypes , StandardTypeConverter typeConverter , ArgumentsMatchKind expectedMatchKind ) {
485496 ReflectionHelper .ArgumentsMatchInfo matchInfo = ReflectionHelper .compareArguments (getTypeDescriptors (expectedTypes ), getTypeDescriptors (inputTypes ), typeConverter );
486497 if (expectedMatchKind == null ) {
487498 assertNull ("Did not expect them to match in any way" , matchInfo );
@@ -504,7 +515,7 @@ else if (expectedMatchKind == ArgumentsMatchKind.REQUIRES_CONVERSION) {
504515 /**
505516 * Used to validate the match returned from a compareArguments call.
506517 */
507- private void checkMatch2 (Class [] inputTypes , Class [] expectedTypes , StandardTypeConverter typeConverter , ArgumentsMatchKind expectedMatchKind ) {
518+ private void checkMatch2 (Class <?> [] inputTypes , Class <?> [] expectedTypes , StandardTypeConverter typeConverter , ArgumentsMatchKind expectedMatchKind ) {
508519 ReflectionHelper .ArgumentsMatchInfo matchInfo = ReflectionHelper .compareArgumentsVarargs (getTypeDescriptors (expectedTypes ), getTypeDescriptors (inputTypes ), typeConverter );
509520 if (expectedMatchKind == null ) {
510521 assertNull ("Did not expect them to match in any way: " + matchInfo , matchInfo );
@@ -535,9 +546,9 @@ private void checkArgument(Object expected, Object actual) {
535546 assertEquals (expected ,actual );
536547 }
537548
538- private List <TypeDescriptor > getTypeDescriptors (Class ... types ) {
549+ private List <TypeDescriptor > getTypeDescriptors (Class <?> ... types ) {
539550 List <TypeDescriptor > typeDescriptors = new ArrayList <TypeDescriptor >(types .length );
540- for (Class type : types ) {
551+ for (Class <?> type : types ) {
541552 typeDescriptors .add (TypeDescriptor .valueOf (type ));
542553 }
543554 return typeDescriptors ;
0 commit comments