test_class.declarator: thrown = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException thrown = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: thrown
test_class.file: everrest-core/src/test/java/org/everrest/core/impl/header/HeaderHelperTest.java
test_class.identifier: HeaderHelperTest
test_case.body: @UseDataProvider("forParsesNewCookies")
      @Test
      public void parsesNewCookies(String cookieHeader, NewCookie expectedNewCookie) {
          NewCookie newCookie = HeaderHelper.parseNewCookie(cookieHeader);
  
          assertNotNull(newCookie);
          assertEquals(expectedNewCookie.getName(), newCookie.getName());
          assertEquals(expectedNewCookie.getValue(), newCookie.getValue());
          if (expectedNewCookie.getExpiry() != null) {
              assertTrue(String.format("Expiry dates are not equal. Expected %s, actual %s", expectedNewCookie.getExpiry(), newCookie.getExpiry()),
                         Math.abs(expectedNewCookie.getExpiry().getTime() - newCookie.getExpiry().getTime()) < 1000);
          }
          assertEquals(expectedNewCookie.getMaxAge(), newCookie.getMaxAge());
          assertEquals(expectedNewCookie.getPath(), newCookie.getPath());
          assertEquals(expectedNewCookie.getDomain(), newCookie.getDomain());
          assertEquals(expectedNewCookie.getComment(), newCookie.getComment());
          assertEquals(expectedNewCookie.getVersion(), newCookie.getVersion());
          assertEquals(expectedNewCookie.isSecure(), newCookie.isSecure());
          assertEquals(expectedNewCookie.isHttpOnly(), newCookie.isHttpOnly());
      }
test_case.class_method_signature: HeaderHelperTest.parsesNewCookies(String cookieHeader, NewCookie expectedNewCookie)
test_case.full_signature: @UseDataProvider("forParsesNewCookies") @Test public void parsesNewCookies(String cookieHeader, NewCookie expectedNewCookie)
test_case.identifier: parsesNewCookies
test_case.invocations: parseNewCookie assertNotNull assertEquals getName getName assertEquals getValue getValue getExpiry assertTrue format getExpiry getExpiry abs getTime getExpiry getTime getExpiry assertEquals getMaxAge getMaxAge assertEquals getPath getPath assertEquals getDomain getDomain assertEquals getComment getComment assertEquals getVersion getVersion assertEquals isSecure isSecure assertEquals isHttpOnly isHttpOnly
test_case.modifiers: @UseDataProvider("forParsesNewCookies") @Test public
test_case.parameters: (String cookieHeader, NewCookie expectedNewCookie)
test_case.return: void
test_case.signature: void parsesNewCookies(String cookieHeader, NewCookie expectedNewCookie)
focal_class.declarator: WHITESPACE_QUOTE_PATTERN = Pattern.compile("[\\s\"]")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern WHITESPACE_QUOTE_PATTERN = Pattern.compile("[\\s\"]");
focal_class.type: Pattern
focal_class.var_name: WHITESPACE_QUOTE_PATTERN
focal_class.declarator: WHITESPACE_PATTERN = Pattern.compile("\\s")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern WHITESPACE_PATTERN = Pattern.compile("\\s");
focal_class.type: Pattern
focal_class.var_name: WHITESPACE_PATTERN
focal_class.declarator: SEPARATORS = new boolean[128]
focal_class.modifier: private static final
focal_class.original_string: private static final boolean[] SEPARATORS = new boolean[128];
focal_class.type: boolean[]
focal_class.var_name: SEPARATORS
focal_class.declarator: ACCEPT_ALL_MEDIA_TYPE = Collections.singletonList(AcceptMediaType.DEFAULT)
focal_class.modifier: private static final
focal_class.original_string: private static final List<AcceptMediaType> ACCEPT_ALL_MEDIA_TYPE = Collections.singletonList(AcceptMediaType.DEFAULT);
focal_class.type: List<AcceptMediaType>
focal_class.var_name: ACCEPT_ALL_MEDIA_TYPE
focal_class.declarator: ACCEPT_ALL_LANGUAGE = Collections.singletonList(AcceptLanguage.DEFAULT)
focal_class.modifier: private static final
focal_class.original_string: private static final List<AcceptLanguage> ACCEPT_ALL_LANGUAGE = Collections.singletonList(AcceptLanguage.DEFAULT);
focal_class.type: List<AcceptLanguage>
focal_class.var_name: ACCEPT_ALL_LANGUAGE
focal_class.declarator: ACCEPT_ALL_TOKENS = Collections.singletonList(new AcceptToken("*"))
focal_class.modifier: private static final
focal_class.original_string: private static final List<AcceptToken> ACCEPT_ALL_TOKENS = Collections.singletonList(new AcceptToken("*"));
focal_class.type: List<AcceptToken>
focal_class.var_name: ACCEPT_ALL_TOKENS
focal_class.declarator: QUALITY_VALUE_COMPARATOR = new Comparator<QualityValue>() {
          @Override
          public int compare(QualityValue qualityValueOne, QualityValue qualityValueTwo) {
              float q1 = qualityValueOne.getQvalue();
              float q2 = qualityValueTwo.getQvalue();
              if (q1 < q2) {
                  return 1;
              }
              if (q1 > q2) {
                  return -1;
              }
              return 0;
          }
      }
