Uploaded image for project: 'Metron (Retired)'
  1. Metron (Retired)
  2. METRON-1003

ParserUtil parses dates incorrect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Minor
    • Resolution: Done
    • None
    • 0.4.1
    • None

    Description

      ParserUtils class has method convertToEpoch that takes month, day and time (as strings), parses it and returns milliseconds since epoch.

      Month expected in "MMM" format (i.e. "Jun")
      Month is parsed and then it is tried to get int value as:

      String month = String.valueOf(cal.get(Calendar.MONTH));
      

      But according to documentation (see https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#MONTH) months start from 0.
      So this method returns incorrect value.

      This method should be refactored, but would be great to fix it and write some tests before.

      This is minor bug as this method is used in FireEye parser only.

      Attachments

        Issue Links

          Activity

            People

              vladmir Vladimir
              vladmir Vladimir
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: