javax_xml_parsers


pattern_9 (2 partitions, 45 files)


javax.xml.parsers.SAXParserFactory.newInstance, javax.xml.parsers.SAXParserFactory.newSAXParser, javax.xml.parsers.SAXParser.parse


Cluster 1 (16 files, similarity: 0.500357191666666)

ParanoidAndroid_____android_frameworks_base_____AccessPointParserHelper
    public AccessPointParserHelper(InputStream in) throws Exception {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser saxParser = factory.newSAXParser();
        saxParser.parse(in, mHandler);
    }
            
unofficial-openjdk_____openjdk_____VmIdentifierCreateResolve
    public static void main(String args[]) throws Exception {
        File testcases =
                new File(System.getProperty("test.src", "."), "testcases");

        SAXParserFactory spf = SAXParserFactory.newInstance();
        SAXParser sp = spf.newSAXParser();
        DefaultHandler dh = new VmIdentifierTestHandler();
        sp.parse(testcases, dh);
    }
            
serge-rider_____dbeaver_____ShowTipOfTheDayHandler
        try (InputStream tipsInputStream = FileLocator.find(new URL(pathToTipsFile)).openConnection().getInputStream()) {

            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser saxParser = factory.newSAXParser();

            TipsXmlHandler handler = new TipsXmlHandler();
            saxParser.parse(tipsInputStream, handler);
            result.addAll(handler.getTips());

        } catch (SAXException | ParserConfigurationException e) {
            

pattern_8 (3 partitions, 46 files)


javax.xml.parsers.DocumentBuilderFactory.newInstance, javax.xml.parsers.DocumentBuilderFactory.newDocumentBuilder, javax.xml.parsers.DocumentBuilder.newDocument


Cluster 2 (10 files, similarity: 0.672076133333333)

JetBrains_____intellij-community_____az
   public az(ay var1, String var2, String var3, Attributes var4) throws ParserConfigurationException {
      this.d = var1;
      DocumentBuilderFactory var5 = DocumentBuilderFactory.newInstance();
      DocumentBuilder var6 = var5.newDocumentBuilder();
      this.a = var6.newDocument();
      this.a(var3, var4);
   }
            
liferay_____liferay-portal_____XMLUtil
	public static Document createDocument() throws Exception {
		DocumentBuilderFactory documentBuilderFactory =
			DocumentBuilderFactory.newInstance();

		DocumentBuilder documentBuilder =
			documentBuilderFactory.newDocumentBuilder();

		return documentBuilder.newDocument();
	}
            
x-stream_____xstream_____DomWriterTest
    protected void setUp() throws Exception {
        super.setUp();
        final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        final DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        document = documentBuilder.newDocument();
        writer = new DomWriter(document);
    }
            

Cluster 1 (13 files, similarity: 0.46422064102564103)

intuit_____karate_____XmlUtils
    public static Document newDocument() {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder;
        try {
            builder = factory.newDocumentBuilder();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return builder.newDocument();
    }
            
danfickle_____openhtmltopdf_____DOMBuilder
    try {

      /* Obtain the document builder for the configured XML parser. */
      DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
          .newInstance();

      DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

      /* Create a document to contain the content. */
      document = docBuilder.newDocument();

      Map nsMap = new HashMap();

      createDOM(jsoupDocument, document, document, nsMap);
      
    } catch (ParserConfigurationException pce) {
      throw new RuntimeException(pce);
    }
            
hunterhacker_____jdom_____JAXPDOMAdapter
        @Override
        public Document createDocument()
                        throws JDOMException {

                DocumentBuilder db = localbuilder.get();
                if (db == null) {
                        try {
                                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                                db = dbf.newDocumentBuilder();
                                localbuilder.set(db);
                        } catch (ParserConfigurationException e) {
                                throw new JDOMException("Unable to obtain a DOM parser. See cause:", e);
                        }
                }
                return db.newDocument();

        }