Commits

Anonymous committed 719158a

fix bug in patch for QUARTZ-640.

git-svn-id: http://svn.opensymphony.com/svn/quartz/trunk@83769f7d36a-ea1c-0410-88ea-9fd03e4c9665

  • Participants
  • Parent commits f97cc81

Comments (0)

Files changed (2)

File src/java/org/quartz/CronExpression.java

                 String expr = exprsTok.nextToken().trim();
 
                 // throw an exception if L is used with other days of the month
-                if(exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1) {
+                if(exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1 && expr.indexOf(",") >= 0) {
                     throw new ParseException("Support for specifying 'L' and 'LW' with other days of the month is not implemented", -1);
                 }
                 // throw an exception if L is used with other days of the week
-                if(exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1) {
+                if(exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1  && expr.indexOf(",") >= 0) {
                     throw new ParseException("Support for specifying 'L' with other days of the week is not implemented", -1);
                 }
                 

File src/test/java/org/quartz/CronExpressionTest.java

             assertTrue("Incorrect ParseException thrown", 
                 pe.getMessage().startsWith("Support for specifying 'L' with other days of the week is not implemented"));
         }
+        try {
+            CronExpression cronExpression = new CronExpression("0 43 9 ? * 5L");
+        } catch(ParseException pe) {
+            fail("Unexpected ParseException thrown for supported '5L' expression.");
+        }
     }
 
 }