test_class.file: jaxrs-delegates/src/test/java/org/wso2/msf4j/delegates/MediaTypeHeaderProviderTest.java
test_class.identifier: MediaTypeHeaderProviderTest
test_class.superclass: extends Assert
test_case.body: @Test
      public void testBadType() {
          try {
              new MediaTypeHeaderProvider().fromString("texthtml");
              fail("Parse exception must've been thrown");
          } catch (Exception pe) {
              // expected
          }
  
      }
test_case.class_method_signature: MediaTypeHeaderProviderTest.testBadType()
test_case.full_signature: @Test public void testBadType()
test_case.identifier: testBadType
test_case.invocations: fromString fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBadType()
focal_class.file: jaxrs-delegates/src/main/java/org/wso2/msf4j/delegates/MediaTypeHeaderProvider.java
focal_class.identifier: MediaTypeHeaderProvider
focal_class.interfaces: implements HeaderDelegate<MediaType>
focal_class.class_method_signature: MediaTypeHeaderProvider.fromString(String mType)
focal_class.full_signature: public MediaType fromString(String mType)
focal_class.identifier: fromString
focal_class.modifiers: public
focal_class.parameters: (String mType)
focal_class.return: MediaType
focal_class.signature: MediaType fromString(String mType)
focal_class.class_method_signature: MediaTypeHeaderProvider.toString(MediaType type)
focal_class.full_signature: public String toString(MediaType type)
focal_class.identifier: toString
focal_class.modifiers: public
focal_class.parameters: (MediaType type)
focal_class.return: String
focal_class.signature: String toString(MediaType type)
focal_method.body: public MediaType fromString(String mType) {
          if (mType == null) {
              throw new IllegalArgumentException("Media type value can not be null");
          }
  
          int i = mType.indexOf('/');
          if (i == -1) {
              throw new UnsupportedOperationException("Media types without subtype is not supported");
          }
  
          int paramsStart = mType.indexOf(';', i + 1);
          int end = paramsStart == -1 ? mType.length() : paramsStart;
  
          String type = mType.substring(0, i);
          String subtype = mType.substring(i + 1, end);
  
          return new MediaType(type.trim().toLowerCase(Locale.US),
                  subtype.trim().toLowerCase(Locale.US));
      }
focal_method.class_method_signature: MediaTypeHeaderProvider.fromString(String mType)
focal_method.full_signature: public MediaType fromString(String mType)
focal_method.identifier: fromString
focal_method.invocations: indexOf indexOf length substring substring toLowerCase trim toLowerCase trim
focal_method.modifiers: public
focal_method.parameters: (String mType)
focal_method.return: MediaType
focal_method.signature: MediaType fromString(String mType)