Closed arseniZZZ closed 10 years ago
@arseniZZZ please submit a pull request with a fix. Thank you.
This breaks loading jobs saved with an earlier version. If "durability" was stored as the string "false" by 1.8.0, loading it with 1.9.0 throws a ClassCastException
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at com.novemberain.quartz.mongodb.MongoDBJobStore.retrieveJob(MongoDBJobStore.java:177) ~[quartz-mongodb-1.9.0.jar:na]
at $JobStore_5367b7187523.retrieveJob(Unknown Source) ~[na:na]
at org.quartz.core.QuartzScheduler.getJobDetail(QuartzScheduler.java:1518) ~[quartz-2.2.1.jar:na]
What about checking if the value is Boolean
or String
and using Boolean.parseBoolean
in the latter case?
@jochenberger sounds acceptable. I'd use Boolean.valueOf
, perhaps.
issue: permanent false value of durability of retrieving jobs from JobStore, value of durability fall into the JobDataMap, and durability had default value(false)
fix: store value of durability from JobStore into appropriate property of JobDetail(not in JobDataMap)