test_class.declarator: invalidDescriptor = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
test_class.modifier: static final
test_class.original_string: static final String invalidDescriptor = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" ";
test_class.type: String
test_class.var_name: invalidDescriptor
test_class.declarator: externalEntity = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<!DOCTYPE web-app PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\" "
        +   "\"http://java.sun.com/dtd/web-app_2_3.dtd\">"
        + "<web-app></web-app>"
test_class.modifier: static final
test_class.original_string: static final String externalEntity = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<!DOCTYPE web-app PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\" "
        +   "\"http://java.sun.com/dtd/web-app_2_3.dtd\">"
        + "<web-app></web-app>";
test_class.type: String
test_class.var_name: externalEntity
test_class.declarator: withInvalidSessionDuration = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config>" + "<session-timeout>A</session-timeout>" + "</session-config>" + "</web-app>"
test_class.modifier: static final
test_class.original_string: static final String withInvalidSessionDuration = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config>" + "<session-timeout>A</session-timeout>" + "</session-config>" + "</web-app>";
test_class.type: String
test_class.var_name: withInvalidSessionDuration
test_class.declarator: withEmptySessionDuration = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config>" + "<session-timeout>A</session-timeout>" + "</session-config>" + "</web-app>"
test_class.modifier: static final
test_class.original_string: static final String withEmptySessionDuration = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config>" + "<session-timeout>A</session-timeout>" + "</session-config>" + "</web-app>";
test_class.type: String
test_class.var_name: withEmptySessionDuration
test_class.declarator: withInvalidTrackingMode = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><tracking-mode>BAD</tracking-mode></session-config>"
        + "</web-app>"
test_class.modifier: static final
test_class.original_string: static final String withInvalidTrackingMode = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><tracking-mode>BAD</tracking-mode></session-config>"
        + "</web-app>";
test_class.type: String
test_class.var_name: withInvalidTrackingMode
test_class.declarator: withUrlTrackingMode = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><tracking-mode>URL</tracking-mode></session-config>"
        + "</web-app>"
test_class.modifier: static final
test_class.original_string: static final String withUrlTrackingMode = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><tracking-mode>URL</tracking-mode></session-config>"
        + "</web-app>";
test_class.type: String
test_class.var_name: withUrlTrackingMode
test_class.declarator: withSessionConfig = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><cookie-config><secure>false</secure><http-only>true</http-only><path>/test</path></cookie-config>"
        + "<tracking-mode>COOKIE</tracking-mode></session-config>"
        + "</web-app>"
test_class.modifier: static final
test_class.original_string: static final String withSessionConfig = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><cookie-config><secure>false</secure><http-only>true</http-only><path>/test</path></cookie-config>"
        + "<tracking-mode>COOKIE</tracking-mode></session-config>"
        + "</web-app>";
test_class.type: String
test_class.var_name: withSessionConfig
test_class.declarator: withMultipleTrackingModes = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><cookie-config><secure>false</secure><http-only>true</http-only><path>/test</path></cookie-config>"
        + "<tracking-mode>COOKIE</tracking-mode><tracking-mode>URL</tracking-mode></session-config>"
        + "</web-app>"
test_class.modifier: static final
test_class.original_string: static final String withMultipleTrackingModes = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\" "
        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
        + "version=\"3.0\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\">"
        + "<session-config><cookie-config><secure>false</secure><http-only>true</http-only><path>/test</path></cookie-config>"
        + "<tracking-mode>COOKIE</tracking-mode><tracking-mode>URL</tracking-mode></session-config>"
        + "</web-app>";
test_class.type: String
test_class.var_name: withMultipleTrackingModes
test_class.file: session-replacement/src/test/java/com/amadeus/session/servlet/TestWebXmlParser.java
test_class.identifier: TestWebXmlParser
test_case.body: @Test
    public void testParseStreamDefaultSession1000() throws IOException {
      String webXml = Descriptors.create(WebAppDescriptor.class).version("3.0").createSessionConfig().sessionTimeout(1000)
          .up().exportAsString();
      try (ByteArrayInputStream bais = new ByteArrayInputStream(webXml.getBytes("UTF-8"))) {
        SessionConfiguration sessionConfiguration = new SessionConfiguration();
        WebXmlParser.parseStream(sessionConfiguration, bais);
        assertEquals(1000, sessionConfiguration.getMaxInactiveInterval());
      }
    }
