test_class.file: commons/core/src/test/java/org/openehealth/ipf/commons/core/datetime/DurationTest.java
test_class.identifier: DurationTest
test_case.body: @Test(expected=DurationFormatException.class)
      public void testParseFail2() {
          Duration.parse("x");
      }
test_case.class_method_signature: DurationTest.testParseFail2()
test_case.full_signature: @Test(expected=DurationFormatException.class) public void testParseFail2()
test_case.identifier: testParseFail2
test_case.invocations: parse
test_case.modifiers: @Test(expected=DurationFormatException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseFail2()
focal_class.declarator: EMPTY = ""
focal_class.modifier: private static final
focal_class.original_string: private static final String EMPTY = "";
focal_class.type: String
focal_class.var_name: EMPTY
focal_class.declarator: PATTERN = Pattern.compile("^[0-9]+[smhd]?$")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN = Pattern.compile("^[0-9]+[smhd]?$");
focal_class.type: Pattern
focal_class.var_name: PATTERN
focal_class.declarator: PATTERN_UNIT = Pattern.compile("[smhd]")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_UNIT = Pattern.compile("[smhd]");
focal_class.type: Pattern
focal_class.var_name: PATTERN_UNIT
focal_class.declarator: PATTERN_NUMBER = Pattern.compile("[0-9]+")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_NUMBER = Pattern.compile("[0-9]+");
focal_class.type: Pattern
focal_class.var_name: PATTERN_NUMBER
focal_class.declarator: SECOND = "s"
focal_class.modifier: private static final
focal_class.original_string: private static final String SECOND = "s";
focal_class.type: String
focal_class.var_name: SECOND
focal_class.declarator: MINUTE = "m"
focal_class.modifier: private static final
focal_class.original_string: private static final String MINUTE = "m";
focal_class.type: String
focal_class.var_name: MINUTE
focal_class.declarator: HOUR = "h"
focal_class.modifier: private static final
focal_class.original_string: private static final String HOUR = "h";
focal_class.type: String
focal_class.var_name: HOUR
focal_class.declarator: DAY = "d"
focal_class.modifier: private static final
focal_class.original_string: private static final String DAY = "d";
focal_class.type: String
focal_class.var_name: DAY
focal_class.declarator: milliseconds
focal_class.modifier: private final
focal_class.original_string: private final long milliseconds;
focal_class.type: long
focal_class.var_name: milliseconds
focal_class.file: commons/core/src/main/java/org/openehealth/ipf/commons/core/datetime/Duration.java
focal_class.identifier: Duration
focal_class.class_method_signature: Duration.Duration(long milliseconds)
focal_class.full_signature: public  Duration(long milliseconds)
focal_class.identifier: Duration
focal_class.modifiers: public
focal_class.parameters: (long milliseconds)
focal_class.signature:  Duration(long milliseconds)
focal_class.class_method_signature: Duration.getValue()
focal_class.full_signature: public long getValue()
focal_class.identifier: getValue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getValue()
focal_class.class_method_signature: Duration.since()
focal_class.full_signature: public Date since()
focal_class.identifier: since
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Date
focal_class.signature: Date since()
focal_class.class_method_signature: Duration.since(Date date)
focal_class.full_signature: public Date since(Date date)
focal_class.identifier: since
focal_class.modifiers: public
focal_class.parameters: (Date date)
focal_class.return: Date
focal_class.signature: Date since(Date date)
focal_class.class_method_signature: Duration.parse(String duration)
focal_class.full_signature: public static Duration parse(String duration)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (String duration)
focal_class.return: Duration
focal_class.signature: Duration parse(String duration)
focal_method.body: public static Duration parse(String duration) {
          String d = duration.trim();
          if (!PATTERN.matcher(d).matches()) {
              throw new DurationFormatException(
                      "Duration string " + duration + " doesn't match pattern " + PATTERN);
          }
          String u = PATTERN_NUMBER.matcher(d).replaceFirst(EMPTY);
          long v = Long.parseLong(PATTERN_UNIT.matcher(d).replaceFirst(EMPTY));
          if (u.length() == 0) {
              // v already in units of milliseconds
          } else if (u.equals(SECOND)) {
              v = v * 1000L;
          } else if (u.equals(MINUTE)) {
              v = v * 1000L * 60L;
          } else if (u.equals(HOUR)) {
              v = v * 1000L * 60L * 60L;
          } else if (u.equals(DAY)) {
              v = v * 1000L * 60L * 60L * 24L;
          } 
          return new Duration(v);
      }
focal_method.class_method_signature: Duration.parse(String duration)
focal_method.full_signature: public static Duration parse(String duration)
focal_method.identifier: parse
focal_method.invocations: trim matches matcher replaceFirst matcher parseLong replaceFirst matcher length equals equals equals equals
focal_method.modifiers: public static
focal_method.parameters: (String duration)
focal_method.return: Duration
focal_method.signature: Duration parse(String duration)