CloneSet73


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
27230.953method_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
124218
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
227244
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
Next
Last
Clone Instance
1
Line Count
24
Source Line
218
Source File
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java

/**
 * Get the source instance from the stream and id of the file.
 * @param is the stream containing the stylesheet data.
 * @param infile the file that will be used for the systemid.
 * @return the configured source instance matching the stylesheet.
 * @throws ParserConfigurationException if a parser cannot be created which
 * satisfies the requested configuration.
 * @throws SAXException in case of problem detected by the SAX parser.
 */
private Source getSource(InputStream is, File infile) throws ParserConfigurationException, SAXException {
  // todo: is this comment still relevant ??
  // FIXME: need to use a SAXSource as the source for the transform
  // so we can plug in our own entity resolver
  Source src = null;
  if (entityResolver != null) {
    if (getFactory().getFeature(SAXSource.FEATURE)) {
      SAXParserFactory spFactory = SAXParserFactory.newInstance();
      spFactory.setNamespaceAware(true);
      XMLReader reader = spFactory.newSAXParser().getXMLReader();
      reader.setEntityResolver(entityResolver);
      src = new SAXSource(reader, new InputSource(is));
    }
    else {
      throw new IllegalStateException("xcatalog specified, but " + "parser doesn\'t support SAX");
    }
  }
  else {
    // WARN: Don't use the StreamSource(File) ctor. It won't work with
    // xalan prior to 2.2 because of systemid bugs.
    src = new StreamSource(is);
  }
  src.setSystemId(JAXPUtils.getSystemId(infile));
  return src;
}


First
Previous
Clone Instance
2
Line Count
27
Source Line
244
Source File
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java

private Source getSource(InputStream is, Resource resource) throws ParserConfigurationException, SAXException {
  // todo: is this comment still relevant ??
  // FIXME: need to use a SAXSource as the source for the transform
  // so we can plug in our own entity resolver
  Source src = null;
  if (entityResolver != null) {
    if (getFactory().getFeature(SAXSource.FEATURE)) {
      SAXParserFactory spFactory = SAXParserFactory.newInstance();
      spFactory.setNamespaceAware(true);
      XMLReader reader = spFactory.newSAXParser().getXMLReader();
      reader.setEntityResolver(entityResolver);
      src = new SAXSource(reader, new InputSource(is));
    }
    else {
      throw new IllegalStateException("xcatalog specified, but " + "parser doesn\'t support SAX");
    }
  }
  else {
    // WARN: Don't use the StreamSource(File) ctor. It won't work with
    // xalan prior to 2.2 because of systemid bugs.
    src = new StreamSource(is);
  }
  // The line below is a hack: the system id must an URI, but it is not
  // cleat to get the URI of an resource, so just set the name of the
  // resource as a system id
  src.setSystemId(resourceToURI(resource));
  return src;
}


Clone AbstractionParameter Count: 3Parameter Bindings

/**
     * Get the source instance from the stream and id of the file.
     * @param is the stream containing the stylesheet data.
     * @param infile the file that will be used for the systemid.
     * @return the configured source instance matching the stylesheet.
     * @throws ParserConfigurationException if a parser cannot be created which
     * satisfies the requested configuration.
     * @throws SAXException in case of problem detected by the SAX parser.
     */
private Source getSource(InputStream is, [[#variable131c00a0]]  [[#variable131c0000]]) throws ParserConfigurationException, SAXException {
  // todo: is this comment still relevant ??
  // FIXME: need to use a SAXSource as the source for the transform
  // so we can plug in our own entity resolver
  Source src = null;
  if (entityResolver != null) {
    if (getFactory().getFeature(SAXSource.FEATURE)) {
      SAXParserFactory spFactory = SAXParserFactory.newInstance();
      spFactory.setNamespaceAware(true);
      XMLReader reader = spFactory.newSAXParser().getXMLReader();
      reader.setEntityResolver(entityResolver);
      src = new SAXSource(reader, new InputSource(is));
    }
    else {
      throw new IllegalStateException("xcatalog specified, but " + "parser doesn\'t support SAX");
    }
  }
  else {
    // WARN: Don't use the StreamSource(File) ctor. It won't work with
    // xalan prior to 2.2 because of systemid bugs.
    src = new StreamSource(is);
  }
  // The line below is a hack: the system id must an URI, but it is not
  // cleat to get the URI of an resource, so just set the name of the
  // resource as a system id
  src.setSystemId( [[#variablefe639a0]]);
  return src;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#131c00a0]]
File 
12[[#131c00a0]]
Resource 
21[[#131c0000]]
infile 
22[[#131c0000]]
resource 
31[[#fe639a0]]
JAXPUtils.getSystemId(infile) 
32[[#fe639a0]]
resourceToURI(resource)