[ https://issues.apache.org/jira/browse/JCS-139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Vandahl resolved JCS-139. -------------------------------- Resolution: Fixed Fix Version/s: jcs-2.0-alpha-2 Applied modified fix. > PropertySetter doesn't set Enum properly > ---------------------------------------- > > Key: JCS-139 > URL: https://issues.apache.org/jira/browse/JCS-139 > Project: Commons JCS > Issue Type: Bug > Affects Versions: jcs-2.0 > Reporter: Youngho Cho > Assignee: Thomas Vandahl > Fix For: jcs-2.0-alpha-2 > > Attachments: PropertySetter.java.patch > > > I saw following log > 2014-12-30 11:42:44,937 [main] WARN > org.apache.commons.jcs.utils.config.PropertySetter - Failed to set property > eventQueueType to value "POOLED". Conversion to type [class > org.apache.commons.jcs.engine.behavior.ICacheEventQueue$QueueType] failed. > Looks like enum doesn't set properly > Here is a patch > Index: PropertySetter.java > =================================================================== > --- PropertySetter.java (revision 1648479) > +++ PropertySetter.java (working copy) > @@ -263,6 +263,19 @@ > return Boolean.FALSE; > } > } > + else if( type.isEnum() ) > + { > + try > + { > + @SuppressWarnings("unchecked") > + Class<Enum> cl = (Class<Enum>) Class.forName(type.getName()); > + return Enum.valueOf( cl, v ); > + } > + catch(Exception e) > + { > + e.printStackTrace(); > + } > + } > else if ( File.class.isAssignableFrom( type ) ) > { > return new File( v ); > Thanks > Youngho -- This message was sent by Atlassian JIRA (v6.3.4#6332)