From 38182f302a3fd443059622e4e0aa4d3d80dbeb55 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 23 Mar 2009 11:30:00 +0000 Subject: [PATCH] added superfluous cast as a workaround for the Sun Javac compiler --- .../core/convert/converter/StringToEnum.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/converter/StringToEnum.java b/org.springframework.core/src/main/java/org/springframework/core/convert/converter/StringToEnum.java index c1db9bb25a0..eb144443022 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/converter/StringToEnum.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/converter/StringToEnum.java @@ -17,18 +17,19 @@ package org.springframework.core.convert.converter; /** * Converts a String to a Enum using {@link Enum#valueOf(Class, String)}. - * + * * @author Keith Donald + * @since 3.0 */ @SuppressWarnings("unchecked") public class StringToEnum implements SuperTwoWayConverter { public RT convert(String source, Class targetClass) throws Exception { - return Enum.valueOf(targetClass, source); + return (RT) Enum.valueOf(targetClass, source); } public RS convertBack(Enum target, Class sourceClass) throws Exception { return (RS) target.name(); } -} \ No newline at end of file +}