test_case.class_method_signature: TestWebXmlParser.testParseStreamDefaultSession1000()
test_case.full_signature: @Test public void testParseStreamDefaultSession1000()
test_case.identifier: testParseStreamDefaultSession1000
test_case.invocations: exportAsString up sessionTimeout createSessionConfig version create getBytes parseStream assertEquals getMaxInactiveInterval
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseStreamDefaultSession1000()
focal_class.file: session-replacement/src/main/java/com/amadeus/session/servlet/WebXmlParser.java
focal_class.identifier: WebXmlParser
focal_class.class_method_signature: WebXmlParser.WebXmlParser()
focal_class.full_signature: private  WebXmlParser()
focal_class.identifier: WebXmlParser
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  WebXmlParser()
focal_class.class_method_signature: WebXmlParser.parseWebXml(SessionConfiguration conf, ServletContext context)
focal_class.full_signature: static void parseWebXml(SessionConfiguration conf, ServletContext context)
focal_class.identifier: parseWebXml
focal_class.modifiers: static
focal_class.parameters: (SessionConfiguration conf, ServletContext context)
focal_class.return: void
focal_class.signature: void parseWebXml(SessionConfiguration conf, ServletContext context)
focal_class.class_method_signature: WebXmlParser.parseStream(SessionConfiguration conf, InputStream is)
focal_class.full_signature: static void parseStream(SessionConfiguration conf, InputStream is)
focal_class.identifier: parseStream
focal_class.modifiers: static
focal_class.parameters: (SessionConfiguration conf, InputStream is)
focal_class.return: void
focal_class.signature: void parseStream(SessionConfiguration conf, InputStream is)
focal_class.class_method_signature: WebXmlParser.checkDistributable(SessionConfiguration conf, Document document, XPath xpath)
focal_class.full_signature: private static void checkDistributable(SessionConfiguration conf, Document document, XPath xpath)
focal_class.identifier: checkDistributable
focal_class.modifiers: private static
focal_class.parameters: (SessionConfiguration conf, Document document, XPath xpath)
focal_class.return: void
focal_class.signature: void checkDistributable(SessionConfiguration conf, Document document, XPath xpath)
focal_class.class_method_signature: WebXmlParser.lookForSessionTimeout(SessionConfiguration conf, Document document, XPath xpath)
focal_class.full_signature: private static void lookForSessionTimeout(SessionConfiguration conf, Document document, XPath xpath)
focal_class.identifier: lookForSessionTimeout
focal_class.modifiers: private static
focal_class.parameters: (SessionConfiguration conf, Document document, XPath xpath)
focal_class.return: void
focal_class.signature: void lookForSessionTimeout(SessionConfiguration conf, Document document, XPath xpath)
focal_class.class_method_signature: WebXmlParser.lookForSessionConf(SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.full_signature: private static void lookForSessionConf(SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.identifier: lookForSessionConf
focal_class.modifiers: private static
focal_class.parameters: (SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.return: void
focal_class.signature: void lookForSessionConf(SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.class_method_signature: WebXmlParser.lookForTrackingMode(SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.full_signature: private static void lookForTrackingMode(SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.identifier: lookForTrackingMode
focal_class.modifiers: private static
focal_class.parameters: (SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.return: void
focal_class.signature: void lookForTrackingMode(SessionConfiguration sessionConfiguration, Document document, XPath xpath)
focal_class.class_method_signature: WebXmlParser.sessionTracking(String trackingMode)
focal_class.full_signature: private static String sessionTracking(String trackingMode)
focal_class.identifier: sessionTracking
focal_class.modifiers: private static
focal_class.parameters: (String trackingMode)
focal_class.return: String
focal_class.signature: String sessionTracking(String trackingMode)
focal_class.class_method_signature: WebXmlParser.isNonEmpty(String value)
focal_class.full_signature: private static boolean isNonEmpty(String value)
focal_class.identifier: isNonEmpty
focal_class.modifiers: private static
focal_class.parameters: (String value)
focal_class.return: boolean
focal_class.signature: boolean isNonEmpty(String value)
focal_method.body: static void parseStream(SessionConfiguration conf, InputStream is) {
      if (is != null) {
        try {
          DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
          // We want to ignore schemas and dtd when parsing web.xml
          builder.setEntityResolver(new EntityResolver() {
            @Override
            public InputSource resolveEntity(String publicId, String systemId) {
              // Ignore entites!
              return new InputSource(new StringReader(""));
            }
          });
          Document document = builder.parse(is);
          XPath xpath = XPathFactory.newInstance().newXPath();
          lookForSessionTimeout(conf, document, xpath);
          lookForSessionConf(conf, document, xpath);
          checkDistributable(conf, document, xpath);
        } catch (SAXException | IOException | XPathExpressionException | ParserConfigurationException e) {
          throw new IllegalStateException("An exception occured while parsing web.xml. "
              + "Using default configuration: " + conf, e);
        }
      }
    }
focal_method.class_method_signature: WebXmlParser.parseStream(SessionConfiguration conf, InputStream is)
focal_method.full_signature: static void parseStream(SessionConfiguration conf, InputStream is)
focal_method.identifier: parseStream
focal_method.invocations: newDocumentBuilder newInstance setEntityResolver parse newXPath newInstance lookForSessionTimeout lookForSessionConf checkDistributable
focal_method.modifiers: static
focal_method.parameters: (SessionConfiguration conf, InputStream is)
focal_method.return: void
focal_method.signature: void parseStream(SessionConfiguration conf, InputStream is)