focal_class.modifier: public static final
focal_class.original_string: public static final Comparator<QualityValue> QUALITY_VALUE_COMPARATOR = new Comparator<QualityValue>() {
          @Override
          public int compare(QualityValue qualityValueOne, QualityValue qualityValueTwo) {
              float q1 = qualityValueOne.getQvalue();
              float q2 = qualityValueTwo.getQvalue();
              if (q1 < q2) {
                  return 1;
              }
              if (q1 > q2) {
                  return -1;
              }
              return 0;
          }
      };
focal_class.type: Comparator<QualityValue>
focal_class.var_name: QUALITY_VALUE_COMPARATOR
focal_class.declarator: LIST_MEDIA_TYPE_PRODUCER = new ListHeaderProducer<>(new AcceptMediaTypeFactory())
focal_class.modifier: private static final
focal_class.original_string: private static final ListHeaderProducer<AcceptMediaType> LIST_MEDIA_TYPE_PRODUCER = new ListHeaderProducer<>(new AcceptMediaTypeFactory());
focal_class.type: ListHeaderProducer<AcceptMediaType>
focal_class.var_name: LIST_MEDIA_TYPE_PRODUCER
focal_class.declarator: LIST_LANGUAGE_PRODUCER = new ListHeaderProducer<>(new AcceptLanguageFactory())
focal_class.modifier: private static final
focal_class.original_string: private static final ListHeaderProducer<AcceptLanguage> LIST_LANGUAGE_PRODUCER = new ListHeaderProducer<>(new AcceptLanguageFactory());
focal_class.type: ListHeaderProducer<AcceptLanguage>
focal_class.var_name: LIST_LANGUAGE_PRODUCER
focal_class.declarator: LIST_TOKEN_PRODUCER = new ListHeaderProducer<>(new AcceptTokenFactory())
focal_class.modifier: private static final
focal_class.original_string: private static final ListHeaderProducer<AcceptToken> LIST_TOKEN_PRODUCER = new ListHeaderProducer<>(new AcceptTokenFactory());
focal_class.type: ListHeaderProducer<AcceptToken>
focal_class.var_name: LIST_TOKEN_PRODUCER
focal_class.file: everrest-core/src/main/java/org/everrest/core/impl/header/HeaderHelper.java
focal_class.identifier: HeaderHelper
focal_class.class_method_signature: HeaderHelper.HeaderHelper()
focal_class.full_signature: private  HeaderHelper()
focal_class.identifier: HeaderHelper
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  HeaderHelper()
focal_class.class_method_signature: HeaderHelper.createAcceptMediaTypeList(String header)
focal_class.full_signature: public static List<AcceptMediaType> createAcceptMediaTypeList(String header)
focal_class.identifier: createAcceptMediaTypeList
focal_class.modifiers: public static
focal_class.parameters: (String header)
focal_class.return: List<AcceptMediaType>
focal_class.signature: List<AcceptMediaType> createAcceptMediaTypeList(String header)
focal_class.class_method_signature: HeaderHelper.createAcceptedLanguageList(String header)
focal_class.full_signature: public static List<AcceptLanguage> createAcceptedLanguageList(String header)
focal_class.identifier: createAcceptedLanguageList
focal_class.modifiers: public static
focal_class.parameters: (String header)
focal_class.return: List<AcceptLanguage>
focal_class.signature: List<AcceptLanguage> createAcceptedLanguageList(String header)
focal_class.class_method_signature: HeaderHelper.createAcceptedCharsetList(String header)
focal_class.full_signature: public static List<AcceptToken> createAcceptedCharsetList(String header)
focal_class.identifier: createAcceptedCharsetList
focal_class.modifiers: public static
focal_class.parameters: (String header)
focal_class.return: List<AcceptToken>
focal_class.signature: List<AcceptToken> createAcceptedCharsetList(String header)
focal_class.class_method_signature: HeaderHelper.createAcceptedEncodingList(String header)
focal_class.full_signature: public static List<AcceptToken> createAcceptedEncodingList(String header)
focal_class.identifier: createAcceptedEncodingList
focal_class.modifiers: public static
focal_class.parameters: (String header)
focal_class.return: List<AcceptToken>
focal_class.signature: List<AcceptToken> createAcceptedEncodingList(String header)
focal_class.class_method_signature: HeaderHelper.parseCookies(String cookiesString)
focal_class.full_signature: public static List<Cookie> parseCookies(String cookiesString)
focal_class.identifier: parseCookies
focal_class.modifiers: public static
focal_class.parameters: (String cookiesString)
focal_class.return: List<Cookie>
focal_class.signature: List<Cookie> parseCookies(String cookiesString)
focal_class.class_method_signature: HeaderHelper.parseNewCookie(String newCookieString)
focal_class.full_signature: public static NewCookie parseNewCookie(String newCookieString)
focal_class.identifier: parseNewCookie
focal_class.modifiers: public static
focal_class.parameters: (String newCookieString)
focal_class.return: NewCookie
focal_class.signature: NewCookie parseNewCookie(String newCookieString)
focal_class.class_method_signature: HeaderHelper.parseDateHeader(String header)
focal_class.full_signature: public static Date parseDateHeader(String header)
focal_class.identifier: parseDateHeader
focal_class.modifiers: public static
focal_class.parameters: (String header)
focal_class.return: Date
focal_class.signature: Date parseDateHeader(String header)
focal_class.class_method_signature: HeaderHelper.formatDate(Date date)
focal_class.full_signature: public static String formatDate(Date date)
focal_class.identifier: formatDate
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: String
focal_class.signature: String formatDate(Date date)
focal_class.class_method_signature: HeaderHelper.getContentLengthLong(MultivaluedMap<String, String> httpHeaders)
focal_class.full_signature: public static long getContentLengthLong(MultivaluedMap<String, String> httpHeaders)
focal_class.identifier: getContentLengthLong
focal_class.modifiers: public static
focal_class.parameters: (MultivaluedMap<String, String> httpHeaders)
focal_class.return: long
focal_class.signature: long getContentLengthLong(MultivaluedMap<String, String> httpHeaders)
focal_class.class_method_signature: HeaderHelper.getHeaderAsString(Object o)
focal_class.full_signature: @SuppressWarnings({"unchecked"}) public static String getHeaderAsString(Object o)
focal_class.identifier: getHeaderAsString
focal_class.modifiers: @SuppressWarnings({"unchecked"}) public static
focal_class.parameters: (Object o)
focal_class.return: String
focal_class.signature: String getHeaderAsString(Object o)
focal_class.class_method_signature: HeaderHelper.convertToString(Collection<String> collection)
focal_class.full_signature: public static String convertToString(Collection<String> collection)
focal_class.identifier: convertToString
focal_class.modifiers: public static
focal_class.parameters: (Collection<String> collection)
focal_class.return: String
focal_class.signature: String convertToString(Collection<String> collection)
focal_class.class_method_signature: HeaderHelper.appendWithQuote(StringBuilder target, String appendMe)
focal_class.full_signature: static void appendWithQuote(StringBuilder target, String appendMe)
focal_class.identifier: appendWithQuote
focal_class.modifiers: static
focal_class.parameters: (StringBuilder target, String appendMe)
focal_class.return: void
focal_class.signature: void appendWithQuote(StringBuilder target, String appendMe)
focal_class.class_method_signature: HeaderHelper.appendEscapeQuote(StringBuilder target, String appendMe)
focal_class.full_signature: static void appendEscapeQuote(StringBuilder target, String appendMe)
focal_class.identifier: appendEscapeQuote
focal_class.modifiers: static
focal_class.parameters: (StringBuilder target, String appendMe)
focal_class.return: void
focal_class.signature: void appendEscapeQuote(StringBuilder target, String appendMe)
focal_class.class_method_signature: HeaderHelper.removeWhitespaces(String str)
focal_class.full_signature: static String removeWhitespaces(String str)
focal_class.identifier: removeWhitespaces
focal_class.modifiers: static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String removeWhitespaces(String str)
focal_class.class_method_signature: HeaderHelper.addQuotesIfHasWhitespace(String str)
focal_class.full_signature: static String addQuotesIfHasWhitespace(String str)
focal_class.identifier: addQuotesIfHasWhitespace
focal_class.modifiers: static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String addQuotesIfHasWhitespace(String str)
focal_class.class_method_signature: HeaderHelper.parseQualityValue(String qString)
focal_class.full_signature: static float parseQualityValue(String qString)
focal_class.identifier: parseQualityValue
focal_class.modifiers: static
focal_class.parameters: (String qString)
focal_class.return: float
focal_class.signature: float parseQualityValue(String qString)
focal_class.class_method_signature: HeaderHelper.isToken(String token)
focal_class.full_signature: static int isToken(String token)
focal_class.identifier: isToken
focal_class.modifiers: static
focal_class.parameters: (String token)
focal_class.return: int
focal_class.signature: int isToken(String token)
focal_class.class_method_signature: HeaderHelper.findCookieParameterSeparator(String cookie, int start)
focal_class.full_signature: private static int findCookieParameterSeparator(String cookie, int start)
focal_class.identifier: findCookieParameterSeparator
focal_class.modifiers: private static
focal_class.parameters: (String cookie, int start)
focal_class.return: int
focal_class.signature: int findCookieParameterSeparator(String cookie, int start)
focal_class.class_method_signature: HeaderHelper.removeQuoteEscapes(String token)
focal_class.full_signature: static String removeQuoteEscapes(String token)
focal_class.identifier: removeQuoteEscapes
focal_class.modifiers: static
focal_class.parameters: (String token)
focal_class.return: String
focal_class.signature: String removeQuoteEscapes(String token)
focal_method.body: public static NewCookie parseNewCookie(String newCookieString) {
          int p = 0;
          int n = findCookieParameterSeparator(newCookieString, p);
          int separator = -1;
          if (n > 0 && n < newCookieString.length()) {
              separator = newCookieString.charAt(n);
          }
          NewCookieBuilder newCookieBuilder = null;
  
          while (p < newCookieString.length()) {
  
              String pair = newCookieString.substring(p, n);
  
              String name;
              String value = "";
  
              int eq = scan(pair, '=');
              if (charAtIs(pair, eq, '=')) {
                  name = pair.substring(0, eq).trim();
                  value = pair.substring(eq + 1).trim();
                  if (value.length() > 1 && value.startsWith("\"") && value.endsWith("\"")) {
                      value = value.substring(1, value.length() - 1);
                  }
              } else {
                  name = pair.trim();
              }
  
              if (newCookieBuilder == null) {
                  newCookieBuilder = aNewCookie().withName(name).withValue(value).withVersion(Cookie.DEFAULT_VERSION);
              } else {
                  if (name.equalsIgnoreCase("version")) {
                      newCookieBuilder.withVersion(Integer.parseInt(value));
                  } else if (name.equalsIgnoreCase("domain")) {
                      newCookieBuilder.withDomain(value);
                  } else if (name.equalsIgnoreCase("path")) {
                      newCookieBuilder.withPath(value);
                  } else if (name.equalsIgnoreCase("secure")) {
                      newCookieBuilder.withSecure(true);
                  } else if (name.equalsIgnoreCase("HttpOnly")) {
                      newCookieBuilder.withHttpOnly(true);
                  } else if (name.equalsIgnoreCase("Max-Age")) {
                      newCookieBuilder.withMaxAge(Integer.parseInt(value));
                  } else if (name.equalsIgnoreCase("expires")) {
                      try {
                          newCookieBuilder.withExpiry(parseDateHeader(value));
                      } catch (IllegalArgumentException ignored) {
                          ignored.printStackTrace();
                      }
                  } else if (name.equalsIgnoreCase("comment")) {
                      newCookieBuilder.withComment(value);
                  }
              }
              if (separator == -1) {
                  break;
              }
              p = n + 1;
              n = scan(newCookieString, p, (char)separator);
          }
  
          if (newCookieBuilder == null) {
              return null;
          }
          return newCookieBuilder.build();
      }
focal_method.class_method_signature: HeaderHelper.parseNewCookie(String newCookieString)
focal_method.full_signature: public static NewCookie parseNewCookie(String newCookieString)
focal_method.identifier: parseNewCookie
focal_method.invocations: findCookieParameterSeparator length charAt length substring scan charAtIs trim substring trim substring length startsWith endsWith substring length trim withVersion withValue withName aNewCookie equalsIgnoreCase withVersion parseInt equalsIgnoreCase withDomain equalsIgnoreCase withPath equalsIgnoreCase withSecure equalsIgnoreCase withHttpOnly equalsIgnoreCase withMaxAge parseInt equalsIgnoreCase withExpiry parseDateHeader printStackTrace equalsIgnoreCase withComment scan build
focal_method.modifiers: public static
focal_method.parameters: (String newCookieString)
focal_method.return: NewCookie
focal_method.signature: NewCookie parseNewCookie(String newCookieString)