J. McConnell created OOZIE-2084:
-----------------------------------

             Summary: Verification of start-/end-instances for offset function 
types is incorrect
                 Key: OOZIE-2084
                 URL: https://issues.apache.org/jira/browse/OOZIE-2084
             Project: Oozie
          Issue Type: Bug
    Affects Versions: trunk
            Reporter: J. McConnell


The code to verify that the specified start-instance is equal or prior to the 
specified end-instance does not calculate the effective dates correctly. 
Currently, in org.apache.oozie.command.coord.CoordCommandUtils, it uses the 
results of TimeUnit#getCalendarUnit() as a way to scale the given values, which 
is inappropriate:

{code}
if (funcType == OFFSET) {
  TimeUnit startU = TimeUnit.valueOf(startRestArg);
  TimeUnit endU = TimeUnit.valueOf(endRestArg);
  if (startU.getCalendarUnit() * startIndex > endU.getCalendarUnit() * 
endIndex) {
    throw new CommandException(ErrorCode.E1010,
                               " start-instance should be equal or
  earlier than the end-instance \n" + XmlUtils.prettyPrint(event));
  }
  ...
}
{code}

Instead, it should probably wait a couple lines until it has created the 
{{startCal}} and {{endCal}} {{Calendar}} instances and check whether 
{{startCal.after(endCal)}}.

This was discussed here:

http://mail-archives.apache.org/mod_mbox/oozie-user/201411.mbox/%3ccajescu0gdxqy_qe08q++fboysh_h0dz_3g7tcz0upgrfylh...@mail.gmail.com%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to