Revert Java 6 specific change

This commit is contained in:
Dave Syer
2010-09-17 15:24:39 +01:00
parent 58167f1e04
commit d40fca0d37
2 changed files with 5 additions and 6 deletions

View File

@@ -69,9 +69,10 @@ public class PollingTransactionTests {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"transactionTests.xml", this.getClass());
PollingConsumer advicedPoller = context.getBean("advicedSa", PollingConsumer.class);
List<Advice> adviceChain = TestUtils.getPropertyValue(advicedPoller, "adviceChain");
@SuppressWarnings("unchecked")
List<Advice> adviceChain = TestUtils.getPropertyValue(advicedPoller, "adviceChain",List.class);
assertEquals(2, adviceChain.size());
Runnable poller = TestUtils.getPropertyValue(advicedPoller, "poller");
Runnable poller = TestUtils.getPropertyValue(advicedPoller, "poller", Runnable.class);
assertTrue("Poller is not Advised", poller instanceof Advised);
Advisor[] advisors = ((Advised)poller).getAdvisors();
assertEquals(3, advisors.length);

View File

@@ -53,7 +53,7 @@ import org.springframework.util.ErrorHandler;
*/
public abstract class TestUtils {
public static <T> T getPropertyValue(Object root, String propertyPath) {
public static Object getPropertyValue(Object root, String propertyPath) {
Object value = null;
DirectFieldAccessor accessor = new DirectFieldAccessor(root);
String[] tokens = propertyPath.split("\\.");
@@ -68,9 +68,7 @@ public abstract class TestUtils {
"intermediate property '" + tokens[i] + "' is null");
}
}
@SuppressWarnings("unchecked")
T result = (T) value;
return result;
return value;
}
@SuppressWarnings("unchecked")