test_class.file: httpizza/src/test/java/sexy/code/MediaTypeTest.java
test_class.identifier: MediaTypeTest
test_case.body: @Test public void testMultipleCharsets() {
          try {
              MediaType.parse("text/plain; charset=utf-8; charset=utf-16");
              fail();
          } catch (IllegalArgumentException expected) {
          }
      }
test_case.class_method_signature: MediaTypeTest.testMultipleCharsets()
test_case.full_signature: @Test public void testMultipleCharsets()
test_case.identifier: testMultipleCharsets
test_case.invocations: parse fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMultipleCharsets()
focal_class.declarator: TOKEN = "([a-zA-Z0-9-!#$%&'*+.^_`{|}~]+)"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN = "([a-zA-Z0-9-!#$%&'*+.^_`{|}~]+)";
focal_class.type: String
focal_class.var_name: TOKEN
focal_class.declarator: QUOTED = "\"([^\"]*)\""
focal_class.modifier: private static final
focal_class.original_string: private static final String QUOTED = "\"([^\"]*)\"";
focal_class.type: String
focal_class.var_name: QUOTED
focal_class.declarator: TYPE_SUBTYPE = Pattern.compile(TOKEN + "/" + TOKEN)
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern TYPE_SUBTYPE = Pattern.compile(TOKEN + "/" + TOKEN);
focal_class.type: Pattern
focal_class.var_name: TYPE_SUBTYPE
focal_class.declarator: PARAMETER = Pattern.compile(
              ";\\s*(?:" + TOKEN + "=(?:" + TOKEN + "|" + QUOTED + "))?")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PARAMETER = Pattern.compile(
              ";\\s*(?:" + TOKEN + "=(?:" + TOKEN + "|" + QUOTED + "))?");
focal_class.type: Pattern
focal_class.var_name: PARAMETER
focal_class.declarator: mediaType
focal_class.modifier: private final
focal_class.original_string: private final String mediaType;
focal_class.type: String
focal_class.var_name: mediaType
focal_class.declarator: type
focal_class.modifier: private final
focal_class.original_string: private final String type;
focal_class.type: String
focal_class.var_name: type
focal_class.declarator: subtype
focal_class.modifier: private final
focal_class.original_string: private final String subtype;
focal_class.type: String
focal_class.var_name: subtype
focal_class.declarator: charset
focal_class.modifier: private final
focal_class.original_string: private final String charset;
focal_class.type: String
focal_class.var_name: charset
focal_class.file: httpizza/src/main/java/sexy/code/MediaType.java
focal_class.identifier: MediaType
focal_class.class_method_signature: MediaType.MediaType(String mediaType, String type, String subtype, String charset)
focal_class.full_signature: private  MediaType(String mediaType, String type, String subtype, String charset)
focal_class.identifier: MediaType
focal_class.modifiers: private
focal_class.parameters: (String mediaType, String type, String subtype, String charset)
focal_class.signature:  MediaType(String mediaType, String type, String subtype, String charset)
focal_class.class_method_signature: MediaType.parse(String string)
focal_class.full_signature: public static MediaType parse(String string)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (String string)
focal_class.return: MediaType
focal_class.signature: MediaType parse(String string)
focal_class.class_method_signature: MediaType.type()
focal_class.full_signature: public String type()
focal_class.identifier: type
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String type()
focal_class.class_method_signature: MediaType.subtype()
focal_class.full_signature: public String subtype()
focal_class.identifier: subtype
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String subtype()
focal_class.class_method_signature: MediaType.charset()
focal_class.full_signature: public Charset charset()
focal_class.identifier: charset
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Charset
focal_class.signature: Charset charset()
focal_class.class_method_signature: MediaType.charset(Charset defaultValue)
focal_class.full_signature: public Charset charset(Charset defaultValue)
focal_class.identifier: charset
focal_class.modifiers: public
focal_class.parameters: (Charset defaultValue)
focal_class.return: Charset
focal_class.signature: Charset charset(Charset defaultValue)
focal_class.class_method_signature: MediaType.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: MediaType.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: MediaType.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: public static MediaType parse(String string) {
          Matcher typeSubtype = TYPE_SUBTYPE.matcher(string);
          if (!typeSubtype.lookingAt()) return null;
          String type = typeSubtype.group(1).toLowerCase(Locale.US);
          String subtype = typeSubtype.group(2).toLowerCase(Locale.US);
  
          String charset = null;
          Matcher parameter = PARAMETER.matcher(string);
          for (int s = typeSubtype.end(); s < string.length(); s = parameter.end()) {
              parameter.region(s, string.length());
              if (!parameter.lookingAt()) return null; // This is not a well-formed media type.
  
              String name = parameter.group(1);
              if (name == null || !name.equalsIgnoreCase("charset")) continue;
              String charsetParameter = parameter.group(2) != null
                      ? parameter.group(2)  // Value is a token.
                      : parameter.group(3); // Value is a quoted string.
              if (charset != null && !charsetParameter.equalsIgnoreCase(charset)) {
                  throw new IllegalArgumentException("Multiple different charsets: " + string);
              }
              charset = charsetParameter;
          }
  
          return new MediaType(string, type, subtype, charset);
      }
focal_method.class_method_signature: MediaType.parse(String string)
focal_method.full_signature: public static MediaType parse(String string)
focal_method.identifier: parse
focal_method.invocations: matcher lookingAt toLowerCase group toLowerCase group matcher end length end region length lookingAt group equalsIgnoreCase group group group equalsIgnoreCase
focal_method.modifiers: public static
focal_method.parameters: (String string)
focal_method.return: MediaType
focal_method.signature: MediaType parse(String string)